Repository navigation
spec(popover): isModal keeps its released meaning, and usePopover takes tabBehavior (AST-116) - #13015
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approval of #13015 waits on an engineering owner's decision on its four records. #11117 and #11121 are approved; #11121 is pending CI.
#13015 (isModal keeps its released meaning; tabBehavior): waiting on an engineering owner's decision, with no blocking finding. An engineering owner has to approve or amend, at this head, what it changes in the current spec:AST-116 record:
isModalsets onlyaria-modal, and Tab stays contained either way. This reverses current DEC-5 and FR12.- DEC-11 adds a new
usePopoverinput,tabBehavior: 'contain' | 'pageOrder', with its type rule againstisModal: true. - FR15 adds rules for a
'pageOrder'popover: an outside press, a touch pan, another popover or a modal dialog opening, andhasEscapeDismiss: false. - Every sheet is modal (FR16), and FR22 names one change.
- The matching
component:Popover,family:overlay-dismissalandspec:AST-119edits.
#11121 (shared layer focus return): approved pending CI. Its head is unchanged since its approval and carries an engineering owner's /approve-spec; CI has not run on it yet.
#11117 (usePopover anchorRef): approved. Its head is unchanged since its own approval.
Whole stack: nothing blocks between the three pull requests. A pull request in this stack lands only when it and every pull request below it are approved. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims (#13015 description; the release notes come from #11117 and #11121):
- Four records and no code: verified (the increment changes four Markdown records).
usePopoverruns its focus trap whenever the popover is open, andisModalonly setsaria-modal: verified (usePopover.tsxtrap options and itsaria-modalline).presentationis a Popover prop and not ausePopoverinput: verified.- PowerSearch's token editor and the rich text link form set
isModal: falseand keep their Tab cycle: verified (both pass it, and containment ignores it). - The records stood as described: AST-116 DEC-5 was decided by the author, and Popover DEC-8 and DEC-9 by their owner. Verified from the current records.
- INV2's list of input words holds no key name: verified.
- #11156 implements the old DEC-5 and is out of the stack, #12932 lists "non-modal popovers hold Tab" as open, and #12265 changes a modal region's Tab cycle: verified from those pull requests.
- The knowledge check, Prettier and the whitespace check pass: verified by rerunning them.
- No pull request references or project status added, and the gap lines state today's mismatch: verified.
- The call-site survey, platform notes and name-reading test: not checkable from the repository, and not relied on.
- The release notes for
anchorRefand the shared focus return: unchanged since the approvals that verified them.
Files:
|
/approve-spec 3ce2916 |
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. Marking it ready for review starts CI, and the required checks must pass before merge.
#13015 (isModal keeps its released meaning; tabBehavior): approved pending CI. An engineering owner approved its four records with /approve-spec for this head, and no blocking finding remains.
#11121 (shared layer focus return): approved pending CI. Its head is unchanged since its approval.
#11117 (usePopover anchorRef): approved. Its head is unchanged since its approval.
Whole stack: nothing blocks between the three pull requests. A pull request in this stack lands only when it and every pull request below it are approved.
Claims and files checked
Review mode: same-head; reason: none
- Changed rules since the last review: none.
- Engineering-owner approval of the four records for this head: verified (an engineering owner's
/approve-speccomment, and the spec-owner status passed). - Approval lines: verified unchanged (one new decider line for the new decision; existing decider and approver lines untouched).
Claims (#13015 description; the release notes come from #11117 and #11121):
- This change is four records and no code: verified (the increment changes four Markdown records).
usePopoverruns its focus trap whenever the popover is open, andisModalonly setsaria-modal: verified (usePopover.tsxtrap options and itsaria-modalline).presentationis a Popover prop and not ausePopoverinput: verified.- PowerSearch's token editor and the rich text link form set
isModal: falseand keep their Tab cycle: verified (both pass it, and containment ignores it). - The existing decisions stood as described: the popover-anchoring modality decision was the author's, and the Popover sheet and focus-region decisions their owner's: verified from the current records.
- The behavior-prop naming rule's list of input words holds no key name: verified.
- The overlay-dismissal Escape exception and the tour step's modality are re-keyed on
'pageOrder': verified in the diff. - The related open pull requests (#11156, #12932, #12265) stand as described: verified from those pull requests.
- The knowledge check, Prettier and the whitespace check pass: verified (rerun at this head).
- Prettier realigned four tables, and no pull request references or project status were added; the gap lines state today's mismatch: verified.
- The call-site survey, platform notes and name-reading test: not checkable from the repository, and not relied on.
- The release notes for
anchorRefand the shared focus return: unchanged since the approvals that verified them.
Files:
3ce2916 to
2d06a3d
Compare
|
/approve-spec 2d06a3d |
There was a problem hiding this comment.
Approved pending CI: CI has not run on either head yet, because both pull requests are drafts. Marking each ready for review starts every suite at its head, and the required checks must pass before merge.
#11121 (one shared layer focus return): approved pending CI. An engineering owner approved this head, and no blocking finding remains.
#13015 (isModal keeps its released meaning; tabBehavior): approved pending CI. An engineering owner approved its four records for this head, and no blocking finding remains.
Whole stack: passes. A pull request in this stack lands only when it and every pull request below it are approved.
Claims and files checked
Review mode: full; reason: rebase
- Engineering-owner approval of each pull request at its own head: verified (an
/approve-speccomment for each exact head, and the spec-owner status passed on both). - Approval lines: verified (one new decider line for the new decision; existing decider and approver lines unchanged).
Claims in the #13015 description:
- Its own change is four records and no code: verified (its increment changes four Markdown records).
usePopoverruns its focus trap whenever the popover is open, andisModalonly setsaria-modalon a dialog popover: verified (usePopover.tsxtrap options and itsaria-modalline).presentationis a Popover prop and not ausePopoverinput: verified.- No code for the page-order meaning of
isModal: falsehas merged: verified (the trap ignoresisModal). - PowerSearch's token editor and the rich text link form set
isModal: falseand keep their Tab cycle: verified (both pass it, and containment ignores it). - The decisions it amends stood as described: the popover-anchoring modality decision is the author's, and the Popover sheet and focus-region decisions are their owner's: verified from the current records.
- The behavior-prop naming rule's list of input words holds no key name: verified.
- The overlay-dismissal Escape exception and the tour step are re-keyed on
'pageOrder', with the amendment lines described: verified in the diff. - The compatibility requirement now names one released change instead of three: verified.
- The related open pull requests stand as described: verified from their titles and states.
- The knowledge check, Prettier and the whitespace check pass: verified (rerun at this head).
- Prettier realigned four tables, and no pull request references or project status were added; the gap lines state today's mismatch: verified.
- The decision changes no released caller: verified (no code in this increment).
- The call-site survey, platform notes and name-reading test: not checkable from the repository, and not relied on.
Claims in the #11121 description and its release note:
- The order focus tries (opener, trigger, the control naming the layer in
aria-controls, the component's stand-in, the anchor or its first control, the opener's former place, the nearest surviving ancestor, the layer that opened this one, thenmain): verified (focusReturn.tschain). - Focus moves only when the close would strand it, and focus already outside stays: verified (the stranded check and its tests).
- A DropdownMenu no longer focuses its trigger when focus never entered the menu: verified (its own refocus is gone; the trap returns only focus that entered).
- The public
useFocusTraphook shares Popover's trap and returns focus the same way: verified. - A Drawer keeps its own return at close and gets the shared one only when removed while open: verified (its trap stands down on a modal dialog; removal runs the shared repair).
- There is no option to turn focus return off: verified.
- To send focus elsewhere, focus it in
onOpenChangeoronHide, and for a Dialog after it closes: verified against the code and the docs. - A Popover or DropdownMenu returns focus as it starts to close, before the browser's own restore: verified in the code.
- No new public API: verified (the API generator lists no change).
- The record edits are gap lines, verification rows and impact bullets, and the Dialog, DropdownMenu and Popover records drop their matching gap lines: verified in the diff.
- The unit results it reports: the seven affected suites pass at this head (553 tests); its real-browser runs were made before the merge of
main, on the same code. - First-load size growth on the reference pages: reported in the description.
Files:
- #13015 (4/4), each clear: the popover-anchoring, Popover, overlay-dismissal and tour records.
- #11121 (29/29), each clear: the release note; the two stories; the popover-anchoring, overlay-dismissal, Dialog, DropdownMenu and Popover records; the comment-provenance baseline;
bottomSheetStack.ts; Dialog's source, doc and test; DropdownMenu's source, doc and test; the layer focus-return browser spec; Popover's doc and anchor tests (unit and browser);usePopover.tsxand its doc;focusableSelector.ts;useAnnounce.ts;useFocusTrap.ts;focusReturn.tsand its test; the new layer focus-return test;nodeType.ts.
…-feature allowance (AST-116 DEC-12)
2d06a3d to
232c7cc
Compare
|
/approve-spec 232c7cc |
There was a problem hiding this comment.
Approved pending CI. An engineering owner approved all five records for this exact head, no existing decision or approver line changed, and no blocking finding remains. CI has not run on this head because the pull request is a draft: marking it ready for review starts CI, and the required checks must pass before merge.
Claims and files checked
Review mode: full; reason: rebase
Claims in the description:
- Two commits change five records and no code: verified.
- The anchor and focus-return pull requests it builds on have merged: verified.
- An engineering owner approved the records at this head: verified (an
/approve-speccomment for this exact head, and the spec-owner status passed). - Approval lines: verified (two new decisions; no existing decider or approver line changed; three amendment lines added, one rewritten, one removed).
usePopoverruns its focus trap whenever the popover is open, andisModalonly setsaria-modalon a dialog popover: verified (usePopover.tsxtrap options and itsaria-modalline).presentationis a Popover prop and not ausePopoverinput: verified.- No code for the page-order meaning of
isModal: falsehas merged: verified (the trap ignoresisModal). - PowerSearch's token editor and the rich text link form pass
isModal: falseand keep their Tab cycle: verified. - The decisions it amends stood as described: the Popover focus-region and sheet decisions and the unused-feature size decision are their owner's, and the popover modality decision is the author's: verified.
- The behavior-prop naming rule lists pointer and touch words and no key name: verified.
- The size record allows 0.3 KB for an unused optional feature and had one named entry, Spinner's theme lookup; the new entry bounds
'pageOrder'under 0.5 KB, and its verification row and decision gain matching lines: verified. - The size tool's unused-feature verdict holds 0.3 KB for every feature and knows no named entry: verified.
- The overlay-dismissal Escape exception and the tour step are re-keyed on
'pageOrder', with the amendment lines described: verified. - The compatibility requirement names one released change instead of three, and every sheet is the modal sheet: verified.
- The related open pull requests stand as described: verified from their titles, states and descriptions.
- Rejected alternatives sit in one sentence per decision (three, four, and the earlier decision's one), and the open question is unchanged: verified.
- The knowledge check, Prettier and the whitespace check pass: verified (rerun at this head).
- Prettier realigned five tables, no pull request references or project status were added, and the gap lines state today's mismatch: verified.
- The decision changes no released caller: verified (records only).
- The size table, the call-site survey, the platform and library notes and the name-reading test: not checkable from the repository (the measured code is not pushed), and not relied on.
Files (5/5), each clear: the popover-anchoring record, the Popover record, the import-boundaries record, the overlay-dismissal record and the tour record.
Exact decision needed
Whether
isModal: falsekeeps its released meaning, whether a popover that Tab passes through gets its ownusePopoverinput, and what that input may cost a page that does not use it:isModalsetsaria-modalon a dialog popover and nothing else. Tab stays in the popover whether it istrueorfalse, as released.tabBehavior: 'contain' | 'pageOrder'onusePopoveronly, default'contain'.'pageOrder'is the behaviorspec:AST-116gave toisModal: false: Tab follows the page, Escape applies only while focus is in the popover's scope, and there is noaria-modal. FR15 also states how such a popover closes, which the record did not say before:hasLightDismissis on;hasEscapeDismiss: falseturns its Escape off whateverhasLightDismisssays.presentationis a Popover prop andtabBehavioris a hook input, so no sheet can have'pageOrder'.'pageOrder'may cost a page that does not use it. Built to this record, the option adds about 0.47 KB gzip of first-load JavaScript to a page that renders Popover without it.architecture:component-import-boundariesINV10 allows an unused optional feature 0.3 KB. DEC-12 accepts the difference, and INV10 names the option as an entry under 0.5 KB.spec:AST-116DEC-5 madeisModal: falsethe switch for no Tab containment. No code for it has merged, so this record changes before any released behavior does.Existing authority searched
component:PopoverDEC-9 (current; decided bycixzhang, who owns that record): "A Popover is a focus region, modal or not", with "no Tab containment for non-modal popovers" rejected.spec:AST-116DEC-5 superseded it forisModal: false. DEC-11 keeps DEC-9's rejection for everyisModalvalue and makes one exception, a'pageOrder'popover.component:PopoverDEC-8 (current; alsocixzhang's): the sheet is modal and always light-dismisses. FR16 superseded it forisModal: false. It governs every sheet again, and its amendment line goes.spec:AST-116FR12–FR16, FR22 and DEC-5: the claims this PR changes. DEC-5 rejected a separate focus-region input; DEC-11 adopts a separate input, and DEC-5's new amendment line says so.architecture:public-component-apiINV2 and INV3: a prop that chooses how a component responds to input is a<thing>Behaviorclosed union (INV2), and a new behavior prop defaults to the shipped behavior (INV3).tabBehaviorfollows both. INV2 lists pointer and touch words that a behavior prop's name must not hold; a key name is not among them, and the Tab key is this prop's subject on every device with a keyboard.family:overlay-dismissalFR2 and FR3: the Escape presence exception, keyed on'pageOrder'in place of "non-modal".architecture:component-import-boundariesINV10 and DEC-5 (current; decided bycixzhang, who owns that record): an unused optional feature adds at most 0.3 KB gzip to a page, and a larger one takes its own import or a deferred load. The record has one named entry, Spinner's theme lookup. DEC-12 adds a second.spec:AST-119FR14 and DEC-6: a tour step without a backdrop is the'pageOrder'popover. FR14 says so, and DEC-6 gains an amendment line.usePopoverruns its focus region whenever the popover is open, andisModalonly setsaria-modalon a dialog popover.presentationexists on Popover and not onusePopover.tabBehavior,isModal, focus trap and Tab containment:Decision
Decider:
nynexman4464(DEC-11 and DEC-12), an engineering owner. See the record. In short:isModal(Popover andusePopover, defaulttrue): withtruea dialog popover carriesaria-modal; withfalseit carries none. Tab is contained either way.tabBehavior(usePopoveronly, default'contain'):'contain': Tab and Shift+Tab cycle inside the open popover.'pageOrder': the popover contains nothing and never carriesaria-modal. Its controls come after its trigger in the page's Tab order, or after its anchor when it has no trigger. Escape closes it only while focus is inside it, or on or inside its anchor or trigger. It closes as item 2 above lists.isModal: truewith'pageOrder'is a type error and a development warning. WithisModalunset, a'pageOrder'popover is not modal.'pageOrder'may cost a page that renders Popover without it more than the 0.3 KB allowance, under 0.5 KB gzip.architecture:component-import-boundariesINV10 gains a named entry for it, INV10's verification row holds a named entry to its stated bound, and that record's DEC-5 gains an amendment line.This decision changes no released caller. FR22's focus-return change is not part of this pull request.
Rejected alternatives
isModal: falseas the switch for no containment (DEC-5 as written): it changes every released caller ofisModal: false.isModal(the shape of Base UI'smodal: boolean | 'trap-focus'): the cleanest end state, but it deprecates a released prop and needs a codemod.hasFocusTrapboolean: INV2 asks for a behavior prop, and a default-on boolean that callers turn off reads as a double negative.tabBehaviortake an imported value where DEC-11 sets a closed union; a'pageOrder'popover that no press outside closes, which costs less and drops FR15's outside press; FR15 without the touch-pan rule, which stays over the allowance; and a deferred load of the outside-press watch, which does not bring the option under the allowance and puts Layer's outside-press watch on pages that carry none.focusScope: 'popover' | 'page',isInPageTabOrder,keyboardBehavior: 'contain' | 'inline', and'afterAnchor'as the second value. None read better, and'afterAnchor'is wrong for a popover whose trigger is not its anchor.Claim scope and non-goals
Popover and
usePopoverforisModal;usePopoverfortabBehavior. Out of scope:tabBehavioron the Popover component (spec:AST-116DEC-8 keeps composition inputs on the hook).aria-modalat all.Evidence and implementation relationship
Released use. A survey of one large product codebase found about 450 call sites, in about 180 apps and libraries, that set
isModal={false}orisModal: false. Their comments state the intent: keep the dialog role and the focus trap, and droparia-modalbecause the page stays usable.Platform practice supports both surfaces. Windows documents that light-dismiss flyouts "trap keyboard and gamepad focus inside their transient UI until dismissed" without being modal. The HTML Popover API's popovers are "always non-modal", and Tab moves on in page order.
Other libraries separate the two axes in the same way: Base UI's
modal="trap-focus"traps focus and leaves the page interactive, and Fluent hastrapFocusapart from its modal type.Name reading test. A reader that saw only the option names, types and defaults (
isModalplus one candidate, no documentation) said whatisModal={false}does, then wrote options for a tour step, a filter editor and a full modal. 24 runs over seven conditions:isModalalone: both runs saidisModal={false}lets Tab leave, and both said the filter editor "cannot be expressed".tabBehavior: 'contain' | 'pageOrder': 5 of 5 runs wrote all three option sets correctly, and 4 of 5 readisModalas thearia-modalswitch.hasFocusTrap: 5 of 5 wrote the option sets correctly, and 1 of 5 readisModalas thearia-modalswitch.tabBehavior: 'contain' | 'pageOrder'first.Size. Measured with
pnpm size:pageson the rework of feat(usePopover): tabBehavior lets Tab pass through a popover (spec:AST-116 FR12–FR15, AR4) #11156, which is not pushed yet, against the same code with every'pageOrder'path removed, inusePopoverand in the shared layer and focus-trap hooks.architecture:component-import-boundariesnotes that a local run can print gzip sizes a few tenths of a KB apart from CI's.The last row is the option's share of the shared layer hook, which every page with a layer loads. Two smaller builds were measured on an earlier head: without FR15's outside press the option costs less than half as much, and without FR15's touch-pan rule it stays over the allowance. Loading the watch on demand did not bring the option under the allowance, and it put Layer's outside-press watch on the table page, which carries none today.
Implementation: feat(usePopover): tabBehavior lets Tab pass through a popover (spec:AST-116 FR12–FR15, AR4) #11156 is reworked to this record.
usePopovergainstabBehavior; PowerSearch's token editor and the rich text link form keep their released Tab cycle; the non-modal sheet is removed. feat(Tour): Tour moves from Lab to Core with steps as data and an app-owned active step (AST-119) #12891 (Tour) uses'pageOrder'for a step without a backdrop.Writing rubric results
isModal: falseis and which callers rely on it, in the present tense. DEC-12 states the option's cost and the allowance in the present tense. TheAmended:lines state which decision governs what, as the records' other amendment lines do: three are added (spec:AST-116DEC-5,spec:AST-119DEC-6,architecture:component-import-boundariesDEC-5), one is rewritten (component:PopoverDEC-9), andcomponent:PopoverDEC-8's is removed because it is no longer true.component:Popoverkeeps earlier pull request references that this change does not touch: in Basis and verification cells, in its Intent, in AR5 and on DEC-4's Decider line.component:Popoverkeeps the earlier ones named under R3.usePopoverhas notabBehavior), FR15 ("no popover scopes Escape to its focus") and FR16 (a sheet returns focus through BottomSheet's own return).component:Popover's AR3 gap andfamily:overlay-dismissal's FR2 and FR3 gap follow them.Scope
Components: usePopover, Popover, Tour
Validation
pnpm check:knowledge: passes ("Knowledge templates and records are aligned").prettier --check. Cell widths changed, so Prettier realigned five tables: Verification inspec:AST-116, Verification inarchitecture:component-import-boundaries, and Public concepts, PublicusePopoversemantic inputs and Representative focus and dismissal states incomponent:Popover. Hide whitespace to read the diff.git diff --check: clean.--unused-onverdict holds 0.3 KB for every feature and knows no named entry. The gap lines say what Core does today.