Repository navigation
feat(doop): add frame lock UI with unlock confirm (CHE-9395) [squash] - #169
Draft
congvc-bot-x99[bot] wants to merge 4 commits into
Draft
congvc-bot-x99[bot] wants to merge 4 commits into
congvc-bot-x99[bot] wants to merge 4 commits into
Conversation
added 4 commits
November 27, 2026 03:15
…iled re-read (CHE-9395)
…rors on phone (CHE-9395) A lost lock reply with a failed re-read left the frame editable while the server may hold the lock. It now stays locked here until a read succeeds. The refused-unlock and unknown-state error, with Try again, also shows in the phone Inspector sheet, which has no Layers panel.
This branch has not been deployed
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.
Part of CHE-9308 (step 7). Closes CHE-9395.
What
U1 frame lock UI. Marker
Locked · <actor> · <time> ICTon the frame title, the Layers row and the Inspector. One "Unlock ?" confirm, raised insidesetFramesLocked(frames, false), so all five entry points get it: Layers frame row, Layers element row, Inspector Unlock button, frame context menu, Cmd+Shift+L. The 423 toast names who, when and why. A refused unlock (403, or 423policy_refused) keeps the frame locked and shows the A1 error state. After a lost reply the UI re-reads the frame before it draws the marker. Lock empty state. Disconnected pauses lock and unlock. Element locks unchanged.Test command
npx vitest run tests/frameLockUi.test.tsx tests/layerLock.test.ts tests/layersKeys.test.tsx tests/layersEye.test.tsxRED (base
85397ab1, same test file, no source change)GREEN (this head)
Also green:
tests/layerLock.test.ts,tests/layersKeys.test.tsx,tests/layersEye.test.tsx(37 of 37 across the four files).bun run typecheck,bun run lint,bun run format:checkclean.Review fixes (head
88c9189e)Two findings from the first review. Each has a test that was red on
66c4e344(tests added first, no source change) and is green now.src/lib/layerEdits.ts,FrameLockPanel.tsx)FrameViewsaveEdited): the undo step is dropped, the optimistic html is rolled back, the runtime document resyncs, and the 423 toast names who, when and why. It shares one helper with the Layers edit path. (rollBackRefusedHtml)RED (
tests/frameLockUi.test.tsx, 3 new tests, source as in66c4e344):GREEN (
tests/frameLockUi.test.tsx tests/layerLock.test.ts tests/layersKeys.test.tsx tests/layersEye.test.tsx, head88c9189e):Also green:
bun run typecheck,bun run lint,bun run format:check.Review fixes round 2 (head
c96cd8dc)Two findings from the exact-head review of
88c9189e. Tests were added first and were red with no source change; they are green now.frame.locked), shows the A1 error "Could not confirm the lock state of . Edits stay off until it is read again." and Try again reads the server. A lock that was only guessed has no actor or time; a lost unlock reply rolls back to locked with its original actor. (src/lib/layerEdits.ts,panels.tsen + pt-BR)LockErrorNote,data-testid="inspector-lock-error", role alert). Try again sends the unlock again (refusal) or reads the locks again (unreadable). Desktop keeps one error, in the Layers panel. (FrameLockPanel.tsx,Inspector.tsx)RED (
tests/frameLockUi.test.tsx, source as in88c9189e):GREEN (same file, head
c96cd8dc):Tests 24 passed (24). Neighbouring suitestests/i18n.test.ts tests/frameLock*: 10 files, 178 tests passed.bun run typecheck,bun run lint,bun run format:checkclean.Test cases covered: landed lock + failed read + attempted edit (
roundFramesToPixel()refused, no write) + recovery (Try again reads unlocked, edit goes through); refused unlock on the phone Inspector with retry; unreadable state on the phone Inspector with retry.Review fixes round 3 (head
8f5ab7a0)One finding from the UX verdict on
c96cd8dc(x99-codex-terra-ux, CHANGES, P1): at 390 the open Inspector sheet covers the toast, so a refused edit (423) showed the person no reason.useLockUi.refusal(noteRefusalinsrc/lib/frameLock.ts, called fromrollBackRefusedHtmlandfailedLockinsrc/lib/layerEdits.ts).LockErrorNote(phone Inspector,surface="inline"only) shows it as a red alert: frame name, who, when (ICT), reason, what to do, plus Dismiss (data-testid="inspector-lock-refusal",src/components/FrameLockPanel.tsx). It clears on the next write, on Dismiss, and when the frame is unlocked; another frame's refusal is never shown. Desktop is unchanged (toast still raised, no inline note).RED (
tests/frameLockUi.test.tsx, new tests, no source change):GREEN (head
8f5ab7a0,tests/frameLockUi.test.tsx+tests/i18n.test.ts):Test Files 2 passed (2),Tests 32 passed (32). All 11 required checks are green on this head. Recaptured at 1440 and 390 on this head;new-390-2-edit-refused.pngshows the alert inside the open sheet. Captures: CHE-10384.Existing tests changed (2)
tests/layerLock.test.tsandtests/layersKeys.test.tsxnow setconnected: true(lock is paused offline);layerLockcallsunlockConfirmedafter the unlock toggle because unlock now waits for the confirm.UI review pack (CHE-1485 Layer A)
design/lifecycle-ui/approved/A1-frame-lock.html @ 572cc77docs/ux/CHE-9395.ymldesign/patterns.ymlyet, so the ledger rules are skipped. Built from existing parts: U0PanelStatefor the states,ConfirmDialogfor the confirm.8f5ab7a0)8f5ab7a0)Jdgg3xGqZl, cellbefore-1440-1-lockedf_mI0G4gHf, cellr3-1440-1-lockedJdgg3xGqZl, cellbefore-390-1-lockedf_mI0G4gHf, cellr3-390-1-lockedJdgg3xGqZl, cellbefore-1440-2-edit-refusedf_mI0G4gHf, cellr3-1440-2-edit-refusedJdgg3xGqZl, cellbefore-390-1-locked(no message before; same as the locked capture)f_mI0G4gHf, cellr3-390-2-edit-refused(alert inside the open sheet)Review pack: CHE-10384. Reference frames on doop page
che-5478: before frameJdgg3xGqZl(updatedAt2026-11-27T04:03:48.711Z,origin/cheese/main) and after framef_mI0G4gHf(updatedAt2026-11-26T22:50:05.790Z, head8f5ab7a0). Extra states in the after frame: Unlock confirm and Unlock refused (A1 error) at 1440 and 390. Earlier packs (88c9189e,c96cd8dc) stay on CHE-10384 as history.UX verdict on head
8f5ab7a0(x99-codex-terra-ux, different lab): see CHE-10384. The frame screenshot tool renders the images blank; the designer rendered them in headless Chrome and saw pixels, and the asset sha256 match the CHE-10384 attachments. This PR stays DRAFT for the agent review.Manual Keep / Change / Remove check (written out)
data-frame-locked. Checked in the tests: the toggles and the row still render and still send onelockedwrite. Change: marker, Inspector lock banner (now with By/When/Reason), unlock confirm, lock panel. Remove: nothing.Residuals
recordUpdatesreturns nothing to drop); undo then writeslocked: trueon an already locked frame, which the server treats as a no-op.vitest runon this machine shows failures in browser layout-alignment and compose/deploy tests and a timeout. Not compared against base; CI is the check.