Skip to content

feat(usePopover): tabBehavior lets Tab pass through a popover (spec:AST-116 FR12–FR15, AR4) - #11156

Merged
nynexman4464 merged 1 commit into
mainfrom
nynexman4464/feat/popover-is-modal
Nov 21, 2026
Merged

nynexman4464 merged 1 commit into
mainfrom
nynexman4464/feat/popover-is-modal

Conversation

@nynexman4464

@nynexman4464 nynexman4464 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Based on main. Implements spec:AST-116 FR12–FR15 and AR4 as #13015 amended them; #13015 has merged. The sizes below are against the code before this pull request.

User need

A coachmark or tour step points at a control the person should be able to reach and use. Every popover holds Tab while it is open, so the keyboard cannot reach the control the step describes. Product code also relies on that hold: a filter editor or a link form sets isModal={false} to drop aria-modal and keeps Tab inside.

Problem and solution fit

usePopover takes tabBehavior (spec:AST-116 FR12–FR15, DEC-11).

  • 'contain' (default, the released behavior): Tab and Shift+Tab cycle inside the open popover, whatever isModal says.
  • 'pageOrder':
    • The popover holds nothing; Tab and Shift+Tab move in the browser's order. Where the browser supports popover invokers, the popover's controls come after its trigger, or, when it has no trigger, after an anchor that can take focus. Otherwise they keep their DOM place. A tooltip or the keyboard hint on the trigger does not disturb that place. When another layer opened from the same trigger or anchor closes (a menu, a hover card), the popover's controls leave the Tab order until the popover opens again (Evidence has the detail).
    • Escape closes it only while focus is inside it, or on or inside its anchor or trigger. Otherwise the press passes to the layer or page beneath.
    • It never carries aria-modal. isModal: true with it is a type error and a development warning; with isModal unset it is not modal.
    • A press that starts and ends outside it closes it when hasLightDismiss is on. A touch pan outside is a gesture, not a press. A press on its trigger is left to the trigger.
    • It stays open when another popover or a modal dialog opens without a press outside it (from the keyboard or from code). A press in a modal dialog above it, the dialog's backdrop included, is left to that dialog.
    • hasEscapeDismiss: false turns its Escape off even with light dismiss on.
  • isModal is unchanged: it sets aria-modal on a dialog popover and nothing else.
  • Both: a Tab pressed outside is never pulled in; focus entry and focus return are the same.
  • AR4: a dialog popover that code opens, and that moves no focus into itself, announces its name politely. This applies to every dialog popover, and is the one documented behavior this PR changes.

tabBehavior is on the hook only. The Popover component, its sheet, PowerSearch and the rich text link form keep their Tab containment, Escape and light dismiss as on main.

Current specification

spec:AST-116 FR12–FR16, AR4 and DEC-11, as #13015 amends them. This PR changes record lines only where the code now meets them or a new gap appears:

  • Gap lines this PR meets are removed: FR12 gap:, FR15 gap: and AR4 gap: in spec:AST-116; component:Popover's AR3 gap:; and family:overlay-dismissal's FR2 and FR3 gap: line.
  • One new gap line in family:overlay-dismissal: FR3 gap: a platform close request, such as the Android back gesture, does not reach a 'pageOrder' popover.
  • One sentence is added to FR12 in spec:AST-116: "A tooltip and the keyboard hint take no invoker place, so neither takes the popover's."
  • One new FR12 gap: line in spec:AST-116: when another layer opened from the same trigger or anchor closes while a 'pageOrder' popover is open (a menu the anchor opens, a hover card on the trigger), the popover's controls leave the Tab order until the popover opens again. Evidence has the measurements.
  • spec:AST-116's path list gains Tooltip/useTooltip.tsx and hooks/useKeyboardHint.tsx, and its Current-state impact gains one line for them.
  • One gap line is added to component:Popover: AR4 gap: for a sheet's focus return, which spec:AST-116's FR16 gap: already states.
  • FR9 gap: gains one sentence: a 'pageOrder' popover's own outside-press watch closes the popover as the browser's light dismiss does, with the same outcome for a show() in that press.
  • AR4 reads "opens without a person's press or key on its trigger, while the pointer is not on its trigger". A popover that opens while the pointer is on its trigger is treated as the person's own open, so it is not announced. That includes one that code opens while the pointer rests there. A flyout that opens on hover stays silent, as on main.
  • Platform support's evidence line names Chromium and WebKit. It named Firefox too, and no pull request in this stack runs Firefox.
  • Verification rows name the test files that exist: FR12–FR16 names Popover.test.tsx, PopoverOutsidePress.test.tsx, PopoverAnchor.test.tsx, PopoverPresentation.test.tsx, Tooltip.test.tsx and useKeyboardHint.test.tsx; FR9 adds PopoverOutsidePress.test.tsx; AR2–AR4 names PopoverAnchor.test.tsx, the two focus-return suites, and PopoverAnnounce.test.tsx with PopoverAnnounceCount.test.tsx. The AR2–AR4 row named a Popover.test.tsx accessibility suite that does not exist.
  • FR22 names a second released change: the announcement (AR4), with its old and new behavior and its target (WCAG 2.2 SC 4.1.3). component:Popover's "Released default preserved" line follows.
  • architecture:layer-runtime names a 'pageOrder' popover in two places: its list of outside-interaction paths, and the line that says which layers use Layer/outsidePress.ts. The first also states one rule in its own words: a press in a modal dialog that does not hold the popover is left to that dialog. spec:AST-116's impact line for that record says so.

