Skip to content

Fix cut mode in V3 script editor - #1165

Merged
Tim020 merged 2 commits into
devfrom
feature/fix-cut-mode-v3
Jun 7, 2026
Merged

Fix cut mode in V3 script editor#1165
Tim020 merged 2 commits into
devfrom
feature/fix-cut-mode-v3

Conversation

@Tim020

@Tim020 Tim020 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bug 1 (cut links never appeared): canEdit was computed as isEditor && !cutMode, making the condition canEdit && isCutMode in ScriptLineViewer permanently false. Fixed by computing canEdit = isEditor only — matching V2 behaviour. All edit-only UI surfaces already have their own independent !isCutMode guards.

  • Bug 2 (blank-page flash + edit-button flicker on exit): stopEditing() always called emptyScript() + loadPage() even in cut mode where tmpScript was never modified. This caused a blank page between the clear and reload. Additionally, cutMode was set to false before currentEditor was cleared, causing edit buttons to briefly appear. Fixed by:

    • Skipping emptyScript()/loadPage() when exiting cut mode (V2 uses a synchronous in-memory reset, not a re-fetch)
    • Clearing currentEditor synchronously before sending STOP_SCRIPT_EDIT, so isEditor goes false in the same tick as cutMode

Test plan

  • npm run typecheck passes
  • npm run lint passes
  • Full Playwright E2E suite passes (170/170 tests)
  • 6 new E2E tests added covering the full cut mode workflow: enter cut mode, lines become clickable, toggle cut styling, save cuts, exit without blank flash, cut styling persists on re-entry

🤖 Generated with Claude Code

Bug 1: canEdit was computed as `isEditor && !cutMode`, so lines were
never rendered as clickable cut anchors (required canEdit && isCutMode).
Fix: canEdit = isEditor only (matching V2 behaviour); all edit-only
surfaces already have independent !isCutMode guards.

Bug 2: stopEditing() always called emptyScript() + loadPage() causing a
blank-page flash. Also, currentEditor was not cleared synchronously, so
edit buttons briefly appeared after setCutMode(false) before the WS
response arrived. Fix: skip the reload in cut mode (tmpScript is never
modified), and clear currentEditor synchronously before sending
STOP_SCRIPT_EDIT.

Adds 6 Playwright E2E tests covering the full cut mode workflow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Tim020 Tim020 added the claude Issues created by Claude label Jun 7, 2026
@github-actions github-actions Bot added small-diff Small pull request client-v3 labels Jun 7, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Client V3 Test Results

23 tests   23 ✅  0s ⏱️
 2 suites   0 💤
 1 files     0 ❌

Results for commit 7a0578e.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Client Test Results

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

Results for commit 7a0578e.

♻️ This comment has been updated with latest results.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 7, 2026

Copy link
Copy Markdown

@Tim020
Tim020 enabled auto-merge (squash) June 7, 2026 21:48
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Python Test Results

  1 files    1 suites   1m 48s ⏱️
662 tests 662 ✅ 0 💤 0 ❌
667 runs  667 ✅ 0 💤 0 ❌

Results for commit 7a0578e.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Playwright E2E Results (chromium)

170 tests   170 ✅  1m 38s ⏱️
 14 suites    0 💤
  1 files      0 ❌

Results for commit 7a0578e.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Playwright E2E Results (firefox)

170 tests   170 ✅  1m 41s ⏱️
 14 suites    0 💤
  1 files      0 ❌

Results for commit 7a0578e.

@Tim020
Tim020 merged commit 8e414e9 into dev Jun 7, 2026
35 checks passed
@Tim020
Tim020 deleted the feature/fix-cut-mode-v3 branch June 7, 2026 21:50
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 small-diff Small pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant