fix: unify scroll anchor and add smooth-mode lookahead - #73
Open
samgutentag wants to merge 1 commit into
Open
Conversation
recalcCenter() anchors the active word, and wordProgressAtCurrentOffset() reads the word back at a reference line — but the two disagreed. Smooth modes (classic/silence-paused) anchored near the bottom edge while the resume path read from the vertical center, so releasing a manual scroll snapped the text by ~half the window height. Both now share a single readingAnchorY() helper. The smooth-mode anchor also sat 20pt above the bottom, giving the speaker zero lookahead — any word past the timer was below the window. It now sits at 70% of viewport height so a couple of upcoming lines stay visible. Word-tracking mode is unchanged (active word still centered). This is the still-relevant half of the original f#64. The other two fixes in that PR — preferring the word-level matcher on divergence, and isSpeaking hysteresis — were independently superseded upstream by the SpeechTextAlignment.bestOffset refactor and the VoiceActivityDetector. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #64.
Two coupled scroll bugs in smooth modes (classic / silence-paused), one file (
MarqueeTextView.swift):1. Anchor mismatch on manual-scroll release.
recalcCenter()anchors the active word andwordProgressAtCurrentOffset()reads the word back at a reference line, but the two used different reference points — the active word was anchored near the bottom edge while the resume path read from the vertical center. Releasing a manual scroll snapped the text by roughly half the window height. Both now share onereadingAnchorY()helper.2. No lookahead. The smooth-mode anchor sat 20pt above the bottom, so any word past the timer position was below the visible window. It now sits at 70% of viewport height, keeping a couple of upcoming lines visible. Word-tracking mode is unchanged (active word still centered).
Relationship to #64: this is the still-relevant half of #64, rebased onto current master as a single commit. The other two fixes there were independently superseded upstream — the word-level-matcher-on-divergence fix by the
SpeechTextAlignment.bestOffsetrefactor, and theisSpeakinghysteresis byVoiceActivityDetector.Built green on master (1.6.2); verified by manual scroll + release in both smooth modes.