Fix Act/Scene heading spuriously repeating mid-scene in live show view#1290
Merged
Conversation
The Vue 3 migration reimplemented the walk-back-past-cut-lines logic in useScriptNavigation.ts using a single-page Array.indexOf lookup instead of the page-crossing walk the legacy Vue 2 client used. When that walk reached the first line of a page while still skipping cut/spacing lines, it gave up and treated the previous line as null, causing the heading to spuriously re-render even though the true previous line one page back was the same act/scene. The same bug was independently duplicated in the needsIntervalBanner computed in both live-view components. Adds a shared getPreviousLineAcrossPages helper (mirroring V2's getPreviousLineForIndex) and uses it in all four affected call sites.
Client V3 Test Results35 tests 35 ✅ 0s ⏱️ Results for commit 39c1eff. |
Client Test Results128 tests 128 ✅ 0s ⏱️ Results for commit 39c1eff. |
|
Python Test Results 1 files 1 suites 2m 11s ⏱️ Results for commit 39c1eff. |
Playwright E2E Results (chromium)217 tests 217 ✅ 2m 13s ⏱️ Results for commit 39c1eff. |
Playwright E2E Results (firefox)217 tests 217 ✅ 2m 14s ⏱️ Results for commit 39c1eff. |
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.



Summary
useScriptNavigation.ts's walk-back-past-cut-lines logic was reimplemented during the Vue 3 migration using a single-pageArray.indexOflookup with no cross-page fallback, unlike the legacy Vue 2 mixins (scriptNavigationMixin.ts/scriptDisplayMixin.ts) which correctly cross page boundaries. When the walk-back reached the first line of a page it gave up instead of continuing into the previous page, so the act/scene continuity check spuriously failedneedsIntervalBannercomputed in bothScriptLineViewer.vueandScriptLineViewerCompact.vuegetPreviousLineAcrossPageshelper (mirroring V2'sgetPreviousLineForIndex) and used it at all 4 affected call sitesTest plan
client-v3/src/composables/useScriptNavigation.test.tscovering the exact regression scenario (cut/spacing line at a page boundary, same-scene continuity, genuine scene changes, character heading changes)npm run test:run,npm run typecheck,npm run ci-lintall pass inclient-v3🤖 Generated with Claude Code