Conversation
…sionRestore Replace throwing stubs with real inject-based implementations for useAwareness, useEditor, useYText, and useCurrentUser. Provide readOnlyCompartment from Canvas.vue so useEditor can toggle read-only state via the same Compartment that EditorCodeMirror uses. Wire VersionPreviewModal to call useVersionRestore().restoreVersion() instead of raw window.__cmView.dispatch(), gaining concurrent editor detection, read-only locking, awareness broadcasting, and atomic Y.js transactions with origin tagging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add useRestoreNotification composable that watches Y.js awareness states
for other users' 'restoring' field transitions. When another user starts
a restore, shows an info toast: "{name} restored a previous version".
Wired into Canvas.vue where awareness is provided.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
useVersionRestore called useYText/useAwareness/useEditor at setup time, which threw when injected shallowRefs were null (editor not yet ready). This crashed VersionPreviewModal on mount, causing 10 E2E failures. Now uses lazy inject: inject() at setup (Vue requirement), .value access deferred to restoreVersion(). Modal mounts safely; restore only needs the editor when actually triggered. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Raw fetch('/api/...') hit Vite's SPA fallback in CI/Docker, returning
index.html instead of version content. Now uses the injected axios api
client (same as VersionPreviewModal) which has the correct baseURL.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Unskip 3 previously-skipped tests and add 3 new tests for version restore safety features: concurrent editor detection, read-only lock, in-progress guard, restore notification, network failure recovery, and single-user restore (no concurrent warning). Tests depend on composable wiring (std-fku4) and restore notification (std-7oh1). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for rsm-studio-site canceled.
|
✅ Deploy Preview for rsm-studio-frontend ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Preview DeployFrontend: https://pr-373--rsm-studio-frontend.netlify.app Test user: This preview will be destroyed when the PR is closed. |
1. useRestoreNotification.ts: Fix array destructuring bug — Y.js awareness emits (changes, origin) as separate args, not an array. Changed `([changes])` to `(changes)`. 2. version-restore.spec.js read-only test: Replace `view.state.readOnly` with `contentDOM.contentEditable` check. Remove route interceptor delay since lock happens after API returns, not during. 3. version-restore.spec.js notification test: Replace non-existent `[data-testid="restore-notification"]` with `.toast-container .toast-message` selector matching the actual Toast component. 4. version-restore.spec.js network failure test: Add dialog handler for browser alert, dismiss modal before testing editor editability. Also fixed unit test mock to emit awareness changes as separate args matching real Y.js behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three CI failures fixed: 1. Concurrent editor detection: composable uses native confirm(), not a DOM element. Switched to Playwright dialog handler to capture and verify the confirm message contains the concurrent editor's name. 2. Read-only during restore: polling contentEditable missed the 1s lock window. Replaced with MutationObserver that records whether contentEditable was ever set to 'false' during the restore. 3. Toast notification selector: use `.toast-message` directly (matching Toast.vue structure) and wait for awareness sync before restoring. 4. No-other-users test: verify no native dialog fires instead of checking for a non-existent DOM element. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Stuck after 5 work cyclesFailing checks:
Last agent notes: Needs human intervention to unblock. |
VersionPreviewModal lives in Sidebar→Drawer→DrawerVersions, which is a sibling branch to Canvas.vue. The 3 collab refs (awareness, cmView, readOnlyCompartment) were provided by Canvas.vue, making them invisible to useVersionRestore when called from VersionPreviewModal. This caused all 3 CI failures: no confirm() dialog, no read-only lock, no toast. Hoist the provides to View.vue (matching existing ydoc pattern) so both Canvas and Drawer branches can inject them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Needs human reviewWhat changed: Version restore now uses real composables instead of stubs — adds concurrent editor detection (confirm dialog), read-only editor lock during restore, and toast notifications to other connected users when a restore happens. Shared refs (awareness, cmView, readOnlyCompartment) hoisted from Canvas.vue to View.vue for cross-branch inject access. Review checklist:
What to look for:
|
Summary
registerSecondUser,shareFileWithUser,openVersionPreview,performRestore) to reduce duplication across testsDependencies
useVersionRestoreis wired toVersionPreviewModalTest plan
npx playwright test --grep @version-restore --reporter=line🤖 Generated with Claude Code