Repository navigation
fix(core): one focus return for Popover and DropdownMenu (popover presentation) and Dialog that never strands focus (AST-116 FR17–FR21, AR1) - #11121
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Needs an owner decision on the spec, plus three fixes.
returnFocus adds a caller-chosen focus target that no current record covers yet: the Popover contract returns focus to the trigger, and spec:AST-113 FR17 is still draft with the input name open. An engineering owner needs to approve that direction, by promoting FR17 or by commenting /approve-spec <full head SHA> here (the author can do this as an engineering owner).
Blocking either way:
- In Chromium, Escape and the fallback close button still put focus on the opener with
returnFocus="anchor"becausehidePopover()restores focus before the focus trap reads the target, which the jsdom tests cannot show, so please make the decision in the hide path and add a browser interaction test for Escape, the close button and an outside press. - With
presentation="bottom-sheet"(or"adaptive"on a phone),returnFocusnever reaches the sheet and focus goes back to the trigger, so please pass the target to the sheet (for example through BottomSheet'sfinalFocusRef) or document the exception in the JSDoc, the docs and the changeset. focusableWithinre-implements the focus trap'sgetFocusableElementswithout its visibility filter, so when the anchor's first control is hidden, focus ends on the page body; please reuse the shared helper and remove the copy.
[Automated review]
88e86f0 to
b905360
Compare
45a09cf to
ad85352
Compare
There was a problem hiding this comment.
Needs an engineering owner's decision on the spec, plus three fixes.
The shared focus return (the stand-in chain after the opener, the parent-to-child handoff and the rule that nothing turns it off) is defined only in draft spec:AST-113 FR17–FR21 and DEC-6, while the current Popover, Dialog and DropdownMenu contracts return focus only to the trigger or invoker. An engineering owner records the decision by approving and promoting AST-113 or by commenting /approve-spec <full head SHA> on this pull request (the author can do this as an engineering owner), and should also say whether the public useFocusTrap hook and Drawer, which now use the same chain, are in scope.
Blocking either way:
- The Dialog docs and the changeset tell callers to focus their target in
onOpenChange, but Dialog calls it while the modal still makes the page inert, so the call does nothing and focus goes to the opener; please document a route that works afterclose(), or say there is none yet. - The description and changeset present the menu-row Dialog and the manual (
hasLightDismiss={false}) popover as falling to the page body, yet both already return focus to their trigger on the base branch in Chromium and WebKit (the new menu-row test also passes there), and the "one rule" does not reach the opt-in bottom-sheet presentations, so please narrow the changeset to the popover-presentation cases this change fixes. utils/focusReturn.tsadds its own reachability test (tabStopsIn,isRendered,canTakeReturnedFocus) beside the focus trap'sgetFocusableElements, without itsaria-hiddenrule, so returned focus can land on a control screen readers skip; please share one helper and remove the copy.
ad85352 to
244aa61
Compare
There was a problem hiding this comment.
Needs an engineering owner's decision on the spec, plus four fixes.
The shared focus return's stand-in chain after the opener, the parent-to-child handoff and the rule that nothing turns it off are defined only in draft spec:AST-113 FR17–FR21 and DEC-6, while the current Popover, Dialog and DropdownMenu contracts return focus only to the trigger or invoker. An engineering owner records the decision by approving and promoting AST-113 or by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), and should also say whether the public useFocusTrap hook and Drawer, which now use the same chain, are in scope.
Blocking either way:
- The Dialog docs and the changeset tell callers to focus their target in
onOpenChange, but Dialog calls it while the modal still makes the page inert, so the call does nothing and focus goes to the opener; please document a route that works afterclose(), or say there is none yet. - The description and changeset present the menu-row Dialog and the manual (
hasLightDismiss={false}) popover as falling to the page body, yet both already return focus to their trigger on the base branch (the new menu-row test passes there), and the "one rule" does not reach the bottom-sheet presentations, so please narrow the changeset to the cases this change fixes. utils/focusReturn.tsadds its own reachability test (tabStopsIn,isRendered,canTakeReturnedFocus) beside the focus trap'sgetFocusableElements, without itsaria-hiddenrule, so returned focus can land on a control screen readers skip; please share one helper and remove the copy.- Miss: DropdownMenu's
restoreFocusTomoves focus without the temporary tab stop the default move adds, so the ancestor, parent-layer andmainstand-ins cannot take focus and a menu removed while open still leaves focus on the page body in Chromium and WebKit; please add the tab stop for caller-supplied moves and cover DropdownMenu in themaintest.
244aa61 to
18cc3b1
Compare
There was a problem hiding this comment.
Needs an engineering owner's decision on the spec, plus five fixes.
The shared focus return's stand-in chain after the opener, the parent-to-child handoff, the development warning and the rule that nothing turns the return off are defined only in draft spec:AST-113 FR17–FR21 and DEC-6, while the current Popover, Dialog and DropdownMenu contracts return focus only to the trigger or invoker. An engineering owner records the decision by approving and promoting AST-113 or by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), and should also say whether the public useFocusTrap hook and Drawer, which now use the same chain, are in scope.
Blocking either way:
- Miss: DropdownMenu's
restoreFocusTomoves focus without the temporary tab stop the default move adds, so the ancestor, parent-layer andmainstand-ins cannot take focus and a menu removed while open still leaves focus on the page body; please add the tab stop for caller-supplied moves and cover DropdownMenu in themaintest. - The Dialog docs and the changeset tell callers to focus their target in
onOpenChange, but Dialog calls it while the modal still makes the page inert, so the call does nothing and focus goes to the opener; please document a route that works afterclose(), or say there is none yet. - Miss: a scrim Drawer's trap deactivates while its dialog is still modal for the slide-out, so every stand-in is inert and each close logs "no element could take focus … focus is left on the page body" although Drawer then returns focus to its opener; please skip the trap's return while its container is an open modal dialog, or keep Drawer off the chain until it is in scope.
utils/focusReturn.tsadds its own reachability test (tabStopsIn,isRendered,canTakeReturnedFocus) beside the focus trap'sgetFocusableElements, without itsaria-hiddenrule, so returned focus can land on a control screen readers skip; please share one helper and remove the copy.- The description and changeset present the menu-row Dialog and the manual (
hasLightDismiss={false}) popover as falling to the page body, yet both already return focus to their trigger on the base branch (the new menu-row and nested manual-popover tests pass there), and the "one rule" does not reach the bottom-sheet presentations, so please narrow the changeset to the cases this change fixes.
18cc3b1 to
923cd1e
Compare
There was a problem hiding this comment.
Needs an engineering owner's decision on the spec, plus six fixes.
The shared focus return's stand-in chain after the opener, the parent-to-child handoff, the development warning and the rule that nothing turns the return off are defined only in draft spec:AST-113 FR17–FR21 and DEC-6, while the current Popover, Dialog and DropdownMenu contracts return focus only to the trigger or invoker. An engineering owner records the decision by approving and promoting AST-113 or by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), and should also say whether the public useFocusTrap hook and Drawer, which now use the same chain, are in scope.
Blocking either way:
- The new closed-dialog check in
canTakeReturnedFocus(utils/focusReturn.ts) skips everything inside a non-modal Drawer or BottomSheet, which is a<dialog>shown withshowPopover()that never hasopen, so closing a Popover opened from one sends focus tomaininstead of its trigger; please keep the focus trap's popover-open exception and add a test for it. - DropdownMenu's
restoreFocusTomoves focus without the temporary tab stop the default move adds, so the ancestor, parent-layer andmainstand-ins cannot take focus and a menu removed while open still leaves focus on the page body; please add the tab stop for caller-supplied moves and cover DropdownMenu in themaintest. - The Dialog docs and the changeset tell callers to focus their target in
onOpenChange, but Dialog calls it while the modal still makes the page inert, so the call does nothing and focus goes to the opener; please document a route that works afterclose(), or say there is none yet. - A scrim Drawer's trap deactivates while its dialog is still modal for the slide-out, so every stand-in is inert and each close logs "no element could take focus … focus is left on the page body" although Drawer then returns focus to its opener; please skip the trap's return while its container is an open modal dialog, or keep Drawer off the chain until it is in scope.
utils/focusReturn.tsadds its own reachability test (tabStopsIn,isRendered,canTakeReturnedFocus) beside the focus trap'sgetFocusableElements, and it has already drifted (noaria-hiddenrule, no popover-open exception), so please share one helper and remove the copy.- The description and changeset present the menu-row Dialog and the manual (
hasLightDismiss={false}) popover as falling to the page body, yet both already return focus to their trigger on the base branch (the new menu-row and nested manual-popover tests pass there), and the "one rule" does not reach the bottom-sheet presentations, so please narrow the changeset to the cases this change fixes.
92976e6 to
f2bbdae
Compare
923cd1e to
2ffbdf5
Compare
|
/approve-spec 74e7d5c |
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.
The engineering owner's /approve-spec at this head settles the two readings the AST-116 record left open: the public useFocusTrap hook and a scrim Drawer removed while open use the shared chain, and FR20 gains the component's own stand-in step and the first-control reading for a trigger or anchor. No blocking defect remains, and the merge of the main branch changes nothing this pull request does. In the stack, this pull request lands only when #11117 below it is approved too.
- Two non-blocking notes from the last review still apply: a misplaced comment in
usePopover.tsx, andisInsideOrLostrepeatingisFocusLostin the focus-return utility (see the earlier inline threads).
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- Popover and DropdownMenu in their popover presentation, and Dialog, move focus at close only when the close would strand it: verified (the stranded check in the focus-return utility; jsdom tests).
- Focus that used to fall to the page body goes, in the listed order, to the opener, the trigger, the
aria-controlsowner, the component's own stand-in, the anchor, the former place, an ancestor, the parent layer, thenmain: verified (the candidate chain; in Chromium a remounted trigger takes focus where the main branch leaves it on the body). - A DropdownMenu no longer focuses its trigger when focus never entered the menu: verified (the menu's own refocus is removed and the shared return needs focus to have entered).
useFocusTrapreturns focus the same way, and a Drawer gets the shared return only when it is removed while open: verified (the public hook is the internal trap, which stands down on a modal dialog).- There is no option to turn focus return off: verified.
- Redirect focus in
onOpenChangeor inusePopover'sonHide, and for a Dialog after it closes: verified (hide-notification test; Dialog docs). - A Popover or DropdownMenu returns focus before the browser's own restore, so its trigger rings only after keyboard input: verified (close-start return; the Chromium keyboard path rings; the pointer-pick test shows no ring).
- The browser's own restore leaves focus on the body when the opener is gone: verified in Chromium (main branch, remounted trigger); the Firefox and WebKit figures describe the author's own earlier measurement.
- A closing layer hands its return only to a child that holds focus or is still opening: verified (code; tests).
- An opener, ancestor or
maingets a temporary tab stop, while a trigger or anchor that cannot take focus hands it to its first control: verified (code; tests). - Focus never lands on the body, and a development warning names the layer when nothing qualifies: verified (code; test).
- A layer removed while open returns focus to a surviving opener at once, else after the removal: verified (code; the Dialog unmount cases pass).
- Dialog reads whether focus is stranded before it closes, then returns it: verified (code).
- A control takes a plain focus, and a stand-in container takes one without scrolling: verified (tests).
- Focus leaves a surface hidden because its anchor left the document: verified (jsdom; Chromium).
- No new public API: verified (generated API comparison; its one row is the anchor option from the pull request below).
- The record edits are the listed gap lines, verification rows and impact bullets: verified (diff).
- One modal-dialog helper now serves the focus return, the modal announcer and the sheet stack: verified.
- The open-time scan looks only at the opener's nearest ancestors: verified (four ancestors).
- The listed suites pass: verified (233 files, 5,426 tests at this head; the description's 5,416 predates the merge of the main branch).
- Typecheck and lint are clean: verified (core build with
tsc; eslint on the changed files). - The new browser specs pass in Chromium and WebKit: the Chromium outcomes are verified by this review's runs of the specs' steps; WebKit could not run here.
- First-load size growth on the reference pages: verified (docs +1 B, form +15 B, menu +2,049 B, table +1,598 B, popover +2,039 B gzip against the pull request below).
Files:
.changeset/layer-focus-return.md: clearapps/storybook/stories/LayerFocusReturn.stories.tsx,apps/storybook/stories/PopoverAnchorRef.stories.tsx: cleardocs/families/overlay-dismissal.md: clear (gap line; the merge keeps both sides)docs/specs/AST-116-popover-anchoring/spec.md: clear (owner-approved at this head)docs/specs/components/Dialog/Dialog.spec.md,DropdownMenu/DropdownMenu.spec.md,Popover/Popover.spec.md: clearinternal/eslint-plugin-astryx/no-comment-provenance.baseline.json: clear (generated)packages/core/src/BottomSheet/bottomSheetStack.ts,hooks/useAnnounce.ts,utils/nodeType.ts: clearpackages/core/src/Dialog/Dialog.doc.mjs,Dialog.test.tsx,Dialog.tsx: clearpackages/core/src/DropdownMenu/DropdownMenu.doc.mjs,DropdownMenu.test.tsx,DropdownMenu.tsx: clearpackages/core/src/Layer/__tests__/LayerFocusReturn.interaction.browser.spec.ts: clearpackages/core/src/Popover/Popover.doc.mjs,usePopover.doc.mjs,PopoverAnchor.test.tsx,__tests__/PopoverAnchor.interaction.browser.spec.ts: clearpackages/core/src/Popover/usePopover.tsx: clear (one non-blocking comment note)packages/core/src/hooks/focusableSelector.ts,hooks/useFocusTrap.ts: clearpackages/core/src/utils/focusReturn.ts: clear (one non-blocking duplicate-helper note)packages/core/src/utils/focusReturn.test.ts,utils/layerFocusReturn.test.tsx: clear
|
/approve-spec fb5e34e |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #12891.
|
/approve-spec 6663322 |
There was a problem hiding this comment.
This pull request is reviewed as part of its stack; see the review on #13015.
|
/approve-spec ccdeb5c |
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, and marking it ready for review lets the required checks run.
Popover, usePopover, DropdownMenu (popover presentation) and Dialog now return stranded focus through one chain that ends at main, and the engineering owner's spec approval at this head covers the readings the spec text left open (the public useFocusTrap hook and a scrim Drawer removed while open, and the recorded fallback deviations). In Chromium and Firefox, a remounted trigger and an anchor removed with focus inside now land on the new trigger and the opener, where the base leaves focus on the page body.
Two non-blocking points remain from earlier comments:
usePopover.tsx:561:// Core layer for popover positioningnow sits aboveanchorMissingRef, and the comment at 565–569 opens with a 38-word sentence; move the first and split the second.focusReturn.ts:478:isInsideOrLostrepeatsisFocusLostin the same module; one definition is enough.
Claims and files checked
Review mode: full; reason: other:previous review was a stack pointer
Claims:
- Popover and DropdownMenu (popover presentation) and Dialog move focus only when the close would strand it: verified (
isLayerFocusStranded,utils/focusReturn.ts:684; Dialog reads it beforeclose(),Dialog.tsx:785). - The fallback order (opener, trigger,
aria-controlsowner, component stand-in, anchor, former place, ancestor, parent layer,main): verified (focusReturn.ts:615-664). - A DropdownMenu no longer focuses its trigger when focus never entered the menu: verified (its own refocus in the hide handler is removed; the trap's record returns only after focus entered).
- The
useFocusTraphook returns focus the same way: verified (useFocusTrap.ts:503-507). - A Drawer keeps its own return at close and gets the shared one only when removed while open: verified (
useFocusTrap.ts:655stands down while the dialog is still modal). - No option turns focus return off: verified (no new prop or option; the API report lists no change).
- Focus moved in
onOpenChangeoronHidestays; a Dialog needs a move after it closes: verified (unit test for the hide notification; Dialog's inert-page gap is recorded). - A Popover or DropdownMenu returns focus before the browser's own restore: verified (
useLayer's close-start hook runs inhide()and inbeforetoggle); the no-ring-after-mouse result was not re-run at this head. - Handoff only to a child that holds focus or is still opening: verified (
focusReturn.tshandoff loop; jsdom tests). - Removed while open: the trap returns to a present opener at once, Dialog a microtask later, with no warning when nothing survives: verified.
- Plain focus for a control, no-scroll focus with a temporary tab stop for a container: verified (
focusReturnTarget,focusCandidate). - Focus leaves a surface whose anchor left the document: verified (the two new tests fail on the base and pass on the head; Chromium and Firefox checks).
- The warning names the layer by its record's id: verified (
nameOf). - One modal-dialog test in
utils/nodeType.ts, used by the announcer and the sheet stack: verified. - No new public API: verified (API report: 0 rows for Core and the seven themes).
- The CLI search golden for "close" counts 52: verified (golden suite passes).
- Record changes (gap lines removed and added, verification rows, impact bullets): verified against the diff.
- First-load size deltas: reported, not re-measured.
- Full-suite and WebKit counts: not re-run; the touched suites pass here (653 tests).
Files (31): every file visited; all clear except the two non-blocking notes above (packages/core/src/Popover/usePopover.tsx, packages/core/src/utils/focusReturn.ts).
User need
Losing focus strands keyboard and screen reader users. Today each layer returns focus its own way, and each one falls to the page body in a common case:
The browser's own restore does not cover these. In Chromium 149, Firefox 151 and WebKit 26.5:
<dialog>whose opener still exists;Problem and solution fit
One shared return in
utils/focusReturn.ts(trackLayerFocus,isLayerFocusStranded,restoreLayerFocus), used by Popover (through the focus trap), Dialog and DropdownMenu (AST-116 FR17–FR21, AR1, DEC-6).When it acts. Only when focus entered the layer and is now inside it, inside another closing layer, or on nothing. Focus already outside stays put, including focus a caller moved in
onHideoronOpenChange.Handoff. The runtime records which layer opened which. A closing layer hands its return to a layer it opened only when that layer holds focus, or is opening and still to take it; the child then inherits the chain, so menu → dialog → the menu trigger works. A child that never took focus (a typeahead's result list), or that focus has left, does not take the return: the closing layer returns focus itself (FR19).
Chain. Focus goes to the first candidate that is connected, rendered, not inert (including under an open modal dialog), not inside a closed dialog, and not in a closing layer. An opener, an ancestor or
mainthat cannot take focus gets a temporary tab stop. A trigger or an anchor that cannot take focus gets none: its first control stands in for it, and it is skipped when it has no control (FR20 gap:):aria-controlsnames the layer;main.It never lands on the body; a development warning fires if nothing qualifies.
Removal. A layer removed while open (with its owner, or its whole view) returns focus to its opener when the opener is still on the page: at once for the focus trap, a microtask later for Dialog. Otherwise it waits until the removal is done, so it never lands on an element the same removal is taking away, and it does not warn if nothing survives.
Timing. A popover returns focus as it starts to close, while it still holds focus: in the hook's own
hide(), and inbeforetogglefor a close the browser makes. The browser's restore then has nothing to do, and the ring follows the last input. A modal<dialog>keeps the page inert untilclose(), so Dialog reads whether focus is stranded first, closes, then returns focus.Move. Popover moves focus to a control with a plain focus, as released (it scrolls the control into view). A container that only stands in (an ancestor,
main) gets a temporary tab stop and takes focus without a scroll, so the page does not jump to its top. Dialog and DropdownMenu keep their ring-follows-last-input moves.A surface that loses its anchor (AR1). When a
usePopoversurface hides because itsanchorRefelement left the document (FR6) while focus is inside it, focus moves to the trigger when it takes focus, else along the chain.No off switch. There is no option, and the types accept no
false.Current specification
spec:AST-116FR17–FR21, AR1 and DEC-6 (current, onmain). It supersedes the earlierreturnFocusoption this PR carried.Record changes here, all in
spec:AST-116unless named:FR17 gap:, the earlierFR19 gap:(a Dialog opened from a menu row), the earlierFR20 gap:(a removed opener left focus on the body), the earlierFR21 gap:(no warning named the layer) andAR1 gap:.FR16 gap:gains the sheet's return (a sheet keeps BottomSheet's own return);FR18 gap:(new): a Dialog's close notification runs while the page is inert, so a focus move there does nothing;FR19 gap:(new): a popover that a control opens throughshow()in the handler or commit that closes that control's own layer does not reach that layer's candidates;FR20 gap:(new text): the chain also tries a component's own stand-in for its opener, and a trigger or an anchor that cannot take focus gets no temporary tab stop;FR21 gap:(new text): a layer removed with its page or view gives no warning; the warning names a Popover by its generated id and a Dialog with noidonly as "a layer".family:overlay-dismissalgainsFR9 gap:: a Popover's focus return to a control is a plain focus, which can scroll the control into view, where FR9 says the return does not scroll. That is the released behavior onmain; this PR keeps it for a control, becausespec:AST-116FR22 names no change to it, and records the gap.component:Dialog,component:DropdownMenuandcomponent:Popoverdrop the matching gap lines.Public delta and caller burden
useFocusTraphook is the trap that carries Popover's part, so its direct callers get the same return.spec:AST-116names Popover, Dialog and DropdownMenu only. The release note namesuseFocusTrap; whether it stays in, and the spec's scope line with it, is the owner's call. A Drawer keeps its own return at close: its trap stands down while the<dialog>is still modal, and the shared return reaches a Drawer only when it is removed while open.restoreFocusTo.useFocusTrapInternalgainsgetTrigger,getAnchorandlayerId, and returnsreturnFocusandmoveFocusOut;useLayer's close-start hook drives it for Popover.Design and alternatives
Evidence
layerFocusReturn.test.tsx:main, never the body;preventScrollfor a control (fails with it), and withpreventScrollformain;tabindex="-1") takes it, not the first control inside it;inertattribute for it);PopoverAnchor.test.tsx(AR1): with focus in a popover whose anchor leaves the document, focus moves to the trigger; with no trigger, to the element focused when it opened. Both fail without the move. When the anchor returns, the surface shows and focus is not moved back.LayerFocusReturn.interaction.browser.spec.ts, with its fixture stories:PopoverAnchor.interaction.browser.spec.ts: a control inside a popover with no trigger removes the popover's anchor; the surface hides and focus goes to the element that held focus when the popover opened; when the anchor is back and the caller shows again, focus is not moved back (AR1). The story gains that control, and its outside controls move clear of the open popover;PopoverFocusReturn.interaction.browser.spec.ts, already onmain, still passes: a controlled popover opened from the keyboard returns focus to its trigger on Escape and after a pick.focus-drive.mjsfor a macOS run.showModal()does in a browser.useFocusTrap.test.tsx.Scope
Components: Popover, usePopover, Dialog, DropdownMenu, useFocusTrap, Drawer (only when removed while open), utils/focusReturn (internal)
Testing
pnpm exec vitest run --project ui packages/core/src/utils packages/core/src/Popover packages/core/src/Dialog packages/core/src/DropdownMenu packages/core/src/Typeahead packages/core/src/Layer packages/core/src/hooks packages/core/src/PowerSearch packages/core/src/Drawer packages/core/src/BottomSheet: 5,416 passedtsc --noEmit(core), eslint: cleanpnpm exec vitest run --project node packages/cli/test/experimental-isolation.test.mjs packages/cli/test/golden-reads.test.mjs, the CLI golden suites: 68 passedpnpm test:interactionfor the three specs above: Chromium 7 passed; WebKit 7 passed (Playwright's container image)Changes since the last review
closecounts one more match, 52 where it was 51: DropdownMenu's doc now says where focus goes on close. CI'stest-nodecaught it; the golden's two files change by that number only.anchorRefhead of feat(usePopover): anchorRef names an anchor apart from the trigger (AST-116 FR1–FR3, FR5, FR6) #11117. The code that moved focus out of a surface hidden byanchorOutOfViewBehavioris gone with that option.preventScrollfor a control, so a Popover's return scrolls its trigger into view, as released; a stand-in container still takes focus without a scroll.takesFocusAsIs, the chain's test for an element that takes focus with no temporary tab stop, now lives in this PR (utils/focusReturn.ts), with its unit tests.isModalDialoginutils/nodeType.tsis now the one test for a modal dialog:isOpenModalinhooks/useAnnounce.tsand BottomSheet's stack call it. BottomSheet keeps itsaria-modalfallback, which jsdom needs.Writing rubric results
The record changes are gap lines (removed where this PR meets the requirement, added or reworded where part is still missing), verification rows and two Current-state impact bullets.
First-load size (INV10)
pnpm size:pages --page popover=Popover,Button,Text, this PR's change in gzip bytes against #11117:Focus return is not optional (it always runs), so INV10's 0.3 KB allowance does not apply; this is the shared-module growth INV10 asks to report.