Repository navigation
fix(canvas): a new document starts unlocked, and the edit lock blocks every user edit (v0.21.3) #334
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Activity
- added a commit that references this issue
on Oct 8, 2026 Shipped in v0.21.3 by #336, together with #335, squash-merged as
70a9c37on 2026-10-08 at 10:41 Seoul time (01:41 UTC). Its tree is identical to the approved pull request headfb7ad93.- Scope delivered: File → New, a temporary session started without the open diagram, and Delete work data leave an unlocked, empty document. A Template, a file, a share link and Open proposal as document open with their own lock and an empty undo history; the lock is written once, as its final value, before the new graph is set. While locked, every user edit is refused in the UI (the controls are
disabled) and at the stores: the palette, Insert module, Undo and Redo, the data import wizard, a data refresh, renaming a bound table and a revision Apply. Selection, pan and zoom, Focus and the view settings, Run and Step, export and sharing, and unlocking stay available. The contract is indocs/canvas-edit-lock.md. - Pull request CI (run 37712395950 at
fb7ad93, attempt 1): every job passed, the aggregatee2ejob included; the five shards ran exactly the 2,030 listed tests, each once (2,023 passed, 7 skipped by design, 0 failed, 0 retried); the production bundle 16 of 16, the PWA 19 of 19. - Main CI (run 37714159715 at
70a9c37, attempt 1): every job passed, the aggregatee2ejob included; the 2,030 listed tests each ran: 2,022 passed, 7 skipped by design, 0 failed, 1 flaky / 1 retry. The retried test,frame-label-locale-switch.spec.ts:142, is outside this change and passed without a retry on the same tree in the pull request run; it is recorded in test(e2e): the zh-Hant descriptive-copy wrapping test slows down on CI and ended a browser session #305. The aggregation exception recorded in fix(canvas): Pool, Register and Parameter value rows sit too close to node silhouettes #332 did not repeat. - Production: https://cozy-loop-studio.pages.dev serves
v0.21.3 · build 70a9c37(the desktop toolbar label and the phone's ⋯ menu). An automated check through the UI only, in fresh Chrome contexts, passed 41 of 41, including New, a temporary session and Delete work data from the locked Early MMO example (unlocked, empty, Undo and Redo off); a Template, a file and a share link each opening with their own lock and no history; every blocked control disabled with the document unchanged; the allowed actions working; no dev bridge and no page error.
Out of scope, as decided in this issue: the naming of the rail's other toggles.
- Scope delivered: File → New, a temporary session started without the open diagram, and Delete work data leave an unlocked, empty document. A Template, a file, a share link and Open proposal as document open with their own lock and an empty undo history; the lock is written once, as its final value, before the new graph is set. While locked, every user edit is refused in the UI (the controls are
- added a commit that references this issue
on Oct 8, 2026
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
The bug
After File → New, the new, empty document is still edit-locked when the previous document was locked: the lock control stays pressed, the canvas cannot be dragged or deleted from, and the empty-canvas hint still says "Drag a piece from the top bar onto the canvas". A reload keeps the lock. Measured on production
v0.21.2(c5e7d8f) from all four ways a document becomes locked: the Early MMO template (it opens locked by design), a template locked by hand, an imported file withrecommendedRunConfig.canvasLocked: true, and a share link made from a locked document opened in a second browser. An unlocked document is unaffected.While locked, some changes still go through: a palette click adds a node (which can then be neither moved nor deleted), Insert module adds its nodes (97 to 107 in the MMO template), and the toolbar Undo button restores the previous document.
Cause
graphStore.newGraph()empties the graph, the selection, the frames and the import records, but never resetsuiStore.canvasLocked. Only the document load paths reset it (mcStore.applyRecommended: file import, share link, the desktop Templates menu, the phone's template menu). The lock is also kept inlocalStorageon purpose, so it survives a reload.newGraph()is called by File → New, by starting a temporary session without carrying the document (switchToTemporary(false)), and by "Delete work data" in a personal browser (deleteWorkData).e2e/canvas-lock.spec.tsseeds every case withnewGraph()immediately followed byapplyRecommended(...)through the dev bridge, the step the real New never takes, so no test reached the bug.The contract (decided)
docs/mobile.md§MV3a).Every entry point that changes the document
Read from the code at
c5e7d8f(every call of a document-changinggraphStoreaction outside the store and the tests), and measured where marked.onDropoff)<fieldset disabled>)commitDataImport)commitRefresh) and table renameprojectStore.applyProposal)The fix guards the editor's mutation and history policy in one place that every user edit passes through, so a new entry point cannot forget the lock, and keeps the per-control disabling for what the user sees. That one place explicitly lets three things through: a whole-document replacement (New, a template, a file, a share link), the runtime updates of run, Step and Monte Carlo, and unlocking.
Tests
Out of scope
Related: #330 starts (v0.22.0) after this release and the v0.21.4 silhouette work.