Repository navigation
fix(ui-kit): a dispatched Escape still closes a watched panel (#4230) - #4231
Conversation
An untrusted (dispatched) Escape keydown never raises a close request,
so with a panel's close watcher armed, nothing took it: the keydown
fallback and the overlay stack both stepped aside for the watcher. The
storybook ArtifactTheme play functions dispatch their Escape this way
and failed main run 44150545208 ("Escape returns to the file link").
Both keydown paths now take an untrusted Escape whether or not a watcher
is armed; a real one still arrives only through the watcher.
Refs #4230
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No uploads on this PR yet This PR changes UI files (
Tips for agentsLabel each shot so reviewers know what they're seeing. Labels apply to every file in a call, so run one uploads put after.png --pr 4231 --meta path=/settings --state after --caption "Saved settings toast"
uploads put chat.png --pr 4231 --app ios --screen "Chat" --state afterNo CLI? With the Uploads MCP, call This comment updates with each upload, so you don't need to post the images yourself. A shot or two in the PR description is still welcome. Check what's attached with Workspace admins can turn this comment off in Settings → GitHub · docs |
Independent reviewReviewed head 719d109 against base 18da31b. Reviewer: agent. No findings. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4231,
"head": "719d10988b66e402d439881ce10820e0a96724dd",
"base": "18da31bc64a03c8bafa5ea8043028e32df80f7d1",
"reviewer": "agent",
"outcome": "no-findings",
"findings": []
} |
Refs #4230 (red-main incident; this is its declared fix). Follows #2577 / #4194.
What this does
Main run 44150545208 at cc10821 (#4194) failed
browser (3):ArtifactTheme.stories.tsx > Layout PhoneandLayout Desktop, instorybookandstorybook-light, on "Escape returns to the file link".Cause (reproduced locally at cc10821, then traced inside the story):
userEventcomes from Storybook's play context and dispatches a synthetic keydown (isTrusted: false).Fix:
watchCloseRequests(packages/ui-kit/src/internal/close-request.ts) and in the overlay stack's document listener (overlay-stack.ts).Proof
ArtifactTheme.stories.tsx4/4 instorybookand instorybook-light, where it failed on the merged head (reproduced locally before the fix).close-requests.pointer.tsx, for each of the Sessions drawer, the Settings pane and the Files pane: "a dispatched (untrusted) Escape still closes it once while its watcher is armed". The surface closes, the watcher sees no close request, and focus returns to the opener.Layout Phonestory again.close-requests.pointer.tsx27/27 onrail-fine,rail-coarseandrail-mixed;overlay-stacking.pointer.tsx160/160.check:prpass.Collisions
bun scripts/collisions.ts --json --pr 4231at head 719d109: closure reports with #3054, #3056, #3059, #3069, #3581, #3622, #4151, #4179, #4196, #4198, #4199, #4200.{"version":1,"kind":"brain-check-pr-receipt","head":"701c957527ccbc4a1c785ac816184ca21c6bdb90","base":"origin/main","mode":"focused","startedAt":"2026-11-17T19:36:29.594Z","finishedAt":"2026-11-17T19:37:14.741Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":13828.282875},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":106.71548100000291},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":67.09392800000205},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":20.08760500000062},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":31107.011177999997}]}🤖 Generated with Claude Code