Teleprompter text starts at the top of the floating window instead of vertically centered (word-tracking mode)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start in MarqueeTextView.swift, in SpeechScrollView’s isListening change handler and the existing geo.size.height handler. Compare their initial-state behavior, then verify in Floating Window + Word Tracking and Silence-Paused modes that the first line remains vertically centered when recognition starts without changing Classic mode behavior.
Written by the indexing model from the issue text.
Description
Version: 1.6.5 (reproduced on master, commit 1b2f26d)
Mode: Floating Window + Word Tracking
Summary
When the teleprompter opens, the first line is supposed to sit roughly halfway down the window, leaving blank space above it that fills in as the text scrolls up. In Word Tracking mode this doesn't happen — the first line is pinned to the very top of the window, partly clipped by the fade at the top inner edge, and it never moves down.
The offset is computed correctly when the view appears, then gets overwritten ~400ms later when speech recognition starts.
Steps to reproduce
- Settings → Overlay Mode → Floating Window (leave "Follow cursor when undocked" off)
- Settings → Listening Mode → Word Tracking
- Start the teleprompter
Expected
First line of text roughly vertically centered, with blank space above it.
Actual
First line sits flush at the top of the window and stays there.
Mode dependency
This only reproduces in Word Tracking (and should apply to Silence-Paused for the same reason). In Classic mode it does not occur.
The difference is isEffectivelyListening (NotchOverlayController.swift):
case .wordTracking, .silencePaused:
return speechRecognizer.isListening // starts false, flips true when recognition starts
case .classic:
return !isPaused // already true on first render, never changes
In Classic the value never changes, so the onChange handler below never fires. In Word Tracking it flips false → true shortly after the window opens, and that's what triggers the bug.
Root cause
MarqueeTextView.swift, SpeechScrollView:
.onAppear(line 172) correctly sets the initial offset:scrollOffset = containerHeight * 0.5 - lineHeight * 0.5.onChange(of: isListening)(line 159) then callsrecalcCenter(containerHeight:)when recognition startsrecalcCenter(line 249) computestarget = center - wordY— the formula for keeping the active word centered mid-scroll. In the initial state, withhighlightedCharCount == 0, this produces a value that collapses the offset to ~0.
Note that .onChange(of: geo.size.height) (line 137) already guards this exact situation:
if highlightedCharCount == 0 && smoothWordProgress == 0 {
// Initial state: center first line on screen
let lineHeight = font.pointSize * 1.4
scrollOffset = newHeight * 0.5 - lineHeight * 0.5
} else if isListening {
recalcCenter(containerHeight: newHeight)
}
The isListening handler has no equivalent guard, so it calls recalcCenter unconditionally.
Trace
Instrumented run, 480×360 floating window, XL font, Word Tracking:
prefChange wasEmpty=true count=113 h=0.0 offset=0.0
recalcCenter h=0.0 smooth=false idx=0 yPos=113 offset=0.0
onAppear h=312.0 words=113
prefChange wasEmpty=false count=98 h=312.0 offset=139.2 <- correct
onChange(isListening)=true h=312.0 offset=139.2
recalcCenter h=312.0 smooth=false idx=0 yPos=98 offset=139.2
prefChange wasEmpty=false count=113 h=312.0 offset=2.8 <- collapsed to top
onAppear sets 139.2 (correct: 312/2 - 33.6/2). Roughly 390ms later isListening flips true, recalcCenter runs, and the offset drops to 2.8 — the text jumps to the top and stays there.
Note
Resizing the window afterwards fixes it, because that fires .onChange(of: geo.size.height), which does have the initial-state guard and restores the correct offset. That's a useful confirmation of the diagnosis, and also why the bug can look intermittent.
Suggested direction
Apply the same initial-state guard already used in the geo.size.height handler, so recalcCenter isn't called before any text has been spoken. Happy to open a PR if that approach sounds right.
- Dominant language
- Swift
- Stars
- 3.8k
- Forks
- 265
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 6
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from f/textream
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
produccion Open
Difficulty 5/5 Over a week Newbie friendliness 5/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Similar issues
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ionic-team/capacitor#8616 ·