Owner decisions here, for an engineering owner's /approve-spec at this head:

  • the new FR3 gap: line, the new AR4 gap: line in component:Popover, and the FR9 gap: sentence;
  • FR12's new sentence, that a tooltip and the keyboard hint take no invoker place, and the new FR12 gap: line;
  • AR4's "while the pointer is not on its trigger";
  • dropping Firefox from the evidence line;
  • FR22's second named change;
  • the two architecture:layer-runtime lines, with the modal-dialog rule;
  • the type parameter on usePopover (below), which no record names;
  • two things no record states: a pen pan counts as a touch pan (FR15 says "touch pan"), and a change of tabBehavior while the popover is open is not supported (the option's doc says so).

Public delta and caller burden

  • New: tabBehavior?: 'contain' | 'pageOrder' on UsePopoverOptions, default 'contain'.
  • usePopover's signature gains one type parameter, TabBehavior, inferred from the tabBehavior option. It exists to reject isModal: true with tabBehavior: 'pageOrder' at the call. A value typed UsePopoverOptions is still accepted, an unknown option is still an error, and UsePopoverOptions stays an interface.
  • Changed for every tooltip and for the keyboard hint: Tooltip, useTooltip and useKeyboardHint (the hint a Toolbar, TabList or SegmentedControl shows) no longer pass their trigger to the browser as the popover invoker (showPopover's source). A tooltip's position, its aria-describedby link, and its hover, focus and Escape behavior are as before, and so are the hint's position and dismissal. Code that read the invoker of a tooltip's or the hint's popover element no longer finds one.
  • Released behavior. isModal, Tab containment, Escape, light dismiss and the popover's place in the focus order are unchanged for every released caller. Callers that set isModal: false in this repo (PowerSearch's filter popover, the rich text link form, Popover's own tests, the LayerSamePress story) are untouched. One documented behavior changes, as an accessibility fix with its own changeset: the announcement (AR4).
  • Internal: useFocusTrapInternal gains isContaining and isEscapeInScope; the latter reaches the shared dismissal stack's isPresent. useLayer's owner watch for pointers outside the open layer (watchesOutside, was watchesOutsidePans) also runs for a layer without the browser's light dismiss, and carries the 'pageOrder' press watch. The layer hands that watch a dismiss, which closes the layer and absorbs a show() from the same press, as the browser's light dismiss does. Layer/outsidePress.ts gains ignoresPans, and Layer/outsidePanClaim.ts gains watchOutsidePresses, the press watch a 'pageOrder' popover gives its layer. utils/focusReturn.ts exports focusableWithin for the invoker. The deprecated hasActiveFocusTrapEscape() does not count a 'pageOrder' popover, which takes Escape only within its scope; a handler that reads that signal also runs when the popover takes the press. useLayer also takes getInvoker, the element whose place in the focus order the open layer takes.
  • AR4 and Core's own compositions: DateInput passes its whole field as the popover's trigger (read in its source, not run), so a press or a key in the field is the person's own and its calendar is not announced. A flyout or menu that opens on hover (a collapsed SideNav item, a DropdownMenu with a header) opens with the pointer on its trigger, so it is not announced either; that is read in their source, and the jsdom test supplies the :hover answer. The other Core compositions were not read for this.
const step = usePopover({anchorRef: targetRef, tabBehavior: 'pageOrder',
  hasLightDismiss: false, dialogLabel: 'Filters', onHide: endTour});
// step.show() when the tour reaches it; step.render(<StepBody />)

Design and alternatives

Decided in spec:AST-116 DEC-11 (#13015). Rejected there: isModal: false as the switch for no containment, which changes every released caller of it; one three-value modality input in place of isModal; and a hasFocusTrap boolean, where architecture:public-component-api INV2 asks for a behavior prop.

The type error comes from a type parameter on the hook, not from a union for UsePopoverOptions: a union would stop callers from extending the interface.

The invoker a 'pageOrder' popover passes to the browser is its trigger, or the first control inside a trigger that takes no focus itself, or, with no trigger, an anchor that can take focus. Browsers place a popover before a control inside its invoker, so a wrapper is not passed as it is. This applies to 'pageOrder' only. A 'contain' popover passes what it passes on main, so a field that wraps its input, such as DateInput, keeps its Tab path while its calendar is open.

A press outside closes a 'pageOrder' popover through the layer's own dismissal, which absorbs a show() or toggle() from that same press. Without that, a page button that toggles the popover could not close it: the press closed it and the click opened it again.

Evidence

  • jsdom, Tab behavior and modality (Popover.test.tsx, the usePopover Tab behavior and modality suite, hook-based):
    • 'contain' and 'pageOrder' both leave an outside Tab and Shift+Tab to the page, and both close on Escape from inside and return focus to the trigger;
    • Tab and Shift+Tab cycle inside for isModal true and false;
    • Tab leaves a 'pageOrder' popover for the next page control;
    • Escape closes a 'pageOrder' popover while focus is on its separate anchor, and passes it while focus is elsewhere;
    • an option usePopover does not have fails to compile;
    • a popover with isModal: false closes on an Escape pressed elsewhere;
    • aria-modal is present only on a modal 'contain' dialog popover;
    • isModal: true with 'pageOrder' fails to compile (@ts-expect-error on that line), warns in development and carries no aria-modal;
    • hasEscapeDismiss: false turns Escape off for a 'pageOrder' popover with light dismiss on;
    • a role-neutral popup carries no role and no aria-modal, wraps Tab with 'contain' and lets it leave with 'pageOrder' (FR14);
    • an Escape pressed elsewhere passes a 'pageOrder' popover, and one on its trigger closes it.
  • jsdom, the released component suite is untouched: Popover focus region (DEC-9) in Popover.test.tsx has no changed line and passes.
  • jsdom, a press outside a 'pageOrder' popover (PopoverOutsidePress.test.tsx):
    • its layer is a manual popover, and a 'contain' one stays an auto popover for isModal true and false;
    • a press that starts and ends outside closes it and reports onHide once;
    • a press inside it, and a press on its trigger, do not close it through the watch;
    • a touch pan outside leaves it open and a tap closes it;
    • with light dismiss off, and with light dismiss turned off while it is open, a press outside leaves it open;
    • a press in a modal dialog above it, on a control or on the dialog itself, leaves it open;
    • a press on the backdrop of the modal dialog that holds it closes it;
    • when a page control toggles it, the press that closes it does not open it again at the click, and a later press opens it.
  • jsdom, the invoker (PopoverAnchor.test.tsx): for 'pageOrder' it is the trigger, the control inside a wrapper trigger, a focusable anchor when there is no trigger, and else nothing; for 'contain' it stays the wrapper itself, and stays the anchor when the popover has an anchor and a trigger, as on main.
  • jsdom, the sheet (PopoverPresentation.test.tsx): the sheet is the modal sheet for isModal true and false (FR16).
  • jsdom, the announcement (PopoverAnnounce.test.tsx): a popover opened from code is announced; one opened by a press on its trigger, by a key on its trigger, or with the pointer on its trigger is not.
  • jsdom, more: outsidePress.test.ts (the pan rule for touch, pen and mouse), gestureCounter.test.ts, useLayer.test.tsx (a layer element remounted while open gets the owner's outside watch), and PopoverAnnounce.test.tsx and PopoverAnnounceCount.test.tsx for AR4 (through usePopover; no test opens a controlled <Popover> from code).
  • Real browser: PopoverTabBehavior.interaction.browser.spec.ts on the seven Popover Tab Behavior stories; 10 of 10 pass in Chromium and in WebKit (Playwright's container):
    • Page Order: Enter on the trigger opens the popover and focuses its first control; Tab passes its controls and the fallback close control and reaches the control after the trigger; Shift+Tab walks back to the trigger; Tab from the trigger enters the popover again; the popover stays open throughout. The story renders the popover's layer after every page control, so DOM order alone would not give this order;
    • Page Order: Escape with focus elsewhere leaves it open; Escape on the trigger closes it;
    • Page Order: a press inside leaves it open; a press on a page control closes it and that control takes focus; a press on the trigger of the open popover closes it and does not open it again;
    • Page Order: it stays open when another Popover opens from the keyboard;
    • Wrapped Trigger: the trigger ref is on a wrapper; Tab from the button inside it enters the popover, and Tab past the popover's controls reaches the page;
    • Separate Anchor: the popover anchors to a button of its own; Tab from that button reaches the trigger, and Tab from the trigger enters the popover;
    • Tooltip Trigger: the trigger has a tooltip. It shows on keyboard focus and hides once focus is in the popover. Shift+Tab then returns to the trigger, Tab from the trigger enters the popover, and a trip round the page comes back in. This test fails without the useTooltip change;
    • Cut Label Trigger: a narrow row cuts the trigger's label, which shows in a tooltip on keyboard focus. Shift+Tab returns to the trigger and Tab enters the popover. This test fails without the useTooltip change;
    • Toolbar Trigger: the trigger is a toolbar item. Keyboard focus shows the toolbar's hint from it, and the hint hides once focus is in the popover. Shift+Tab returns to the trigger and Tab enters the popover. This test fails without the useKeyboardHint change;
    • Not Modal (isModal: false): Tab wraps from the fallback close control to the first control, the dialog has no aria-modal, the page can take focus, and Escape from the page closes it.
  • Another layer on the trigger or the anchor: what is fixed here, and what is not. Found in testing: when a second layer shown from the popover's trigger hides while a 'pageOrder' popover is open, the popover drops out of the Tab order. Tab and Shift+Tab move round the page and never enter it, and in Chromium Shift+Tab out of the popover skips the trigger. Cause: every layer is shown with its trigger as the popover invoker. Chromium keeps one record on the invoker of the popover it opened, and clears it when any popover that names that invoker hides, without checking that the record still names the popover being hidden (SetPopoverInvoker, read on Chromium's main branch, not on the build tested). WebKit's source was not read; going forward it gave the same results.
    • Fixed: a tooltip and the keyboard hint. Neither is meant to hold anything that takes focus, so useTooltip and useKeyboardHint pass no invoker. A keyboard user met both at once: focus on the trigger shows the tooltip or the hint, and moving into the popover hides it. A Button shows such a tooltip for its tooltip prop and, on keyboard focus, for a label that is cut; a Toolbar, TabList or SegmentedControl item shows the hint. A tooltip follows its trigger through CSS anchor positioning and is tied to it by aria-describedby; neither uses the invoker. Checked with and without the tooltip change: Chromium's accessibility tree for a Tooltip and for a Button with tooltip is the same (the button's name, description and properties, and the tooltip node); WebKit's DOM attributes and its role and name snapshot are the same; Tab from a trigger does not stay in a tooltip in either build, also for a tall tooltip that scrolls and for one that holds a button (focus falls to the page and the tooltip closes, both ways). The three new browser tests and the two new unit tests (Tooltip.test.tsx, "shows an HTML trigger tooltip with no invoker source"; useKeyboardHint.test.tsx, "shows the hint with no invoker source") fail without the changes and pass with them.
    • Not fixed, and recorded as FR12 gap:: a layer that holds focus. A menu and a hover card need the invoker for their own Tab order: with a hover card open, Tab from its trigger goes to the card's button. Measured in Chromium and WebKit with temporary stories that are not in this PR: a popover with no trigger, anchored to a DropdownMenu's button, is entered by Tab from that button until the menu opens and closes, and is skipped after; a hover card on the popover's trigger takes the popover out the same way. The changeset, both tabBehavior doc entries and the JSDoc state the limit.
    • Not checked: Firefox, and screen readers.
  • Not covered in a real browser: Firefox (the interaction config has Chromium and WebKit projects); a popover with an anchor and no trigger; a touch or pen pan; a hover open's silence; a modal dialog opening over a 'pageOrder' popover (jsdom covers the press rules).
  • Not covered by any test: the Android back gesture; a 'pageOrder' popover inside a shadow root (the watch is given the root, and the Escape scope and the announcement follow focus across open shadow roots; inside a closed root the document names only the host); a second input event dispatched from inside a handler, such as element.click(), after which a show() in the outer handler counts as opened from code.

Scope

Components: usePopover (tabBehavior, AR4), Popover (AR4 only), Tooltip, useTooltip, useKeyboardHint (no popover invoker, so neither disturbs a popover's place in the Tab order); internal: useFocusTrap, useLayer (invoker, outside watch), the shared gesture tracker (the input in hand, for AR4)

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project ui packages/core/src/Popover packages/core/src/Layer packages/core/src/hooks packages/core/src/PowerSearch packages/core/src/Dialog packages/core/src/DropdownMenu packages/core/src/BottomSheet packages/core/src/utils packages/core/src/DateInput packages/core/src/SideNav: 6,286 tests; 6,285 passed. One, PowerSearch.missingProps.test.tsx "names the prop and the fix", timed out at 30 s in this run on a loaded machine. It imports PowerSearch cold, and its file passes alone, 12 of 12. This PR does not touch PowerSearch
  • pnpm test:interaction PopoverTabBehavior.interaction.browser.spec.ts --project chromium, and the same spec in WebKit: 10 passed each
  • The stack's other interaction specs (PopoverAnchor 3, LayerFocusReturn 2, PopoverFocusReturn 2, LayerSamePress 10): all pass in Chromium; in WebKit all pass and one LayerSamePress test is skipped by the spec
  • At this head: packages/core/src Tooltip, Text, Button, InfoTip, Popover, Layer, hooks, DropdownMenu, Dialog, utils, Toolbar, TabList and SegmentedControl: 5,013 passed. The CLI search goldens and resolution-compat.test.mjs: 82 passed. The five interaction specs above: 27 passed in Chromium; 26 passed and one skipped in WebKit. Tooltip's own browser specs (packages/core/src/Tooltip/__tests__, Chromium): 42 passed. The wider unit run in the first line is from a head before the review fixes. The full --project ui suite ran before the rebase with the useTooltip change only: 26,866 tests; 26,861 passed, and the other five pass when their files run alone, with and without the change.
  • tsc --noEmit on Core, strict ESLint on the changed files, pnpm check:knowledge: clean
  • Local run of the CI jobs lint and typecheck: pass. The local runner skipped test-ui under CI's new deferral rule, so the unit command above stands in for it
  • pnpm exec vitest run packages/richtext (the link form sets isModal={false}): 846 passed
  • pnpm exec vitest run --project node scripts/: 5,313 passed; two tests that fetch from a remote host timed out with no network path
  • Not covered: Firefox

Changes since the last review

This PR is rebuilt. It implemented isModal: false as the switch for no Tab containment; spec:AST-116 DEC-11 (#13015) keeps isModal as released and adds tabBehavior.

  • The pass-through behavior is keyed on tabBehavior: 'pageOrder', on usePopover only.
  • isModal is back to its released meaning in the hook and in its docs.
  • Gone from this PR: every change to Popover.tsx, the non-modal sheet (with the BottomSheet Escape-scope context and its tests), the PowerSearch changes (closing its filter popover from the field) with their tests and browser spec, the LayerSamePress story change, and the two Non Modal Popover stories.
  • New: the Popover Tab Behavior stories (hook-based), the usePopover Tab behavior and modality suite, the type error and development warning for isModal: true with 'pageOrder', and two browser tests (a popover with isModal: false holds Tab; a 'pageOrder' popover stays open when another popover opens).
  • The trigger-or-anchor invoker applies to 'pageOrder' only. The earlier version passed a refined invoker for every popover, which would have sent Tab from a DateInput field into its open calendar.
  • A press in a modal dialog above a 'pageOrder' popover is left to that dialog. The earlier version closed the popover and kept the dialog open.
  • A press outside closes a 'pageOrder' popover through the layer's dismissal, so the click of that press does not open it again.
  • A hover open is the person's own, so a flyout that opens on hover is not announced.
  • A wrapper trigger passes its control as the invoker, with a browser test for it.
  • Two small notes from the review of fix(core): one focus return for Popover and DropdownMenu (popover presentation) and Dialog that never strands focus (AST-116 FR17–FR21, AR1) #11121 are taken here, in files this PR already changes: a stray comment line in usePopover.tsx, and focusReturn.ts uses isFocusLost where it had a second copy of it.
  • Correction. The previous head recorded a FR12 gap: for a trigger with a separate anchor, and said the same in the changeset, the two tabBehavior entries in usePopover.doc.mjs and the tabBehavior JSDoc. That was wrong. The story that failed runs in a 402 px test window where its five buttons do not fit, so their labels are cut. A Button with a cut label shows the label in a tooltip on keyboard focus, and that tooltip took the popover out of its trigger's Tab order. In a wide window the same story passes, and the plain story fails in a 300 px window. The gap line and the sentence then stated the limit as it was known, and the Separate Anchor story and its test came back, with a row wide enough that no label is cut. That round changed no shipped code: JSDoc, docs, the changeset, a story, a browser test and one record line.
  • After the latest review, which asked to land the useTooltip fix or to state the limit in full: this head lands the fix and states what is left. useTooltip and useKeyboardHint pass no invoker, with two unit tests and three browser tests on three new stories (Tooltip Trigger, Cut Label Trigger, Toolbar Trigger). FR12 gains one sentence. The earlier FR12 gap: line and limit sentence give way to a narrower one, for a layer that holds focus (a menu, a hover card), in the record, the changeset, the two tabBehavior doc entries and the JSDoc. AR4, the announcement's changeset and this description say "while the pointer is on its trigger" where they said "pointer hover", as the review suggested. A comment in layerHost.ts that said every layer passes its trigger as the invoker is corrected. The branch is rebased onto main.
  • The comment in useLayer.tsx above showPopover names the invoker, not the trigger, and the local is renamed to match.
  • Not taken here: the review's non-blocking note about a page with two copies of Core, where the older copy owns the gesture listeners and notes no input target, so a dialog popover a person opens without focus moving would announce. A fix that gives the target its own listeners costs about 40 to 55 B gzip on every page. It is left for a follow-up while this option's size is over the allowance.
  • Two changesets ship: a [feat] for tabBehavior, which names no behavior change for isModal, and the [fix] for the announcement.

Writing rubric results

Run over the changed record lines in spec:AST-116, family:overlay-dismissal, component:Popover and architecture:layer-runtime:

  • R1 narration: kept in FR22 only. Its second bullet says "It used to appear with no announcement", and its first bullet, which this PR only re-wraps, says "used to" and "no longer"; FR22 asks each named change for its old and new behavior.
  • R2 research in the record: none.
  • R3 evidence naming a change: none added; the verification row names a test file.
  • R4 rejected alternatives: none added.
  • R5 pull request or issue references: none added.
  • R6 ruled open questions still listing options: none.
  • R7 project status: only gap lines (FR3 gap:, FR12 gap:, AR4 gap: and the extended FR9 gap:), each stating an observable mismatch.
  • FR12's new sentence, AR4's wording and the FR12–FR16 verification row: nothing under R1 to R7.

First-load size (INV10)

pnpm size:pages --page popover=Popover,Button,Text, this PR's change in gzip bytes against the code before it:

docs form menu table popover
+163 +168 +737 +182 +776

The optional part is tabBehavior: 'pageOrder': its Escape scope, its outside-press watch with the pan rule, its invoker, the manual-popover switches, and its share of the shared layer and focus-trap hooks. Measured against this head with every one of those paths removed, a page that does not use it pays:

docs form menu table popover
+88 +75 +406 +103 +477

This second table was measured before the useTooltip and useKeyboardHint changes. Those are always on, so they are not part of the optional share; the first table includes them.

The menu and Popover pages are over INV10's 0.3 KB (307 B) for an unused optional feature. spec:AST-116 DEC-12 accepts that, and INV10 names the option as an entry under 0.5 KB. The docs, form and table figures are the option's share of the shared layer hook, which every page with a layer loads. architecture:component-import-boundaries notes that a local run can print gzip sizes a few tenths of a KB apart from CI's, and pnpm size:pages --unused-on holds 0.3 KB for every feature and knows no named entry. The rest of this PR's growth is always on: the announcement (AR4), which reads the input in hand from the shared gesture tracker.

@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 20, 2026 9:27pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 11, 2026
@astracat-bot

astracat-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 12:41 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision: current component:Popover DEC-9 and AR3 make every Popover hold Tab, modal or not, and this pull request changes isModal={false} on the strength of draft spec:AST-113 DEC-5 and FR12–FR16, including a non-modal sheet in place of DEC-8's modal sheet. The owner also needs to settle whether this change to released behavior ships as a patch [feat] (an accessibility fix under spec:AST-017 FR53) or as [breaking] in a declared minor (FR7, FR25). An engineering owner records the decision by commenting /approve-spec <full head SHA>; as an engineering owner, the author may do so.

Whatever the decision, these need fixing:

  • With the default hasLightDismiss, pressing Escape on another page control still closes a non-modal popover in Chromium and Firefox. When the shared stack skips the layer, the browser's own popover="auto" close request fires (usePopover.tsx:634, :665), although the docs, the changeset and family:overlay-dismissal FR3 say the popover stays open.
  • The docs and the changeset say Tab moves "from the anchor (else the trigger) into the popover and on to what follows the anchor". Without a separate anchor, Tab from the trigger skips the open popover in Chromium and Firefox, and in Chromium Tab from its last control returns to the trigger (Popover.doc.mjs:135, Popover.tsx:354-357, usePopover.tsx:309-311).
  • The presentation docs this pull request rewrites still say the sheet always closes on a tap outside. A non-modal sheet (hasScrim={false}, Popover.tsx:1147) has no backdrop and ignores that tap (Popover.doc.mjs:176, Popover.tsx:421-422, Popover.tsx:1133-1137).
  • component:Popover VG1 asks for real-browser evidence when focus or light-dismiss behavior changes, and the jsdom tests cannot see either failure above. Please add non-modal cases to packages/core/src/Popover/__tests__/PopoverKeyboard.interaction.browser.spec.ts: Tab from the trigger and from a separate anchor, and Escape on another control under the default hasLightDismiss.

Automated review (maintainer link)

Comment thread packages/core/src/hooks/useFocusTrap.ts Resolved
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/popover-return-focus branch from 244aa61 to 18cc3b1 Compare November 11, 2026 07:44
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/popover-is-modal branch from fd92d14 to cc68bb8 Compare November 11, 2026 07:44

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision: current component:Popover DEC-9 and AR3 make every Popover hold Tab, modal or not, and DEC-8 makes its sheet modal, while this pull request follows draft spec:AST-113 DEC-5 and FR12–FR16 for isModal={false}. The same decision needs to settle the release tier under spec:AST-017: an accessibility fix shipped as a patch [fix] (FR53), or a [breaking] change in a declared minor (FR7, FR25). An engineering owner records it by commenting /approve-spec <full head SHA> on this pull request; as an engineering owner, the author may do so.

Whatever the decision, these need fixing:

  • With the default hasLightDismiss, pressing Escape on another page control still closes a non-modal popover in Chromium and Firefox, because the browser's own popover="auto" close request fires when the shared stack skips the layer (usePopover.tsx:634, :665), although the docs and the changeset say it stays open.
  • The docs and the changeset say Tab moves "from the anchor (else the trigger) into the popover and on to what follows the anchor", but with no separate anchor, Tab from the trigger skips the open popover in Chromium and Firefox, and in Chromium Tab from its last control returns to the trigger (Popover.doc.mjs:135, Popover.tsx:355-357, usePopover.tsx:309-311).
  • The presentation docs still say every sheet is modal and closes on a tap outside, yet a non-modal sheet has no scrim and stays open when tapped above (Popover.doc.mjs:176, Popover.tsx:417-422, Popover.tsx:1133-1136).
  • Miss: a non-modal sheet closes on an Escape pressed on a page control behind it, because BottomSheet's own dismissal registration has no focus scope (Popover.tsx:1147, BottomSheet.tsx:892-895), contrary to "Escape closes it only while focus is inside it or on its anchor or trigger".
  • Miss: the changeset tags this change to released behavior [feat], which spec:AST-017 FR7 keeps for compatible capabilities, so it needs [fix] with its accessibility target (FR53) or [breaking] with a migration (FR7), whichever tier is decided.
  • component:Popover VG1 asks for real-browser evidence when focus or light-dismiss behavior changes, and the jsdom test at Popover.test.tsx:1960 passes the Escape case that fails in real engines, so please add a real-browser spec under packages/core/src/Popover/__tests__/ for Escape elsewhere under the default hasLightDismiss, and for Tab from a trigger and from a separate anchor.

Automated review (maintainer link)

Comment thread packages/core/src/Popover/Popover.tsx Resolved
Comment thread .changeset/popover-is-modal.md Resolved
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/popover-return-focus branch from 18cc3b1 to 923cd1e Compare November 11, 2026 09:29
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/popover-is-modal branch from cc68bb8 to abef85d Compare November 11, 2026 09:29

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision: current component:Popover DEC-9 and AR3 make every Popover hold Tab, modal or not, and DEC-8 makes its phone sheet modal, while this pull request intentionally changes that for isModal={false} on the strength of spec:AST-113 DEC-5 and FR12–FR16, which are still draft. An engineering owner needs to approve or reject that direction and rule whether the change to released isModal={false} behavior ships as a patch accessibility fix (spec:AST-017 FR53) or as [breaking] in a declared minor (FR7, FR25), by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. Whatever the ruling, these need changes before approval:

  • With the default hasLightDismiss, Escape pressed on another page control still closes a non-modal popover in Chromium and Firefox, because the native popover="auto" close request fires when the shared stack declines the press (usePopover.tsx:634, :665); keep a non-modal popover off native light dismiss and route its outside presses through the existing outside-press watch.
  • The docs, JSDoc and changeset say Tab moves "from the anchor (else the trigger) into the popover", but with no separate anchor Tab from the trigger skips the open popover in Chromium and Firefox (Popover.doc.mjs:135); make the trigger case match or narrow the sentence.
  • The presentation docs and the sheet comment still say every sheet is modal and closes on a tap outside, which a non-modal sheet with no scrim does not do (Popover.doc.mjs:176, Popover.tsx:417-422, :1133-1137); list the non-modal sheet's exits.
  • Miss: a non-modal sheet closes on an Escape pressed anywhere on the page, because BottomSheet's presence check has no focus scope (Popover.tsx:1147, BottomSheet.tsx:892-895); scope it like the anchored popover or document the sheet's rule.
  • Miss: the changeset tags a changed released behavior [feat], which spec:AST-017 FR7 reserves for compatible capabilities; retag it [fix] with its accessibility target or [breaking] with a migration, to match the owner's ruling.
  • component:Popover VG1 asks for real-browser evidence when focus or light-dismiss behavior changes, and the new jsdom test at Popover.test.tsx:1960 passes a case that fails in real browsers; add a real-browser spec under packages/core/src/Popover/__tests__/ for Escape elsewhere and Tab from the trigger and from a separate anchor.

Automated review (maintainer link)

@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/popover-is-modal branch from abef85d to 8872b22 Compare November 11, 2026 15:43
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/popover-return-focus branch from 923cd1e to 2ffbdf5 Compare November 11, 2026 15:43
@nynexman4464 nynexman4464 changed the title feat(Popover): isModal decides whether the popover holds Tab (AST-113 FR12–FR16) feat(Popover): isModal decides whether the popover holds Tab (AST-116 FR12–FR16) Nov 11, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision. Current component:Popover DEC-9 and AR3 make every Popover hold Tab, modal or not, and DEC-8 makes its phone sheet modal; this pull request intentionally changes that for isModal={false} on the strength of spec:AST-116 DEC-5 and FR12–FR16, which are still draft. An engineering owner needs to approve or reject that direction and rule whether the change to released isModal={false} behavior ships as a patch accessibility fix (spec:AST-017 FR53) or as [breaking] in a declared minor (FR7, FR25), by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. Whatever the ruling, these need changes before approval:

  • With the default hasLightDismiss, Escape pressed on another page control still closes a non-modal popover in Chromium and Firefox, because the native popover="auto" close request fires when the shared stack declines the press (usePopover.tsx:634, :665); keep a non-modal popover off native light dismiss and route its outside presses through the existing outside-press watch.
  • The docs, JSDoc and changeset say Tab moves "from the anchor (else the trigger) into the popover", but with no separate anchor Tab from the trigger skips the open popover in Chromium and Firefox (Popover.doc.mjs:135); make the trigger case match or narrow the sentence.
  • The presentation and onOutsidePress docs and the sheet comment still say every sheet is modal and closes on a tap outside, which a non-modal sheet with no scrim does not do (Popover.doc.mjs:176, Popover.tsx:269-270, :417-422, :1133-1137); list the non-modal sheet's exits.
  • Miss: a non-modal sheet closes on an Escape pressed anywhere on the page, because BottomSheet's presence check has no focus scope (Popover.tsx:1147, BottomSheet.tsx:892-895); scope it like the anchored popover or document the sheet's rule.
  • Miss: the changeset tags a changed released behavior [feat], which spec:AST-017 FR7 reserves for compatible capabilities; retag it [fix] with its accessibility target or [breaking] with a migration, to match the owner's ruling.
  • component:Popover VG1 asks for real-browser evidence when focus or light-dismiss behavior changes, and the new jsdom test at Popover.test.tsx:1960 passes a case that fails in real browsers; add a real-browser spec under packages/core/src/Popover/__tests__/ for Escape elsewhere and Tab from the trigger and from a separate anchor.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's spec decision, and eight blocking findings need fixing whatever that decision is.

Current component:Popover DEC-9 and AR3 make every Popover hold Tab, modal or not, and DEC-8 makes the phone sheet modal and always light-dismissing; this pull request intentionally replaces them for isModal={false} with draft spec:AST-116 DEC-5 and FR12–FR16, and the change to released behavior also needs a release-tier ruling under spec:AST-017 FR7, FR25 and FR53. An engineering owner records that decision by commenting /approve-spec <full head SHA> on the pull request; the author may do so as an engineering owner.

Blocking:

  • Escape pressed on another page control still closes a non-modal popover under the default hasLightDismiss in Chromium and Firefox, because native popover="auto" light dismiss answers the press the shared stack declines (usePopover.tsx:632, :663), so the docs and changeset overstate the Escape scope and family:overlay-dismissal FR3 is broken.
  • The docs, JSDoc and changeset say Tab moves from the trigger into the popover and on to what follows it, but Tab from the trigger skips the open popover in Chromium and Firefox, and Chromium sends Tab from its last control back to the trigger (Popover.doc.mjs:116, Popover.tsx:315, usePopover.tsx:310-312).
  • The presentation docs still say every sheet is a modal dialog that closes on a tap outside it, but a non-modal sheet has no scrim and stays open on a tap above it (Popover.doc.mjs:157, Popover.tsx:376-381, Popover.tsx:1075-1079).
  • A non-modal sheet closes on an Escape pressed on a page control behind it, against the documented focus-scoped Escape (Popover.tsx:1089, BottomSheet.tsx:892-895).
  • The changeset tags a changed released behavior [feat], which fits neither a patch [fix] naming its accessibility target (spec:AST-017 FR53) nor [breaking] with a migration in a declared minor (FR7).
  • Newly live check: usePopover.tsx:665 writes surfaceHolderRef.current during render, against architecture:react-component-runtime INV17, so let the focus trap answer the Escape scope from its own container, trigger and anchor and delete the holder ref.
  • Miss: a non-modal sheet opens with focus on its panel instead of its first control in Chromium, against component:Popover FR2 and the description's statement that focus entry is the same either way (Popover.tsx:1089).
  • The real-browser evidence component:Popover VG1 requires is missing, and the jsdom tests at Popover.test.tsx:1919 and :1960 claim browser results (the second is false in Chromium and Firefox), against spec:AST-020 FR6, so cover these cases in __tests__/PopoverKeyboard.interaction.browser.spec.ts instead.

Also owed before approval:

  • Newly live check: the change grows the shared usePopover and useFocusTrap modules, so architecture:component-import-boundaries INV10 asks for first-load gzip deltas, base against head, on the four reference pages.
Claims and files checked

Review mode: full; reason: rebase

  • Claim: the modal default still cycles Tab and marks a dialog popover aria-modal: verified (Popover.test.tsx:1898, :1945; Chromium, same on both trees).
  • Claim: isModal={false} holds nothing and Tab leaves in page order: verified (Chromium and Firefox leave the popover; Popover.test.tsx:1919).
  • Claim: Tab moves from the anchor or trigger into the popover and on to what follows it: false from the trigger (Chromium, Firefox); Chromium returns from the last control to the trigger.
  • Claim: Escape closes it only while focus is inside it or on its anchor or trigger: false under the default hasLightDismiss (Chromium, Firefox); true with hasLightDismiss={false}.
  • Claim: on a compact touch screen a non-modal popover presents a sheet with no scrim: verified (Popover.tsx:1089; phone capture).
  • Claim: before, isModal={false} removed only aria-modal and still kept Tab inside: verified (base wraps from the last control).
  • Claim: the change ships as a patch [feat]: false classification (spec:AST-017 FR7, FR53).
  • Claim: a Tab pressed outside is never pulled in: verified (Popover.test.tsx:1863, :1874; Chromium and Firefox).
  • Claim: focus entry and focus return are the same either way: false for the sheet (non-modal sheet focuses its panel); the anchored popover enters on its first control in both modes.
  • Claim: hasLightDismiss and onOutsidePress stay separate: verified (usePopover.tsx:597, :632 unchanged).
  • Claim: no new prop; isModal keeps its name, type and default: verified (built Core and theme surfaces unchanged).
  • Claim: PowerSearch's token editor is the only in-repo isModal: false caller and no story, template block or lab component sets it: verified (PowerSearch.tsx:792).
  • Claim: useFocusTrapInternal gains isContaining and isEscapeInScope, the latter reaching the dismissal stack's isPresent: verified (useFocusTrap.ts:591-597, :664).
  • Claim: the jsdom modality suite has ten tests and the presentation suite covers modal and non-modal sheets: verified (Popover.test.tsx:1825-1975, PopoverPresentation.test.tsx:479, :488; the Popover and focus-trap suites pass).
  • Claim: real-browser checks show Escape elsewhere leaves the coachmark open: holds only with hasLightDismiss={false}.
  • Claim: the engines differ after the last control (Chromium to the anchor, Firefox to the next control): consistent with Chromium returning to the trigger and Firefox moving on.
  • Claim: WebKit not yet checked: acknowledged; VG1 still needs it.
  • Claim: the full core suite passes, and tsc and eslint are clean: tsc and eslint clean on this head; the full suite was not rerun.
  • File .changeset/popover-is-modal.md: findings (tier, Tab and Escape claims).
  • File packages/core/src/Popover/Popover.doc.mjs: findings (Tab, Escape and sheet text).
  • File packages/core/src/Popover/Popover.test.tsx: finding (jsdom tests claim browser results).
  • File packages/core/src/Popover/Popover.tsx: findings (JSDoc, sheet docs, sheet Escape and focus entry).
  • File packages/core/src/Popover/PopoverPresentation.test.tsx: clear.
  • File packages/core/src/Popover/usePopover.doc.mjs: findings (Tab and Escape text).
  • File packages/core/src/Popover/usePopover.tsx: findings (Escape under native light dismiss, render-time ref write, JSDoc).
  • File packages/core/src/hooks/useFocusTrap.ts: clear apart from one non-blocking comment that restates the code.

Automated review (maintainer link)

Comment thread packages/core/src/Popover/Popover.tsx Resolved
Comment thread .changeset/popover-is-modal.md Resolved
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/popover-return-focus branch from c29b08f to 848deb7 Compare November 16, 2026 23:45
@nynexman4464
nynexman4464 force-pushed the nynexman4464/feat/popover-is-modal branch from c9e594e to 0a8c7b2 Compare November 16, 2026 23:45

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about the record changes this pull request makes beyond the current popover record, and two text fixes are needed whatever that decision is.

Owner decision. The pull request intentionally edits current records: AR4's new pointer-hover exception, FR22's second named change, the new FR12, FR9 and overlay-dismissal FR3 gap lines, the layer-runtime rule for a press in a modal dialog, and dropping Firefox from the browser-evidence line, plus the pen-pan rule, the unsupported change of tabBehavior while open, and the public TabBehavior type parameter, which no record states. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or names the part to change; the author may do so as an engineering owner.

Blocking

  • The changeset, both tabBehavior entries in usePopover.doc.mjs and the tabBehavior JSDoc say a 'pageOrder' popover with a trigger and a separate anchor keeps its DOM place, but in real Chromium and Firefox 151 it follows its trigger (Tab from the trigger reaches its first control, and Tab past its last control reaches the control after the trigger), so please drop that sentence; this replaces the wording the earlier review suggested.
  • Miss: the new FR12 gap: line in the AST-116 record states the same limitation for Chromium and WebKit, which the Chromium run contradicts and the code does not cause (it passes the trigger as the invoker, as FR12 asks), so please remove it, or limit it to WebKit with a WebKit run.

With real-Firefox page-order results now available, dropping Firefox from the browser-evidence line is not needed.

Claims and files checked

Review mode: full; reason: history

  • Claim: tabBehavior defaults to 'contain', today's Tab hold — verified (usePopover.tsx:555; the existing focus-region suite is unchanged and passes).
  • Claim: with 'pageOrder' the popover holds nothing and Tab moves through the page — verified (Popover.test.tsx; Chromium and Firefox runs of the Page Order and Wrapped Trigger stories).
  • Claim: the popover follows a trigger that is its anchor, or a focusable anchor when it has no trigger — verified for the trigger in Chromium and Firefox; the anchor case in jsdom only (PopoverAnchor.test.tsx invoker tests).
  • Claim: with a trigger and a separate anchor it keeps its DOM place — false (Chromium and Firefox put it after its trigger).
  • Claim: Escape closes it only while focus is inside it or on or inside its anchor or trigger, and it never carries aria-modal — verified (Popover.test.tsx; Escape on the next page control leaves it open and Escape on the trigger closes it in Chromium and Firefox).
  • Claim: isModal keeps its meaning and Tab stays inside whether it is true or false — verified (the Not Modal story wraps identically on base and head; modality tests).
  • Claim: a dialog popover opened from code, not by a press, key or hover on its trigger, that takes no focus announces its label politely, and a role-neutral popup does not — verified (PopoverAnnounce.test.tsx, PopoverAnnounceCount.test.tsx).
  • Claim: a press outside closes it with light dismiss on, a touch or pen pan does not, and a trigger press is left to the trigger — verified (PopoverOutsidePress.test.tsx, outsidePress.test.ts).
  • Claim: it stays open when another popover or a modal dialog opens without a press outside — verified in jsdom (a manual popover); the browser case is the author's run.
  • Claim: a press in a modal dialog above it is left to that dialog, and a backdrop press of the dialog holding it closes it — verified (PopoverOutsidePress.test.tsx).
  • Claim: hasEscapeDismiss: false turns its Escape off with light dismiss on — verified.
  • Claim: isModal: true with 'pageOrder' is a type error and a development warning — verified (core typecheck with the expected-error lines; warning test).
  • Claim: the press that closes it from a page toggle does not reopen it — verified (PopoverOutsidePress.test.tsx).
  • Claim: known gap, a trigger with a separate anchor keeps its DOM place in Chromium and WebKit — false for Chromium; WebKit was not run here.
  • Claim: the Popover component, its sheet, PowerSearch and the link form keep their behavior — verified (no change to those files; their suites pass).
  • Claim: focus return now uses the shared focus-lost check instead of a copy — verified (identical logic).
  • Claim: first-load sizes — the totals were measured at the previous head and shipped code has not changed since apart from a local rename; the unused-option share is the author's figure, under the named entry.
  • Claim: jsdom suites pass — verified (15 files, 525 tests); the browser spec passes 6 of 6 in Chromium and WebKit — the author's result, with its Chromium orders reproduced here.
  • Claim: the verification rows name test files that exist — verified.
  • Files: .changeset/popover-tab-behavior.md and usePopover.doc.mjs (first blocking finding); usePopover.tsx (JSDoc in the first finding, otherwise clear); the AST-116 record (second finding and owner decision); overlay-dismissal.md, layer-runtime.md and Popover.spec.md (owner decision; Popover's new gap line is clear).
  • Files: .changeset/popover-announce.md, PopoverTabBehavior.stories.tsx, gestureCounter.ts (one non-blocking note), outsidePanClaim.ts, outsidePress.ts, useLayer.tsx, useFocusTrap.ts (one non-blocking comment note), focusReturn.ts — clear.
  • Files: gestureCounter.test.ts, outsidePress.test.ts, useLayer.test.tsx, Popover.test.tsx, PopoverAnchor.test.tsx, PopoverAnnounce.test.tsx, PopoverAnnounceCount.test.tsx, PopoverOutsidePress.test.tsx, PopoverPresentation.test.tsx, PopoverTabBehavior.interaction.browser.spec.ts — clear.

Automated review (maintainer link)

Comment thread .changeset/popover-tab-behavior.md Resolved

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about the record changes this pull request makes beyond the current popover record, and one fix is needed whatever that decision is.

Owner decision. This pull request intentionally updates current records, so approval needs an engineering owner to approve those updates: AR4's pointer-hover exception, FR22's second named change, the new FR12 (tooltip), FR9 and overlay-dismissal FR3 gap lines, the layer-runtime rule for a press in a modal dialog, and dropping Firefox from the browser-evidence line, plus the pen-pan rule, the unsupported change of tabBehavior while open and the public TabBehavior type parameter, which no record states. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or names the part to change; the author may do so as an engineering owner.

Blocking

  • Once a tooltip has shown from a 'pageOrder' popover's trigger, Tab through the page never reaches the open popover's controls in real Chromium and Firefox 151 (it goes Before, Show tip, After), and in Chromium Shift+Tab never reaches them either, so please land the useTooltip fix or say so in the new FR12 gap: line, the changeset, both tabBehavior doc entries and the JSDoc, and correct the description, which says the controls stay reachable at their DOM place.

The separate-anchor wording and gap line from the last review are fixed, and the new Separate Anchor story follows its trigger in Chromium and Firefox.

Claims and files checked

Review mode: full; reason: history

  • Claim: tabBehavior defaults to 'contain', today's Tab hold — verified (the default in usePopover.tsx; the existing focus-region suite is unchanged and passes).
  • Claim: with 'pageOrder' the popover holds nothing and Tab moves through the page — verified (Popover.test.tsx; Chromium and Firefox runs of the Page Order story).
  • Claim: its controls come after its trigger, or after a focusable anchor when it has no trigger — verified for a trigger and for a trigger with a separate anchor in Chromium and Firefox; the anchor-only case in jsdom (PopoverAnchor.test.tsx).
  • Claim: after a tooltip has shown from the trigger, Tab from the trigger does not enter the popover — verified, but incomplete: forward Tab then never reaches the popover in Chromium and Firefox, and in Chromium Shift+Tab never does either.
  • Claim (description): after a tooltip, the popover's controls stay reachable at its DOM place — false (Chromium never reaches them by Tab or Shift+Tab; Firefox only by Shift+Tab from the control after the trigger).
  • Claim (description): after a tooltip, Shift+Tab out of the popover skips the trigger in Chromium — verified (Firefox does not skip it).
  • Claim: Escape closes it only while focus is inside it or on or inside its anchor or trigger, and it never carries aria-modal — verified (Popover.test.tsx; Escape on the trigger closes it in Chromium).
  • Claim: isModal keeps its meaning and Tab stays inside whether it is true or false — verified (the Not Modal story behaves identically on base and head; modality tests).
  • Claim: a dialog popover opened from code, not by a press, key or hover on its trigger, that takes no focus announces its label politely, and a role-neutral popup does not — verified (PopoverAnnounce.test.tsx, PopoverAnnounceCount.test.tsx).
  • Claim: a press outside closes it with light dismiss on, a touch or pen pan does not, and a trigger press is left to the trigger — verified (PopoverOutsidePress.test.tsx, outsidePress.test.ts).
  • Claim: it stays open when another popover or a modal dialog opens without a press outside — verified in jsdom (a manual popover); the browser case is the author's run.
  • Claim: a press in a modal dialog above it is left to that dialog, and a backdrop press of the dialog holding it closes it — verified (PopoverOutsidePress.test.tsx).
  • Claim: hasEscapeDismiss: false turns its Escape off with light dismiss on — verified.
  • Claim: isModal: true with 'pageOrder' is a type error and a development warning — verified (core typecheck with the expected-error lines; warning test).
  • Claim: the press that closes it from a page toggle does not reopen it — verified (PopoverOutsidePress.test.tsx).
  • Claim: the invoker is the trigger, the control inside a wrapper trigger, or a focusable anchor, and a 'contain' popover keeps its invoker — verified (PopoverAnchor.test.tsx).
  • Claim: the Popover component, its sheet, PowerSearch and the link form keep their behavior — verified (no change to those files; their suites pass).
  • Claim: focus return uses the shared focus-lost check instead of a copy — verified (identical logic).
  • Claim: first-load sizes — the author's measurements, under the option's named size entry; shipped code has changed only in comments and a local name since.
  • Claim: the unit suites and typecheck pass — verified (41 files, 1,487 tests); the browser spec passes 7 of 7 in Chromium and WebKit — the author's result, with its Chromium orders reproduced here.
  • Claim: the verification rows name test files that exist — verified.
  • Files: the AST-116 record, .changeset/popover-tab-behavior.md, usePopover.doc.mjs (blocking finding; the record also carries the owner decision); usePopover.tsx (JSDoc in the blocking finding, one non-blocking note).
  • Files: overlay-dismissal.md, layer-runtime.md (owner decision); Popover.spec.md — clear.
  • Files: .changeset/popover-announce.md, gestureCounter.ts, useFocusTrap.ts — one non-blocking note each.
  • Files: PopoverTabBehavior.stories.tsx, outsidePanClaim.ts, outsidePress.ts, useLayer.tsx, focusReturn.ts — clear.
  • Files: gestureCounter.test.ts, outsidePress.test.ts, useLayer.test.tsx, Popover.test.tsx, PopoverAnchor.test.tsx, PopoverAnnounce.test.tsx, PopoverAnnounceCount.test.tsx, PopoverOutsidePress.test.tsx, PopoverPresentation.test.tsx, PopoverTabBehavior.interaction.browser.spec.ts — clear.

Automated review (maintainer link)

Comment thread .changeset/popover-tab-behavior.md Resolved

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about the record changes this pull request makes beyond the current popover anchoring record; no code fix is needed at this head.

An engineering owner, the author included, records the decision by commenting /approve-spec <full head SHA> on this pull request, or names the part to change. What must be settled:

  • the announcement exception for a popover that opens while the pointer is on its trigger, and naming the announcement as a second released change shipped as a patch fix;
  • tooltips and the keyboard hint opening with no popover invoker, the new sentence that they take no invoker place, and the new gap for a menu or hover card on the same trigger;
  • the overlay-dismissal gap for platform close requests (such as the Android back gesture) on a page-order popover, the extended same-press gap, and the layer-runtime rule that leaves a press in an unrelated modal dialog to that dialog;
  • dropping Firefox from the browser evidence line, though Firefox runs match Chromium;
  • the pen-pan and change-while-open behaviors, and the new TabBehavior type parameter on usePopover.

The tooltip and cut-label Tab-order problem from the last review is fixed: in Chromium and Firefox, Tab from the trigger enters the open popover and every control stays reachable.

Claims and files checked

Review mode: full; reason: history

Claims:

  • Release note: the default keeps Tab cycling inside the popover. Verified: the default is the containing behavior and the released focus-region suite passes unchanged.
  • Release note: with page order, Tab moves through the page. Verified in Chromium and Firefox: the third Tab from the tip's first control reaches the control after the trigger.
  • Release note: the popover's controls come after its trigger, or after a focusable anchor when there is no trigger. Verified: the invoker choice in usePopover.tsx and the anchor tests.
  • Release note: a tooltip or the keyboard hint on the trigger no longer disturbs that place. Verified for a tooltip and a cut label in Chromium and Firefox; the hint by its unit test and the pull request's browser test.
  • Release note: when a menu or hover card from the same trigger or anchor closes, the popover leaves the Tab order until it reopens. Verified with a hover card in Chromium.
  • Release note: Escape closes it only while focus is inside it or on or inside its trigger or anchor, and it never carries aria-modal. Verified by the Tab behavior and modality tests.
  • Release note: isModal keeps its meaning and Tab stays inside either way. Verified by the Not Modal story in Chromium and Firefox and the modality tests.
  • Release note: a dialog popover that code opens without moving focus announces its label politely, while opens from a press, a key or with the pointer on the trigger, and role-neutral popups, stay silent. Verified by the two announcement test files.
  • Description: isModal true with page order is a type error and a development warning. Verified: the Core typecheck passes with the expected-error line, and the warning test passes.
  • Description: the Popover component, its sheet, PowerSearch and the link form keep their behavior. Verified: none of their files change, and the sheet test passes for both isModal values.
  • Description: a press outside closes the popover through the layer's own dismissal, so the click of that press does not reopen it, and a press in a modal dialog above it is left to that dialog. Verified by the outside-press tests and the watch code.
  • Description: a tooltip's position, description link and hover, focus and Escape behavior are unchanged. Verified: the Tooltip suites pass and the position uses an explicit anchor name.
  • Description: the focus-return cleanup removes a duplicate helper. Verified: the shared helper has the same two conditions.
  • Description: first-load sizes and the unused-option share. Not re-measured; the figures sit within the record's 0.5 KB named entry.
  • Description: the touched suites and typecheck pass. Verified for the touched and neighbouring suites and the Core typecheck; the WebKit runs are the author's.

Files:

  • .changeset/popover-announce.md: clear: matches the announcement tests
  • .changeset/popover-tab-behavior.md: clear: every sentence checked against the code, tests and browser runs
  • apps/storybook/stories/PopoverTabBehavior.stories.tsx: clear
  • docs/architecture/layer-runtime.md: owner decision: the modal-dialog press rule
  • docs/families/overlay-dismissal.md: owner decision: the new platform close request gap
  • docs/specs/AST-116-popover-anchoring/spec.md: owner decision: announcement exception, second released change, tooltip sentence and new gap, extended same-press gap, Firefox evidence line
  • docs/specs/components/Popover/Popover.spec.md: clear: follows the popover anchoring record
  • packages/core/src/Layer/gestureCounter.test.ts: clear
  • packages/core/src/Layer/gestureCounter.ts: non-blocking note: pages with an older Core copy never record the input target
  • packages/core/src/Layer/layerHost.ts: clear
  • packages/core/src/Layer/outsidePanClaim.ts: clear
  • packages/core/src/Layer/outsidePress.test.ts: clear
  • packages/core/src/Layer/outsidePress.ts: clear
  • packages/core/src/Layer/useLayer.test.tsx: clear
  • packages/core/src/Layer/useLayer.tsx: clear
  • packages/core/src/Popover/Popover.test.tsx: clear
  • packages/core/src/Popover/PopoverAnchor.test.tsx: clear
  • packages/core/src/Popover/PopoverAnnounce.test.tsx: clear
  • packages/core/src/Popover/PopoverAnnounceCount.test.tsx: clear
  • packages/core/src/Popover/PopoverOutsidePress.test.tsx: clear
  • packages/core/src/Popover/PopoverPresentation.test.tsx: clear
  • packages/core/src/Popover/__tests__/PopoverTabBehavior.interaction.browser.spec.ts: clear
  • packages/core/src/Popover/usePopover.doc.mjs: clear
  • packages/core/src/Popover/usePopover.tsx: clear; the new type parameter is an owner decision
  • packages/core/src/Tooltip/Tooltip.test.tsx: clear
  • packages/core/src/Tooltip/useTooltip.tsx: clear
  • packages/core/src/hooks/useFocusTrap.ts: non-blocking note: one comment restates the next line
  • packages/core/src/hooks/useKeyboardHint.test.tsx: clear
  • packages/core/src/hooks/useKeyboardHint.tsx: clear
  • packages/core/src/utils/focusReturn.ts: clear: the removed helper is identical to the shared one

Automated review (maintainer link)

@nynexman4464

Copy link
Copy Markdown
Contributor Author

/approve-spec 9a0e10c

@nynexman4464
nynexman4464 marked this pull request as ready for review November 20, 2026 23:56
@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 20, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the heavy CI jobs (build, unit tests and docsite tests) have not finished on this head yet; they started once this review passed and must pass before merge.

An engineering owner approved, at this head, the record changes this pull request makes beyond the current popover anchoring record, so no decision is pending and no code fix is needed.

Two non-blocking notes stay open on their lines: on a page that also loads an older copy of Core, every popover open counts as an open from code, so a dialog popover a person opens with auto focus off announces its label; and one focus-trap comment restates the next line.

Claims and files checked

Review mode: same-head; reason: none

Claims:

  • Release note: the default keeps Tab and Shift+Tab cycling inside the open popover. Verified: the default is the containing behavior (the trap's containment stays on) and the released focus-region suite has no changed line.
  • Release note: with page order the popover holds nothing and Tab moves through the page. Verified by the Tab-leaves test and the Chromium and Firefox walks.
  • Release note: the popover's controls come after its trigger, or after a focusable anchor when it has no trigger. Verified: the invoker choice applies only to page order, with the anchor tests for each case.
  • Release note: a tooltip or the keyboard hint on the trigger no longer disturbs that place, since neither registers an invoker. Verified: both pass no invoker, with unit tests and the tooltip, cut-label and toolbar browser tests.
  • Release note: when a menu or hover card from the same trigger or anchor closes, the popover leaves the Tab order until it reopens. Verified with a hover card in Chromium.
  • Release note: Escape closes it only while focus is inside it or on or inside its trigger or anchor, and it never carries aria-modal. Verified by the scope check and the Tab behavior and modality tests.
  • Release note: isModal keeps its meaning and Tab stays inside either way. Verified by the Not Modal browser test and the modality tests.
  • Release note: a dialog popover that code opens without moving focus announces its label politely; opens from a press, a key or with the pointer on the trigger, and role-neutral popups, stay silent. Verified by the two announcement test files.
  • Description: isModal true with page order is a type error and a development warning, and an unknown option is still an error. Verified: the expected-error lines compile in the passing typecheck job, and the warning test passes.
  • Description: a press outside closes the popover only with light dismiss on, a touch or pen pan is not a press, a press on the trigger is left to the trigger, and a press in a modal dialog above it is left to that dialog. Verified by the press-watch code and the outside-press tests.
  • Description: the popover stays open when another popover or a modal dialog opens without a press outside. Verified: it is a manual popover, outside the browser's auto stack, with a browser test for another popover.
  • Description: hasEscapeDismiss false turns its Escape off even with light dismiss on. Verified by the Escape handler condition and its test.
  • Description: the press that closes the popover does not reopen it at its click. Verified: the layer's dismissal records the gesture, with a jsdom and a browser test.
  • Description: the Popover component, its sheet, PowerSearch and the link form keep their behavior. Verified: none of their files change, and the sheet test passes for both isModal values.
  • Description: tooltips keep their position, description link and hover, focus and Escape behavior; the hint keeps its position and dismissal. Verified: only the invoker option is added to each.
  • Description: a date field passes its whole field as the trigger, so its calendar keeps its Tab path and is not announced for a press in the field. Verified in the date input source.
  • Description: the focus-return cleanup removes a duplicate helper. Verified: the shared helper has the same two conditions.
  • Description: the record changes listed. Verified against the record diffs.
  • Description: first-load sizes and the unused-option share. Not re-measured; the figures sit within the record's 0.5 KB named entry.
  • Description: the test runs. Lint, typecheck and the smoke test pass in CI at this head; the unit, browser and size runs are the author's, and heavy CI is still running.

Files:

  • .changeset/popover-announce.md: clear: matches the announcement code and tests
  • .changeset/popover-tab-behavior.md: clear: every sentence checked against the code, tests and browser runs
  • apps/storybook/stories/PopoverTabBehavior.stories.tsx: clear
  • docs/architecture/layer-runtime.md: clear: owner-approved at this head
  • docs/families/overlay-dismissal.md: clear: owner-approved at this head
  • docs/specs/AST-116-popover-anchoring/spec.md: clear: owner-approved at this head
  • docs/specs/components/Popover/Popover.spec.md: clear: follows the popover anchoring record
  • packages/core/src/Layer/gestureCounter.test.ts: clear
  • packages/core/src/Layer/gestureCounter.ts: non-blocking note: pages with an older Core copy never record the input target
  • packages/core/src/Layer/layerHost.ts: clear
  • packages/core/src/Layer/outsidePanClaim.ts: clear
  • packages/core/src/Layer/outsidePress.test.ts: clear
  • packages/core/src/Layer/outsidePress.ts: clear
  • packages/core/src/Layer/useLayer.test.tsx: clear
  • packages/core/src/Layer/useLayer.tsx: clear
  • packages/core/src/Popover/Popover.test.tsx: clear
  • packages/core/src/Popover/PopoverAnchor.test.tsx: clear
  • packages/core/src/Popover/PopoverAnnounce.test.tsx: clear
  • packages/core/src/Popover/PopoverAnnounceCount.test.tsx: clear
  • packages/core/src/Popover/PopoverOutsidePress.test.tsx: clear
  • packages/core/src/Popover/PopoverPresentation.test.tsx: clear
  • packages/core/src/Popover/__tests__/PopoverTabBehavior.interaction.browser.spec.ts: clear
  • packages/core/src/Popover/usePopover.doc.mjs: clear
  • packages/core/src/Popover/usePopover.tsx: clear
  • packages/core/src/Tooltip/Tooltip.test.tsx: clear
  • packages/core/src/Tooltip/useTooltip.tsx: clear
  • packages/core/src/hooks/useFocusTrap.ts: non-blocking note: one comment restates the next line
  • packages/core/src/hooks/useKeyboardHint.test.tsx: clear
  • packages/core/src/hooks/useKeyboardHint.tsx: clear
  • packages/core/src/utils/focusReturn.ts: clear: the removed helper is identical to the shared one

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 9a0e10c8 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant