Repository navigation
refactor(layer): a closing BottomSheet takes the shared input hold - #11447
Conversation
holdInput gains focus: kept-inside for a dismissal that keeps the page live: no shield and no window press hold, and the layer lets every pointer through. While focus stays inside, the content stays exposed and no click and no key but Tab reaches it; when focus leaves, or was not inside, the layer itself is inert and aria-hidden until the hold ends. A standalone BottomSheet exit takes it in place of its own exit rules, with no behavior change. Both INV16 gap lines close.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 5d37652 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| BottomSheet | 🔴 72.7 kB (+2.7 kB) · 7.7 kB CSS (0) | — | ✗ · ✓ · — |
| BottomSheetSwitcher | 18.7 kB (0) · 3.4 kB CSS (0) | — | ✗ · ✓ · — |
| LayerProvider | 4.4 kB (0) · 20 B CSS (0) | — | ✓ · ✓ · ✗ |
54 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Selector | 🔴 109.4 kB (+2.8 kB) · 17.9 kB CSS (0) | — | — · — · — |
| Pagination | 🔴 120.5 kB (+2.8 kB) · 18.2 kB CSS (0) | — | — · — · — |
| ContextMenu | 🔴 117.1 kB (+2.7 kB) · 17.8 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 🔴 117.9 kB (+2.7 kB) · 18.0 kB CSS (0) | — | — · — · — |
| TableCell | 🔴 118.3 kB (+2.7 kB) · 18.3 kB CSS (0) | — | — · — · — |
| Markdown | 🔴 198.1 kB (+2.7 kB) · 21.1 kB CSS (0) | — | — · — · — |
| Table | 🔴 135.1 kB (+2.7 kB) · 18.7 kB CSS (0) | — | — · — · — |
| lab/Schedule | 🔴 114.0 kB (+2.6 kB) · 3.9 kB CSS (0) | — | — · — · — |
| DateInput | 🔴 198.8 kB (+2.6 kB) · 17.4 kB CSS (0) | — | — · — · — |
| DateTimeInput | 🔴 221.2 kB (+2.6 kB) · 19.1 kB CSS (0) | — | — · — · — |
| TimeInput | 🔴 172.0 kB (+2.6 kB) · 16.4 kB CSS (0) | — | — · — · — |
| Popover | 97.4 kB (+580 B) · 14.6 kB CSS (0) | — | — · — · — |
| SideNav | 120.1 kB (+440 B) · 11.7 kB CSS (0) | — | — · — · — |
| TopNav | 77.0 kB (+419 B) · 11.3 kB CSS (0) | — | — · — · — |
| MobileNav | 75.3 kB (+416 B) · 11.0 kB CSS (0) | — | — · — · — |
| AlertDialog | 111.0 kB (+407 B) · 15.0 kB CSS (0) | — | — · — · — |
| AppShell | 96.6 kB (+395 B) · 13.8 kB CSS (0) | — | — · — · — |
| Dialog | 25.3 kB (+376 B) · 6.9 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 158.6 kB (+347 B) · 1.9 kB CSS (0) | — | — · — · — |
| Drawer | 53.7 kB (+335 B) · 8.4 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 360.6 kB (+327 B) · 2.4 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 286.6 kB (+321 B) · 454 B CSS (0) | — | — · — · — |
| CommandPalette | 76.2 kB (+320 B) · 12.7 kB CSS (0) | — | — · — · — |
| DropdownMenu | 103.9 kB (+304 B) · 17.9 kB CSS (0) | — | — · — · — |
| MoreMenu | 104.1 kB (+294 B) · 17.9 kB CSS (0) | — | — · — · — |
| lab/Comments | 367.5 kB (+191 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 112.3 kB (+168 B) · 773 B CSS (0) | — | — · — · — |
| PowerSearch | 303.9 kB (+165 B) · 24.7 kB CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 113.4 kB (+164 B) · 1.1 kB CSS (0) | — | — · — · — |
| lab/PageControl | 78.0 kB (+49 B) · 709 B CSS (0) | — | — · — · — |
| MultiSelector | 100.8 kB (+47 B) · 17.2 kB CSS (0) | — | — · — · — |
| TabMenu | 78.1 kB (+7 B) · 11.5 kB CSS (0) | — | — · — · — |
| ButtonGroup | 44.0 kB (+1 B) · 3.7 kB CSS (0) | — | — · — · — |
| NavHeadingMenu | 18.5 kB (+1 B) · 3.5 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 91.0 kB (0) · 12.5 kB CSS (0) | — | — · — · — |
| Lightbox | 145.3 kB (0) · 11.5 kB CSS (0) | — | — · — · — |
| SegmentedControl | 101.9 kB (0) · 6.9 kB CSS (0) | — | — · — · — |
| SideNavHeading | 81.8 kB (0) · 11.7 kB CSS (0) | — | — · — · — |
| Switch | 108.7 kB (0) · 10.0 kB CSS (0) | — | — · — · — |
| ToggleButton | 91.4 kB (0) · 10.4 kB CSS (0) | — | — · — · — |
| ToggleButtonGroup | 41.2 kB (0) · 3.7 kB CSS (0) | — | — · — · — |
| Tokenizer | 103.1 kB (0) · 19.5 kB CSS (0) | — | — · — · — |
| TopNavMenu | 80.8 kB (0) · 11.6 kB CSS (0) | — | — · — · — |
| lab/ChatVirtualizer | 57.1 kB (0) · 223 B CSS (0) | — | — · — · — |
| lab/NavigationScreen | 84.8 kB (0) · 1.5 kB CSS (0) | — | — · — · — |
| lab/NavigationStack | 84.8 kB (0) · 1.5 kB CSS (0) | — | — · — · — |
| lab/TabBarItem | 3.9 kB (0) · 1.8 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 74.3 kB (−1 B) · 10.1 kB CSS (0) | — | — · — · — |
| Slider | 114.2 kB (−1 B) · 8.9 kB CSS (0) | — | — · — · — |
| TopNavHeading | 81.5 kB (−2 B) · 11.6 kB CSS (0) | — | — · — · — |
| lab/TabBar | 83.4 kB (−2 B) · 1.8 kB CSS (0) | — | — · — · — |
| Toast | 102.7 kB (−3 B) · 10.6 kB CSS (0) | — | — · — · — |
| layer | — | — | — · ✓ · — |
| Layer | — | — | ✓ · ✓ · — |
Visual changes: 2 snapshots in 1 component
A change is a question for the reviewer, not a failure.
| Component · story | Before | After | Diff |
|---|---|---|---|
| BottomSheet · Text Only (neutral, dark) | ![]() |
![]() |
![]() |
| BottomSheet · Text Only (neutral, light) | ![]() |
![]() |
![]() |
Package size: @astryxdesign/core 7.49 MB packed (+631 B); no new dependencies.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested. Moving BottomSheet's exit onto the shared input hold keeps the sheet's inert and activation behavior, but it changes what a key pressed during the exit does.
Blocking
- A key pressed while a closing sheet still holds focus no longer counts as keyboard input:
holdKeptInsidestops it on the window's capture phase (packages/core/src/Layer/inputHold.ts:585-592), ahead of the shared interaction-modality listener on the document, so after a mouse click on Done and Escape before the sheet has left, focus returns to the opener without the keyboard ring that main shows (architecture:interaction-modalityINV1, and the changeset's "behaves as before"); please let the modality tracker still hear a swallowed key and add a test that pins it.
Three small comment suggestions are inline. They are not blocking. The layer-runtime record change is approved for this head, and the default 'blur' hold path is unchanged.
Claims and files checked
- Changeset: a closing sheet now uses the shared hold's new kept-inside mode instead of its own exit rules. Verified (
BottomSheet.tsx:884-894). - Changeset: the sheet behaves as before. False: a key pressed during the exit no longer sets keyboard modality (
inputHold.ts:585-592). - Changeset: the page stays live. Verified for the hold, which adds no shield and no press hold (
inputHold.ts:537-545). A modal sheet's page stays blocked by its dialog, as before. - Changeset and description: a sheet that keeps focus takes no click and no key but Tab. Verified (
inputHold.test.tsxnew case 2;BottomSheetCloseFocus.test.tsx). - Changeset and description: the sheet becomes inert and hidden once focus leaves, or at once when focus was never inside. Verified (new cases 3-4;
BottomSheetCloseFocus.test.tsxcases for removed and moved focus). - Description: nothing changes for people closing a sheet. False, for the same reason as above.
- Description: the exit now uses the runtime's one hold, so later fixes reach the sheet. Verified.
- Description: the layer-runtime record listed two gaps, the sheet's own exit hold and no focus-keeping mode. Verified (base record).
- Description: no shield, no window press hold, and pointers pass through the layer. Verified (
inputHold.ts:537-545, new case 1). - Description: the default
'blur'hold, the entrance holds, Popover surface motion and DropdownMenu do not change. Verified: only an early return is added (inputHold.ts:435-437); their callers pass nofocus. - Description: AlertDialog's leave rule and switcher steps stay on
'blur'. Accurate as a mapping: neither takes the new mode, and neither calls the hold today. - Description: the sheet's exit-focus state, watcher, capture handlers, pass-through style and exit-time inert go away; replaced and covered sheets keep their own inert. Verified (
BottomSheet.tsx:873). - Description: the record names the new mode for FR9, drops both gap lines and the not-yet-met entry, and updates the verification row. Verified.
- Description: four new hold tests fail on main and pass here, and a fifth pins
'blur'. Verified. - Description: the BottomSheet, Dialog, Drawer, Popover, DropdownMenu, MobileNav and hold suites pass unchanged. Verified.
- Description: core typecheck, import boundaries, knowledge and changeset checks pass. Verified. The snap-paging bundle test was not rerun.
- Description: the page and the closing sheet take pointers exactly as before. Verified (
pointer-events: nonefor the whole held exit). .changeset/bottom-sheet-shared-exit-hold.md: one false claim, above.docs/architecture/layer-runtime.md: clear (approved for this head).packages/core/src/BottomSheet/BottomSheet.tsx: clear; one inline comment suggestion.packages/core/src/Layer/inputHold.ts: the blocking finding, plus two inline comment suggestions.packages/core/src/Layer/inputHold.test.tsx: clear; the fix needs one more case.
…t listeners The hold stopped a swallowed key on the window capture phase, ahead of the shared interaction-modality tracker, so a key pressed while a closing sheet kept focus did not count as keyboard input. It now stops keys and clicks at the layer in the capture phase: document listeners still hear them, and nothing inside the layer does. Comment tidy-ups from review.
|
/approve-spec 50c40ab |
There was a problem hiding this comment.
Changes requested. The modality fix and the comment suggestions from the last review are in, but moving the stop onto the layer lets capture-phase handlers inside a closing sheet run again.
Blocking
- During a closing sheet's exit, React
onKeyDownCaptureandonClickCapturehandlers inside it run again, because the layer's own capture listeners fire after React's root capture dispatch (packages/core/src/Layer/inputHold.ts:563-585), so a DropdownMenu bottom-sheet link row selects a second time on a second activation and the changeset's "takes no click and no key but Tab" no longer holds (component:BottomSheetFR9); please stop the event before React's root listener while still letting the modality tracker hear the key, and add a BottomSheet case with inner capture handlers. - The description says the shared input stream stops clicks and keys during the exit, but at this head capture listeners on the layer do that (
inputHold.ts:575-585); please update that line.
Two small notes are inline. The layer-runtime record change is approved for this head.
Claims and files checked
- Changeset: a closing sheet now takes the shared hold's new kept-inside mode instead of its own exit rules. Verified (
BottomSheet.tsx:879-889). - Changeset: the sheet behaves as before. False: capture-phase handlers inside the sheet hear keys and clicks during the exit (
inputHold.ts:563-585). - Changeset: the page stays live. Verified: the hold adds no shield and no press hold, and the layer lets pointers through (first kept-inside case).
- Changeset: a sheet that keeps focus takes no click and no key but Tab. False for capture-phase handlers; true for bubble-phase handlers (
BottomSheetCloseFocus.test.tsx). - Changeset: the sheet is inert and hidden once focus leaves. Verified (kept-inside cases;
BottomSheetCloseFocus.test.tsx). - Description: nothing changes for people closing a sheet. False, for the capture-phase reason above.
- Description: the exit uses the runtime's one hold, so later fixes reach the sheet. Verified.
- Description: the record listed two gaps, the sheet's own exit hold and no focus-keeping mode. Verified (base record).
- Description: no viewport shield, no window press hold, and every pointer passes through the layer. Verified (
inputHold.ts:529-537, first kept-inside case). - Description: the shared input stream stops every click and every key but Tab. False: capture listeners on the layer do (
inputHold.ts:575-585). - Description: when focus leaves (moved, removed, disabled, hidden or made inert) or was not inside, the layer becomes inert and hidden until the hold ends. Verified (kept-inside cases;
BottomSheetCloseFocus.test.tsx). - Description: the default
'blur'hold, the entrance and presentation holds, Popover surface motion and DropdownMenu do not change. Verified: only an early return is added (inputHold.ts:435-437) and their callers pass nofocus. - Description: AlertDialog's leave rule and switcher steps stay on
'blur'. Accurate as a mapping: neither takes the new mode. - Description: the sheet's exit-focus state, watcher, capture handlers, pass-through style and exit-time inert go away; replaced and covered sheets keep their own inert. Verified (
BottomSheet.tsx:873). - Description: the record names the new mode for FR9, drops both gap lines and the not-yet-met entry, and updates the verification row. Verified.
- Description: four new hold cases fail on main and pass here, and a fifth pins
'blur'. Verified: the kept-inside cases fail on main and the'blur'case passes on both. - Description: the BottomSheet, Dialog, Drawer, Popover, DropdownMenu, MobileNav and hold suites pass. Verified: 59 files, 1,548 tests at this head.
- Description: core typecheck, import boundaries, knowledge, changeset checks and the snap-paging bundle test pass. Verified.
- Description: the page and the closing sheet take pointers exactly as before. Verified (
pointer-events: nonefor the whole held exit on both sides). .changeset/bottom-sheet-shared-exit-hold.md: two false claims, in the first blocking finding.docs/architecture/layer-runtime.md: clear (approved for this head).packages/core/src/BottomSheet/BottomSheet.tsx: clear.packages/core/src/Layer/inputHold.ts: the first blocking finding, plus one comment suggestion.packages/core/src/Layer/inputHold.test.tsx: clear; one naming note, and the fix needs a case.
At the layer, the stop ran after React root capture dispatch, so capture handlers inside a closing sheet ran again. The hold now stops a key or a click that targets the layer on the document capture phase: the interaction-modality tracker, which listens there from the first consumer mount, still hears it, and React root and the layer do not.
|
/approve-spec 38e0742 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is a draft; it runs once the pull request is marked ready for review.
Moving the stop to the document's capture phase fixes the earlier finding: capture-phase handlers inside a closing sheet stay silent during its exit, as on main, and the modality tracker still hears the key. The layer-runtime record change is approved for this head. Two non-blocking notes are inline: code around a closing sheet (React capture handlers written around it, and document listeners added after the hold starts) no longer hears a key or click aimed at the sheet, and one comment could be reworded.
Claims and files checked
- Changeset: a closing sheet now takes the shared hold's new kept-inside mode instead of its own exit rules. Verified (
BottomSheet.tsx:879-889). - Changeset: the sheet behaves as before. Verified for the sheet: capture handlers inside it hear nothing during the exit on
mainand here, in Chromium and jsdom; code around the sheet is the inline note. - Changeset: the page stays live. Verified: no shield and no press hold, and the layer lets pointers through (first kept-inside case).
- Changeset: a sheet that keeps focus takes no click and no key but Tab. Verified (
inputHold.ts:574-595; the newBottomSheetCloseFocus.test.tsxcase). - Changeset: the sheet is inert and hidden once focus leaves. Verified (kept-inside cases;
BottomSheetCloseFocus.test.tsx). - Description: nothing changes for people closing a sheet or using the page around it. Verified for people; code around the sheet is the inline note.
- Description: the exit uses the runtime's one hold, so later fixes reach the sheet. Verified.
- Description: the record listed two gaps, the sheet's own exit hold and no focus-keeping mode. Verified (base record).
- Description: no viewport shield and no window press hold, every pointer passes through the layer, and a tap on the page acts. Verified (
inputHold.ts:531-535; first kept-inside case). - Description: the document's capture phase stops every click and every key but Tab that targets the layer. Verified (
inputHold.ts:567-595). - Description: the modality tracker listens there from its first consumer's mount and still hears the key, so focus returns with the keyboard ring. Verified (
interactionModality.ts:143-150,:250-252; jsdom, and the opener matches:focus-visiblein Chromium). - Description: React's root and capture handlers inside the sheet do not hear it. Verified.
- Description: when focus leaves (moved, removed, disabled, hidden or made inert) or was not inside, the layer becomes inert and hidden until the hold ends. Verified (
inputHold.ts:550-561,:596-616; kept-inside cases). - Description: the default blur hold, the entrance and presentation holds, Popover surface motion and DropdownMenu do not change. Verified: only an early return is added (
inputHold.ts:435-437) and the other callers pass nofocus. - Description: AlertDialog's leave rule and switcher steps stay on blur. Accurate in effect: neither takes the new mode.
- Description: the sheet's own exit state, focus watcher, capture handlers, pass-through style and exit-time inert go away; replaced and covered sheets keep their own inert. Verified (
BottomSheet.tsx:873). - Description: the record names the new mode as the sheet's exit mechanism, drops both gap lines and the not-yet-met entry, and updates the verification row. Verified.
- Description: four new hold cases fail on
mainand pass here, and a fifth pins blur. Verified: the five kept-inside cases fail onmainand the blur case passes on both. - Description: a document listener added before the hold hears a swallowed key, and no capture handler inside a closing sheet runs; the sheet case fails on the earlier head. Verified.
- Description: the BottomSheet, Dialog, Drawer, Popover, DropdownMenu, MobileNav and hold suites pass. Verified: 59 files and 1,549 tests at this head (the description's tally says 1,547).
- Description: core typecheck, import boundaries, knowledge and changeset checks and the snap-paging bundle test pass. Verified.
- Description: the page and the closing sheet take pointers exactly as before. Verified (
pointer-events: nonefor the whole held exit on both). - Description, writing rubric: present tense, one topic per sentence, each sentence of the record change maps to a named test, and no duplicated owner. Verified: the kept-inside sentences map to the hold cases the verification row names.
.changeset/bottom-sheet-shared-exit-hold.md: clear.docs/architecture/layer-runtime.md: clear (approved for this head).packages/core/src/BottomSheet/BottomSheet.tsx: clear.packages/core/src/BottomSheet/BottomSheetCloseFocus.test.tsx: clear.packages/core/src/Layer/inputHold.test.tsx: clear.packages/core/src/Layer/inputHold.ts: two non-blocking notes, inline.
| // Stopped on the document's capture phase. The interaction-modality | ||
| // tracker listens there from the first consumer's mount, before any hold, | ||
| // so it still hears the key. React's root and everything inside the layer | ||
| // do not, capture handlers included. |
There was a problem hiding this comment.
Non-blocking (INV29): the first sentence is a passive fragment. Suggest:
// The hold listens on the document's capture phase. The modality tracker
// listens there from its first consumer's mount, before any hold, so it
// hears the key first. React's root and the layer never hear it.| ['keyup', stopKey], | ||
| ]; | ||
| for (const [type, listener] of captures) { | ||
| doc.addEventListener(type, listener, {capture: true}); |
There was a problem hiding this comment.
Non-blocking: stopping here also keeps a swallowed key or click from code around the sheet: React capture handlers written around a BottomSheet, body and html capture listeners, and document capture listeners added after the hold starts. On main they heard it; in Chromium an onKeyDownCapture around a closing sheet heard keydown x, keydown Enter, click on main and nothing here. The modality guarantee also rests on the tracker registering first. Consider saying both in the focus JSDoc or INV16, so a document listener that installs lazily, such as the gesture counter's (gestureCounter.ts:91-93), is a known case.
# Conflicts: # docs/architecture/layer-runtime.md
|
/approve-spec a27b533 |
There was a problem hiding this comment.
Approved. CI passes on this head.
A closing sheet still behaves as on main: no click and no key but Tab reaches it while it keeps focus, it goes inert and hidden once focus leaves, and focus returns with the keyboard ring; the layer-runtime record change is approved for this head. Three non-blocking notes are inline: code around a closing sheet (React capture handlers written around it, and document listeners added after the hold starts) no longer hears a key or click aimed at the sheet, and two comments could be reworded.
Claims and files checked
- Changeset: a closing sheet takes the shared hold's new kept-inside mode instead of its own exit rules. Verified (
BottomSheet.tsx:879-889). - Changeset: the sheet behaves as before: the page stays live, a sheet that keeps focus takes no click and no key but Tab, and it goes inert and hidden once focus leaves. Verified: browser checks on
mainand this head match (inputHold.ts:529-535,:574-595,:596-616). - Description: nothing changes for people closing a sheet with focus inside or using the page around it. Verified for people; code around the sheet is the non-blocking note.
- Description: the exit uses the runtime's one hold, so later fixes reach the sheet. Verified: one
holdInputcall and no sheet-local listener. - Description: the layer-runtime record listed two gaps, the sheet's own exit hold and no focus-keeping mode. Verified (record on
main). - Description: the new mode raises no viewport shield or window press hold and lets every pointer through the layer, so taps on the page and on the closing sheet act as today. Verified (
inputHold.ts:435-437,:531-535; first new hold test). - Description: while focus stays inside, the content stays exposed and the document's capture phase stops every click and every key but Tab aimed at the layer. Verified (
inputHold.ts:563-595; second new hold test). - Description: the modality tracker listens on the document from its first consumer's mount, still hears the key, and focus returns with the keyboard ring. Verified (
interactionModality.ts:147,:252; the opener shows the ring after the exit in Chromium). - Description: React's root and capture handlers inside the sheet do not hear the stopped key or click. Verified (capture-handler test in
BottomSheetCloseFocus.test.tsx). - Description: when focus leaves (moved, removed, disabled, hidden or made inert) or was not inside, the layer goes inert and hidden until the hold ends. Verified (
inputHold.ts:560-561,:596-616; hold tests; Chromium removed-control check). - Description: the default blur dismissal and the Dialog, Drawer, MobileNav, presentation, Popover and DropdownMenu holds do not change. Verified: only an early return is added (
inputHold.ts:435-437) and the other callers pass nofocus. - Description: AlertDialog and switcher steps stay on the blur-style dismissal. Verified as record text; neither calls the hold.
- Description: the file-by-file list of changes, including that replaced and covered sheets keep their own inert. Verified against the diff (
BottomSheet.tsx:873-874). - Description: the record names the mode, removes both gap lines and the not-yet-met entry, and updates the verification row. Verified against the diff.
- Description: a chore changeset. Verified.
- Description: four new hold tests fail on
mainand pass here, and a fifth pins the blur dismissal. Verified: five kept-inside cases fail onmain(the fifth is the document-listener case listed under review rounds) and the blur case passes on both. - Description: a document listener added before the hold hears a swallowed key, and no capture handler inside a closing sheet runs. Verified (both tests pass here).
- Description: one capture case covers every row kind because the stop comes before React's root, and a second activation of an action-sheet row selects nothing. Verified by the mechanism and in Chromium (a second Enter selected nothing on both sides).
- Description: the listed suites pass. Verified: 131 files and 3,226 tests across those suites and the gesture, menu-press and AlertDialog suites pass at this head.
- Description: typecheck, import boundaries, knowledge, changeset and snap-paging bundle checks pass. Verified.
- Description: no feel change; pointers behave as before. Verified: the closing sheet lets pointers through on both sides.
- Description: each record sentence maps to a named test. Verified: the verification row names the kept-inside cases and
BottomSheetCloseFocus.test.tsx. - Files:
.changeset/bottom-sheet-shared-exit-hold.mdclear;docs/architecture/layer-runtime.mdclear;packages/core/src/BottomSheet/BottomSheet.tsxone non-blocking comment note;packages/core/src/BottomSheet/BottomSheetCloseFocus.test.tsxclear;packages/core/src/Layer/inputHold.test.tsxclear;packages/core/src/Layer/inputHold.tstwo non-blocking notes.






User impact
Problem and solution fit
architecture:layer-runtimeINV16 says a component that holds input uses the runtime's hold rather than building its own. It listed two gaps:component:BottomSheetFR9 needs.holdInputgainsfocus: 'kept-inside', the sheet's rules moved into the shared module:main. React's root and capture handlers inside the sheet do not hear it.inertandaria-hiddenuntil the hold ends. That matches FR9's "the sheet becomesinertandaria-hidden".focus: 'blur', the default, is today's dismissal. Dialog, Drawer, MobileNav entrances, the presentation hold, Popover surface motion and DropdownMenu do not change. AlertDialog FR7 and switcher steps stay on'blur'.What changed
Layer/inputHold.ts: thefocusoption andholdKeptInside.BottomSheet/BottomSheet.tsx: a standalone sheet's exit takesholdInput(dialog, {scope: 'layer', focus: 'kept-inside'})from when its close settles to the end of its exit. Its own exit-focus state, focus watcher, click and key capture handlers, pass-through style, and exit-timeinertandaria-hiddengo away. A replaced sheet and a covered (blocked) sheet keep their owninert.docs/architecture/layer-runtime.md: INV16 namesfocus: 'kept-inside'as FR9's mechanism. Both INV16 gap lines are removed, INV16 leaves the "not yet met" list, and the verification row names the new cases andBottomSheetCloseFocus.test.tsx.[chore]Changeset.Evidence
inputHold.test.tsxcases fail onmainand pass here:A fifth case pins the unchanged
'blur'dismissal.BottomSheetCloseFocus.test.tsx; fails on the earlier head).core-dropdownmenu--action-sheet-presentation); no served story has an items-built sheet menu with a link row.BottomSheetCloseFocus.test.tsx's FR9 cases, pass unchanged. So do the Dialog, Drawer, Popover, DropdownMenu, MobileNav,inputHoldandholdEntranceInputsuites (1,547 tests in 59 files).tsc,check:component-import-boundaries,check:knowledge,check:changesetsand the snap-paging bundle test pass.Writing rubric results