-
Notifications
You must be signed in to change notification settings - Fork 3
Collaborative Script Editing #905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Tim020
wants to merge
12
commits into
dev
Choose a base branch
from
feature/collaborative-editing
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
Adds the backend foundation for collaborative script editing (Phase 1 Batch 1): - pycrdt dependency for CRDT/Yjs-compatible document sync - ScriptDraft model following CompiledScript file-pointer pattern - draft_script_path setting for draft file storage - ERROR_SCRIPT_DRAFT_ACTIVE constant for 409 conflict responses Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Chains from fbb1b6bd8707 (CrewAssignment). Creates script_drafts table with unique constraint on revision_id and CASCADE delete from script_revisions. Also fixes FK reference in ScriptDraft model (user table, not users). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 1 Batch 3 of collaborative editing: - line_to_ydoc.py: Two-phase conversion (main thread DB query + background thread Y.Doc construction) with selectinload for N+1 avoidance - script_room_manager.py: ScriptRoom (Y.Doc + client tracking + save lock) and RoomManager (lazy room creation, periodic checkpointing with atomic writes, idle eviction, stale draft cleanup) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 1 Batch 4 of collaborative editing: - WebSocket: JOIN_SCRIPT_ROOM, LEAVE_SCRIPT_ROOM, YJS_SYNC (2-step), YJS_UPDATE, YJS_AWARENESS handlers with base64 binary transport - on_close: Auto-remove client from collaborative editing rooms - App server: Initialize RoomManager on startup, create draft_script_path directory, clean up stale draft records and unreferenced files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 tests covering: - build_ydoc: empty script, single line, linked list traversal, multi-page, unordered input, multiple line parts, null handling - Base64 round-trip: full state and incremental updates - CRDT convergence: concurrent field edits, concurrent text inserts, offline edit and reconnect - ScriptRoom: client add/remove, sync state, apply update, broadcast with sender exclusion, failed write resilience, dirty tracking Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 2 Steps 2.1-2.4: - yjs and lib0 dependencies - ScriptDocProvider: custom Yjs provider using existing WebSocket connection with base64 binary transport and OP code messages - useYjsBinding: Vue 2.7 reactive bindings for Y.Map, Y.Text, Y.Array - scriptDraft Vuex module: room state, Y.Doc lifecycle, provider management, collaborator tracking - WebSocket message routing: Yjs OPs handled in SOCKET_ONMESSAGE and dispatched to HANDLE_DRAFT_MESSAGE Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…5-2.6) Add a dual-write bridge between Y.Doc and TMP_SCRIPT Vuex state so existing ScriptLineEditor/ScriptLinePart components continue to work unchanged while collaborative sync happens through the Y.Doc. - Create yjsBridge.js with Y.Doc↔TMP_SCRIPT conversion utilities - Join/leave draft room in ScriptEditor lifecycle hooks - Set up observeDeep on Y.Doc pages for remote change propagation - Use 'local-bridge' transaction origin to prevent observer loops - Wire add/delete/update line operations to Y.Doc - Sync from Y.Doc on page navigation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ScriptEditor.vue assumed CURRENT_REVISION was already populated in Vuex, but it's only loaded by the ScriptRevisions component on a different route. Adding GET_SCRIPT_REVISIONS to ScriptEditor's beforeMount ensures the revision ID is available for joining the collaborative editing room. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove updateYDocLine bridge function — components now write directly to Y.Map/Y.Text. ScriptLinePart gains yPartMap prop with: - @input handler for keystroke-level Y.Text sync - Y.Map writes for character/group dropdown changes - Y.Text and Y.Map observers for remote change handling - Lifecycle setup/teardown for observers Export nullToZero/zeroToNull from yjsBridge for component use. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ScriptLineEditor gains yLineMap prop with: - Y.Map writes for act_id, scene_id, stage_direction_style_id on change - yPartMap pass-through to ScriptLinePart children via getYPartMap() - addLinePart creates Y.Map structure in Y.Doc for new parts - Y.Map observer for remote changes to line-level fields - Lifecycle setup/teardown for observers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- lineChange() is now a no-op in collab mode (components write directly to Y.Map/Y.Text; observer handles TMP_SCRIPT sync) - Remove syncingFromYDoc guard flag and local-bridge origin skip from the Y.Doc deep observer — all changes flow through to TMP_SCRIPT - Add getYLineMap() and pass y-line-map prop to ScriptLineEditor - Rework add/delete/insert line operations: build complete lineObj (with inherited act_id/scene_id) before writing to Y.Doc - Extract addLineOfType() helper to reduce duplication across addNewLine, addStageDirection, addCueLine, addSpacing - Remove addLineToYDoc/deleteLineFromYDoc wrappers (inlined) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Server broadcasts ROOM_MEMBERS on client join/leave/disconnect so all participants have an up-to-date collaborator list. Clients send YJS_AWARENESS messages with their current editing position (page and line index) which are relayed to other room members for line-level presence tracking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
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
Pull requests changing front end code
server
Pull requests changing back end code
xlarge-diff
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.




No description provided.