TT-7621 fix: act on a segment click instead of swallowing it - #528
Open
nabalone wants to merge 2 commits into
Open
TT-7621 fix: act on a segment click instead of swallowing it#528nabalone wants to merge 2 commits into
nabalone wants to merge 2 commits into
Conversation
This was referenced Aug 22, 2026
nabalone
marked this pull request as ready for review
August 24, 2026 13:17
nabalone
force-pushed
the
TT-7621_pbt-segment-selection-and-recorder-state
branch
from
August 24, 2026 21:56
5bef41e to
3f3ee57
Compare
nabalone
force-pushed
the
TT-7621_pbt-segment-click-not-swallowed
branch
from
August 24, 2026 21:57
8f02f20 to
83fb394
Compare
Base automatically changed from
TT-7621_pbt-segment-selection-and-recorder-state
to
develop
August 24, 2026 22:33
Clicking the segment immediately after the current one did nothing: the playhead snapped back, the label never changed, and the user had to click again. Record also stayed enabled for the segment they were leaving, so a take recorded then went to the old segment. After a segment finishes playing, handleRegionPlayEnd parks and arms pendingOvershootSwallowRef, because playback overshoot into the next region produces a spurious +1 segment change that would otherwise read as navigation (TT-7360). The swallow cannot tell that change apart from the user clicking the next segment, so it ate both. The waveform now reports a click distinctly: useWavesurferRegions fires onRegionClicked from handleRegionClick, threaded up through useWaveSurfer, WSAudioPlayer and PassageDetailPlayer as onSegmentClick. A click is deliberate and so can never be overshoot, so the step disarms the swallow when one arrives. Playhead-driven selection still flows through onCurrentRegion exactly as before, which is what the swallow is there for. Fixes two of the reported behaviours: the ignored first click, and the waveform selection disagreeing with the segment label (the same swallowed click, seen from the other side). Both tests are renamed to what they now assert. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
nabalone
force-pushed
the
TT-7621_pbt-segment-click-not-swallowed
branch
from
August 25, 2026 12:40
83fb394 to
eadea7b
Compare
This change only stops a segment click being swallowed. Two other defects the same spec covers - Record staying operable while a clicked segment plays, and the waveform selection disagreeing with the segment label - are fixed separately, but their @known-defect tags had been dropped along with the one that is fixed here. CI runs cy:run-ct with grepTags=-@known-defect, so both went red. Restore the tags and the original names on those two, leaving only the click-swallow test in the default run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Fix 2 of the PBT series. Into #527.
The fault
Clicking the segment immediately after the current one sometimes failed to fully change the selected segment, so a take recorded then went to the old segment.
After a segment finishes playing,
handleRegionPlayEndparks and armspendingOvershootSwallowRef, because playback overshoot into the next region produces a spurious +1 segment change that would otherwise read as navigation (TT-7360). The swallow cannot tell that change apart from the user clicking the next segment, so it ate both.The fix
The waveform now reports a click distinctly:
useWavesurferRegionsfiresonRegionClickedfromhandleRegionClick, threaded up throughuseWaveSurfer→WSAudioPlayer→PassageDetailPlayerasonSegmentClick. A click is deliberate and therefore never overshoot, so the step disarms the swallow when one arrives. Playhead-driven selection still flows throughonCurrentRegionunchanged — which is what the swallow exists for.Additive throughout: every layer takes an optional callback, so other players are unaffected.
Result
Two reported behaviours fixed — the ignored first click, and the waveform selection disagreeing with the segment label (the same swallowed click from the other side). Both tests renamed to what they now assert.
WSAudioPlayer/MediaRecord/PassageDetailCarefulSpeech: 41 green🤖 Generated with Claude Code