Fix cut mode in V3 script editor - #1165
Merged
Merged
Conversation
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>
Client V3 Test Results23 tests 23 ✅ 0s ⏱️ Results for commit 7a0578e. ♻️ This comment has been updated with latest results. |
Client Test Results128 tests 128 ✅ 0s ⏱️ Results for commit 7a0578e. ♻️ This comment has been updated with latest results. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Tim020
enabled auto-merge (squash)
June 7, 2026 21:48
Python Test Results 1 files 1 suites 1m 48s ⏱️ Results for commit 7a0578e. |
Playwright E2E Results (chromium)170 tests 170 ✅ 1m 38s ⏱️ Results for commit 7a0578e. |
Playwright E2E Results (firefox)170 tests 170 ✅ 1m 41s ⏱️ Results for commit 7a0578e. |
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
Bug 1 (cut links never appeared):
canEditwas computed asisEditor && !cutMode, making the conditioncanEdit && isCutModeinScriptLineViewerpermanently false. Fixed by computingcanEdit = isEditoronly — matching V2 behaviour. All edit-only UI surfaces already have their own independent!isCutModeguards.Bug 2 (blank-page flash + edit-button flicker on exit):
stopEditing()always calledemptyScript()+loadPage()even in cut mode wheretmpScriptwas never modified. This caused a blank page between the clear and reload. Additionally,cutModewas set to false beforecurrentEditorwas cleared, causing edit buttons to briefly appear. Fixed by:emptyScript()/loadPage()when exiting cut mode (V2 uses a synchronous in-memory reset, not a re-fetch)currentEditorsynchronously before sendingSTOP_SCRIPT_EDIT, soisEditorgoes false in the same tick ascutModeTest plan
npm run typecheckpassesnpm run lintpasses🤖 Generated with Claude Code