Teleprompter text starts at the top of the floating window instead of vertically centered (word-tracking mode)
还没有人认领这个 Issue。
评估
调研方向
从 MarqueeTextView.swift 开始,检查 SpeechScrollView 的 isListening 变更处理程序和现有的 geo.size.height 处理程序。比较它们在初始状态下的行为,然后在 Floating Window + Word Tracking 和 Silence-Paused 模式中验证:开始识别时第一行仍保持垂直居中,同时不改变 Classic 模式的行为。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Swift
- 星标
- 4.2k
- 派生
- 296
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
f/textream 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
Abdulla未关闭
难度 5/5 一周以上 新手友好度 10/100
-
Top up abdulla未关闭
难度 5/5 一周以上 新手友好度 1/100
-
难度 4/5 3-5 天 新手友好度 55/100
相似的 Issue
-
area: agents area: layout S3: minor
难度 2/5 1-3 小时 新手友好度 62/100
manaflow-ai/cmux#34277 · 1 条评论 ·
维护者通常 1 天内回复
-
bug core p3
难度 2/5 1-3 小时 新手友好度 72/100
RunanywhereAI/runanywhere-sdks#1258 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
googleapis/google-cloud-swift#1581 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Starmel/OpenSuperWhisper#232 ·