Repository navigation
fix(core): a held stage act still hears frame keys while sealed canvas keys are armed - #8959
Conversation
# Conflicts: # packages/core/src/runtime/editingAgent.test.ts # packages/core/src/runtime/editingAgent.ts # packages/core/src/runtime/editingPort.test.ts # packages/core/src/runtime/editingPort.ts # packages/studio/src/components/editor/useDomEditNudge.ts
…once Studio arms them
…s first draw Studio's first nudge on a cold read now uses this start, so a GSAP clip is not moved twice.
…d settle every delete Backspace stays with Studio while Reset Keyframes may claim it. A Delete no canvas session takes is rolled back. A cold first nudge on a GSAP clip starts from the frame's pre-draw position.
…he load-time shield arms A Delete pressed while armed saves even when it lands after the canvas session ends. Arming no longer installs the key shield, so same-origin frames are never shielded. The shield stays the first key listener. Unarmed, it lets keys through as main does.
Keeps both the canvas-key and stage-act request kinds and push listeners. The editing port's push handling becomes a table so both fit under the complexity gate.
…d, not the group selected since The canvas Delete passes the arm's members for the handles the frame removed. It rolls back when any removed handle has no member. Also cuts two comments the ratchet flagged.
…s keys are armed canvasKeys owns frame keydown. stageAct listens through it and hears every keydown first.
terencecho
left a comment
There was a problem hiding this comment.
P2 · Keep key suppression independent of reporting. In packages/core/src/runtime/editing/canvasKeys.ts:461–468, observers now execute in the shield's own event listener, before it suppresses the key. If a reporting callback throws, the shield exits before its stop/prevent logic. Separate DOM listeners isolated that failure before. Isolate each callback's errors using the existing diagnostics path, so key suppression and forwarding still run even if stage-input reporting fails.
Source review at the pinned head. The base PR is still open.
— tai (automated review)
…hield Each listener's error is swallowed, so the shield still prevents, stops and forwards the key.
|
Fixed at Test: Checked: the core editing, port and agent suites (600 tests), 3 runs in a row; |
Edit accuracy: accurate 273 (base branch 271), smooth 66 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
…gh-shield # Conflicts: # packages/core/src/runtime/editing/canvasKeys.test.ts # packages/core/src/runtime/editing/canvasKeys.ts # packages/core/src/runtime/editingPort.ts
terencecho
left a comment
There was a problem hiding this comment.
The patch ID matches the pre-retarget change. Reporting errors are handled per observer, so a failed observer leaves key suppression and forwarding intact. All 231 targeted tests and all applicable required checks passed on this head.
— tai (automated review)
…gh-shield # Conflicts: # packages/core/src/runtime/editing/stageAct.ts
terencecho
left a comment
There was a problem hiding this comment.
The merge keeps both imports in stageAct.ts. The added and removed lines against main match the previously reviewed patch. All applicable required checks passed on this head, including Windows tests.
— tai (automated review)
What
While a stage act is held in a sealed preview, the frame keeps reporting the person's keys to Studio as
stage-input, even when canvas keys are armed.Why
#8935 installs a key shield at load in sealed previews. Once Studio arms canvas keys, the shield stops each trusted key before any later window listener runs.
stageActlistened forkeydownwith its own window capture listener, which was added after the shield, so an armed shield swallowed the keys a held stage act reports. A run that should end on a key kept going.Related work
Stacked on #8935, which is stacked on #8946.
How
canvasKeys.tsowns frame keydown.listenFrameKeydown(view, listener)adds the listener to the shield when the shield is installed on that window. The shield then calls every such listener first for each keydown, trusted or not, before it prevents or stops anything. With no shield, as in a same-origin preview, it is a plain capture listener, as before.stageAct.tslistens forkeydownthrough it.pointerdownanddropkeep their window listeners, because the shield never stops pointer or drop events. Thestage-inputmessage is unchanged.No visible change
Core only: the frame now reports key input it previously dropped. Nothing changes on screen until a stage-act consumer acts on that input.
Test plan
canvasKeys.test.ts> "still reports keys to a live stage-act hold while canvas keys are armed". With Delete armed and a live hold, a trusted Delete postsstage-inputand then the canvas Delete, and a synthetic keydown still postsstage-input.stageActadds its ownkeydownwindow listener again; the trusted Delete never reaches the stage act.test:hyperframe-runtime-ciexits 0.tsc --noEmitis clean. The Studio sealed-keys, stage-act and preview-channel suites pass (87 tests).