Skip to content

Collaborative script editing: cut mode, revisions draft gating, docs (Phase 3, Step 5) - #1485

Open
Tim020 wants to merge 1 commit into
devfrom
feature/collab-editing-v3-p3-step5-cuts-revisions-docs
Open

Tim020 wants to merge 1 commit into
devfrom
feature/collab-editing-v3-p3-step5-cuts-revisions-docs

Conversation

@Tim020

@Tim020 Tim020 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 3, Step 5 of the collaborative script editing rebuild (#889) — the final step before the phase's exit criteria ("an admin can switch a show between the legacy and collaborative experience with the setting; both are tested; the collaborative one has full single-user parity").

Most of the backend for this step already existed from earlier phases (REQUEST_SCRIPT_CUTS, has_draft per-revision annotation, the 409 guards) — this step is primarily client wiring plus docs.

  • Cut mode (D11): CollabScriptEditor.vue's Cuts button now sends REQUEST_SCRIPT_CUTS instead of being permanently disabled, reusing the shared scriptConfigStore.cutMode flag and ScriptLineViewer's existing cut UI exactly as the classic editor does. Proactively disables Cuts with a specific reason (someone else cutting, an editor present, or an unsaved draft) rather than waiting on a round trip to find out.
  • Revisions page: surfaces the per-revision has_draft flag (already returned by the API, unused until now) to block Load/New Revision/Edit/Delete — with a tooltip explaining why — while the relevant revision has an active collaborative draft, mirroring the server's own _revision_is_locked check. Adds a Discard Draft banner + action, reusing the same "other editors will lose their work too" warning as the in-editor Discard (D9), since discard is room-wide regardless of entry point.
  • Setting un-hidden: collaborative_script_editing is no longer hide_from_ui now the editor is complete.
  • Docs: docs/pages/script_config.md's Editing/Saving sections rewritten for both modes (the old "only one person can edit" wording was legacy-only); documents cut mode and the Revisions page's draft gating.
  • Plan correction: the one open design question carried since Step 1's review (the cue editor's edit lock needing its own announce path in collab mode) was investigated and found to be based on dead/unreachable code in both clients — corrected in the plan doc, no action needed.
  • Two items from PR Collaborative script editing: Save/Stop/Discard, bulk edit (Phase 3, Step 4) #1480's review explicitly deferred as follow-up issues (Reshape BulkEditModal's emit payload into a typed union #1482, Narrow ownSaveInFlight edge case: same-client YJS_UPDATE failure right after a save can clear it prematurely #1483) stayed out of this step's scope per direction.

Test plan

  • Backend: 1281/1281 pytest, ruff check/ruff format --check clean (1 test updated for the un-hidden setting)
  • Frontend: 397/397 Vitest (22 new/updated — cut-mode wiring in CollabScriptEditor.test.ts, and a full new ScriptRevisions.test.ts, which had zero prior coverage), each significant fix mutation-tested; tsc --noEmit/eslint clean
  • E2E: full Playwright suite, both browsers — 246/246 chromium, 246/246 firefox. New/updated coverage in spec 15: full cut-mode flow (request → toggle → Save Cuts → Stop Cutting), cut/edit mutual exclusion from a third session, the Revisions page's gating + Discard Draft banner, and the admin toggle now driven through the real Settings UI rather than the API directly

🤖 Generated with Claude Code

https://claude.ai/code/session_01TjTnfchFvvQvKZUZv2jpT8

…(Phase 3, Step 5)

- CollabScriptEditor.vue: wire REQUEST_SCRIPT_CUTS for collab-mode cut mode (D11),
  reusing the shared scriptConfigStore.cutMode flag and ScriptLineViewer's existing
  cut UI (which already gates on it) exactly as the classic editor does — no server
  changes needed, REQUEST_SCRIPT_CUTS and the cuts REST save/exclusivity guards were
  already fully implemented. Proactively disables Cuts with a reason (someone else
  cutting, an editor present, or an unsaved draft) rather than waiting on a round trip.
- ScriptRevisions.vue: surfaces per-revision `has_draft` (already returned by the API,
  unused until now) to block Load/New Revision/Edit/Delete with a tooltip while the
  relevant revision has an active collaborative draft, mirroring the server's own
  `_revision_is_locked` check exactly. Adds a Discard Draft banner + action for the
  current revision, using the same "other editors will lose their work too" warning as
  the in-editor Discard (D9) — discard is room-wide regardless of entry point.
- settings.py: un-hides `collaborative_script_editing` now the editor is complete.
- docs/pages/script_config.md: rewrites the Editing/Saving sections for both modes
  (the old "only one person can edit" wording was legacy-only); documents cut mode and
  the Revisions page's draft gating.
- The one open design question carried since Step 1's review (the cue editor's edit
  lock needing its own announce path in collab mode) turned out to be based on dead
  code in both clients — corrected in the plan doc, no action needed.
- Two items from PR #1480's review explicitly deferred as follow-up issues (#1482,
  #1483), kept out of this step's scope per Tim's direction.

Tests: 22 new/updated Vitest (cut-mode wiring, ScriptRevisions.vue from scratch — it
had none), each mutation-tested; 1 backend test updated for the un-hidden setting.
New/updated E2E in spec 15: full cut-mode flow (request, toggle, Save Cuts, Stop
Cutting), cut/edit mutual exclusion from a third session, the Revisions page's
gating + Discard Draft banner, and the admin toggle now driven through the real
Settings UI rather than the API directly. Backend 1281/1281, frontend Vitest 397/397,
typecheck/lint clean, full Playwright suite 246/246 both chromium and firefox.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TjTnfchFvvQvKZUZv2jpT8
@Tim020 Tim020 added the claude Issues created by Claude label Oct 29, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation large-diff server Pull requests changing back end code client-v3 labels Oct 29, 2026
@github-actions

Copy link
Copy Markdown

Client Test Results

102 tests   102 ✅  0s ⏱️
  9 suites    0 💤
  1 files      0 ❌

Results for commit fa4291e.

@github-actions

Copy link
Copy Markdown

Client V3 Test Results

397 tests   397 ✅  4s ⏱️
 30 suites    0 💤
  1 files      0 ❌

Results for commit fa4291e.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Python Test Results

    1 files      1 suites   1m 18s ⏱️
1 281 tests 1 281 ✅ 0 💤 0 ❌
1 312 runs  1 312 ✅ 0 💤 0 ❌

Results for commit fa4291e.

@github-actions

Copy link
Copy Markdown

Playwright E2E Results (chromium)

246 tests   246 ✅  2m 30s ⏱️
 15 suites    0 💤
  1 files      0 ❌

Results for commit fa4291e.

@github-actions

Copy link
Copy Markdown

Playwright E2E Results (firefox)

246 tests   246 ✅  2m 34s ⏱️
 15 suites    0 💤
  1 files      0 ❌

Results for commit fa4291e.

This branch has not been deployed

No deployments
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 documentation Improvements or additions to documentation large-diff server Pull requests changing back end code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant