Skip to content

Fix Act/Scene heading spuriously repeating mid-scene in live show view#1290

Merged
Tim020 merged 1 commit into
devfrom
feature/fix-act-scene-heading-repeat
Jul 9, 2026
Merged

Fix Act/Scene heading spuriously repeating mid-scene in live show view#1290
Tim020 merged 1 commit into
devfrom
feature/fix-act-scene-heading-repeat

Conversation

@Tim020

@Tim020 Tim020 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The Act/Scene heading in the live show view (client-v3) could spuriously re-appear partway through a scene, whenever a cut/spacing line landed exactly at a page boundary
  • Root cause: useScriptNavigation.ts's walk-back-past-cut-lines logic was reimplemented during the Vue 3 migration using a single-page Array.indexOf lookup 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 failed
  • Same bug was independently duplicated in the needsIntervalBanner computed in both ScriptLineViewer.vue and ScriptLineViewerCompact.vue
  • Fix: added a shared getPreviousLineAcrossPages helper (mirroring V2's getPreviousLineForIndex) and used it at all 4 affected call sites

Test plan

  • Added 12 unit tests in client-v3/src/composables/useScriptNavigation.test.ts covering 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-lint all pass in client-v3
  • Confirmed fixed against the live show that originally reproduced the bug

🤖 Generated with Claude Code

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.
@Tim020 Tim020 added the claude Issues created by Claude label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Client V3 Test Results

35 tests   35 ✅  0s ⏱️
 3 suites   0 💤
 1 files     0 ❌

Results for commit 39c1eff.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Client Test Results

128 tests   128 ✅  0s ⏱️
  6 suites    0 💤
  1 files      0 ❌

Results for commit 39c1eff.

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Python Test Results

  1 files    1 suites   2m 11s ⏱️
704 tests 704 ✅ 0 💤 0 ❌
709 runs  709 ✅ 0 💤 0 ❌

Results for commit 39c1eff.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Playwright E2E Results (chromium)

217 tests   217 ✅  2m 13s ⏱️
 14 suites    0 💤
  1 files      0 ❌

Results for commit 39c1eff.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Playwright E2E Results (firefox)

217 tests   217 ✅  2m 14s ⏱️
 14 suites    0 💤
  1 files      0 ❌

Results for commit 39c1eff.

@Tim020
Tim020 merged commit b5c1cd4 into dev Jul 9, 2026
35 checks passed
@Tim020
Tim020 deleted the feature/fix-act-scene-heading-repeat branch July 9, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude Issues created by Claude client-v3 medium-diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant