Repository navigation
feat(usePopover): tabBehavior lets Tab pass through a popover (spec:AST-116 FR12–FR15, AR4) - #11156
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
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 ownpopover="auto"close request fires (usePopover.tsx:634,:665), although the docs, the changeset andfamily:overlay-dismissalFR3 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
presentationdocs 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:PopoverVG1 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 topackages/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 defaulthasLightDismiss.
244aa61 to
18cc3b1
Compare
fd92d14 to
cc68bb8
Compare
There was a problem hiding this comment.
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 ownpopover="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
presentationdocs 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], whichspec:AST-017FR7 keeps for compatible capabilities, so it needs[fix]with its accessibility target (FR53) or[breaking]with a migration (FR7), whichever tier is decided. component:PopoverVG1 asks for real-browser evidence when focus or light-dismiss behavior changes, and the jsdom test atPopover.test.tsx:1960passes the Escape case that fails in real engines, so please add a real-browser spec underpackages/core/src/Popover/__tests__/for Escape elsewhere under the defaulthasLightDismiss, and for Tab from a trigger and from a separate anchor.
18cc3b1 to
923cd1e
Compare
cc68bb8 to
abef85d
Compare
There was a problem hiding this comment.
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 nativepopover="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
anchorTab 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
presentationdocs 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], whichspec:AST-017FR7 reserves for compatible capabilities; retag it[fix]with its accessibility target or[breaking]with a migration, to match the owner's ruling. component:PopoverVG1 asks for real-browser evidence when focus or light-dismiss behavior changes, and the new jsdom test atPopover.test.tsx:1960passes a case that fails in real browsers; add a real-browser spec underpackages/core/src/Popover/__tests__/for Escape elsewhere and Tab from the trigger and from a separate anchor.
abef85d to
8872b22
Compare
923cd1e to
2ffbdf5
Compare
There was a problem hiding this comment.
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 nativepopover="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
anchorTab 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
presentationandonOutsidePressdocs 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], whichspec:AST-017FR7 reserves for compatible capabilities; retag it[fix]with its accessibility target or[breaking]with a migration, to match the owner's ruling. component:PopoverVG1 asks for real-browser evidence when focus or light-dismiss behavior changes, and the new jsdom test atPopover.test.tsx:1960passes a case that fails in real browsers; add a real-browser spec underpackages/core/src/Popover/__tests__/for Escape elsewhere and Tab from the trigger and from a separate anchor.
2ffbdf5 to
c29b08f
Compare
8872b22 to
c9e594e
Compare
There was a problem hiding this comment.
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
hasLightDismissin Chromium and Firefox, because nativepopover="auto"light dismiss answers the press the shared stack declines (usePopover.tsx:632,:663), so the docs and changeset overstate the Escape scope andfamily:overlay-dismissalFR3 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
presentationdocs 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-017FR53) nor[breaking]with a migration in a declared minor (FR7). - Newly live check:
usePopover.tsx:665writessurfaceHolderRef.currentduring render, againstarchitecture:react-component-runtimeINV17, 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:PopoverFR2 and the description's statement that focus entry is the same either way (Popover.tsx:1089). - The real-browser evidence
component:PopoverVG1 requires is missing, and the jsdom tests atPopover.test.tsx:1919and:1960claim browser results (the second is false in Chromium and Firefox), againstspec:AST-020FR6, so cover these cases in__tests__/PopoverKeyboard.interaction.browser.spec.tsinstead.
Also owed before approval:
- Newly live check: the change grows the shared
usePopoveranduseFocusTrapmodules, soarchitecture:component-import-boundariesINV10 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 withhasLightDismiss={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 onlyaria-modaland still kept Tab inside: verified (base wraps from the last control). - Claim: the change ships as a patch
[feat]: false classification (spec:AST-017FR7, 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:
hasLightDismissandonOutsidePressstay separate: verified (usePopover.tsx:597,:632unchanged). - Claim: no new prop;
isModalkeeps its name, type and default: verified (built Core and theme surfaces unchanged). - Claim: PowerSearch's token editor is the only in-repo
isModal: falsecaller and no story, template block or lab component sets it: verified (PowerSearch.tsx:792). - Claim:
useFocusTrapInternalgainsisContainingandisEscapeInScope, the latter reaching the dismissal stack'sisPresent: 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.
c29b08f to
848deb7
Compare
c9e594e to
0a8c7b2
Compare
8c84032 to
90732d1
Compare
There was a problem hiding this comment.
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
tabBehaviorentries inusePopover.doc.mjsand thetabBehaviorJSDoc 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:
tabBehaviordefaults 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.tsxinvoker 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:
isModalkeeps 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: falseturns its Escape off with light dismiss on — verified. - Claim:
isModal: truewith'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.mdandusePopover.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.mdandPopover.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.
90732d1 to
07f2c1b
Compare
There was a problem hiding this comment.
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 theuseTooltipfix or say so in the newFR12 gap:line, the changeset, bothtabBehaviordoc 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:
tabBehaviordefaults to'contain', today's Tab hold — verified (the default inusePopover.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:
isModalkeeps 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: falseturns its Escape off with light dismiss on — verified. - Claim:
isModal: truewith'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.
07f2c1b to
9a0e10c
Compare
There was a problem hiding this comment.
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
TabBehaviortype parameter onusePopover.
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 runsapps/storybook/stories/PopoverTabBehavior.stories.tsx: cleardocs/architecture/layer-runtime.md: owner decision: the modal-dialog press ruledocs/families/overlay-dismissal.md: owner decision: the new platform close request gapdocs/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 linedocs/specs/components/Popover/Popover.spec.md: clear: follows the popover anchoring recordpackages/core/src/Layer/gestureCounter.test.ts: clearpackages/core/src/Layer/gestureCounter.ts: non-blocking note: pages with an older Core copy never record the input targetpackages/core/src/Layer/layerHost.ts: clearpackages/core/src/Layer/outsidePanClaim.ts: clearpackages/core/src/Layer/outsidePress.test.ts: clearpackages/core/src/Layer/outsidePress.ts: clearpackages/core/src/Layer/useLayer.test.tsx: clearpackages/core/src/Layer/useLayer.tsx: clearpackages/core/src/Popover/Popover.test.tsx: clearpackages/core/src/Popover/PopoverAnchor.test.tsx: clearpackages/core/src/Popover/PopoverAnnounce.test.tsx: clearpackages/core/src/Popover/PopoverAnnounceCount.test.tsx: clearpackages/core/src/Popover/PopoverOutsidePress.test.tsx: clearpackages/core/src/Popover/PopoverPresentation.test.tsx: clearpackages/core/src/Popover/__tests__/PopoverTabBehavior.interaction.browser.spec.ts: clearpackages/core/src/Popover/usePopover.doc.mjs: clearpackages/core/src/Popover/usePopover.tsx: clear; the new type parameter is an owner decisionpackages/core/src/Tooltip/Tooltip.test.tsx: clearpackages/core/src/Tooltip/useTooltip.tsx: clearpackages/core/src/hooks/useFocusTrap.ts: non-blocking note: one comment restates the next linepackages/core/src/hooks/useKeyboardHint.test.tsx: clearpackages/core/src/hooks/useKeyboardHint.tsx: clearpackages/core/src/utils/focusReturn.ts: clear: the removed helper is identical to the shared one
|
/approve-spec 9a0e10c |
There was a problem hiding this comment.
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 runsapps/storybook/stories/PopoverTabBehavior.stories.tsx: cleardocs/architecture/layer-runtime.md: clear: owner-approved at this headdocs/families/overlay-dismissal.md: clear: owner-approved at this headdocs/specs/AST-116-popover-anchoring/spec.md: clear: owner-approved at this headdocs/specs/components/Popover/Popover.spec.md: clear: follows the popover anchoring recordpackages/core/src/Layer/gestureCounter.test.ts: clearpackages/core/src/Layer/gestureCounter.ts: non-blocking note: pages with an older Core copy never record the input targetpackages/core/src/Layer/layerHost.ts: clearpackages/core/src/Layer/outsidePanClaim.ts: clearpackages/core/src/Layer/outsidePress.test.ts: clearpackages/core/src/Layer/outsidePress.ts: clearpackages/core/src/Layer/useLayer.test.tsx: clearpackages/core/src/Layer/useLayer.tsx: clearpackages/core/src/Popover/Popover.test.tsx: clearpackages/core/src/Popover/PopoverAnchor.test.tsx: clearpackages/core/src/Popover/PopoverAnnounce.test.tsx: clearpackages/core/src/Popover/PopoverAnnounceCount.test.tsx: clearpackages/core/src/Popover/PopoverOutsidePress.test.tsx: clearpackages/core/src/Popover/PopoverPresentation.test.tsx: clearpackages/core/src/Popover/__tests__/PopoverTabBehavior.interaction.browser.spec.ts: clearpackages/core/src/Popover/usePopover.doc.mjs: clearpackages/core/src/Popover/usePopover.tsx: clearpackages/core/src/Tooltip/Tooltip.test.tsx: clearpackages/core/src/Tooltip/useTooltip.tsx: clearpackages/core/src/hooks/useFocusTrap.ts: non-blocking note: one comment restates the next linepackages/core/src/hooks/useKeyboardHint.test.tsx: clearpackages/core/src/hooks/useKeyboardHint.tsx: clearpackages/core/src/utils/focusReturn.ts: clear: the removed helper is identical to the shared one
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 droparia-modaland keeps Tab inside.Problem and solution fit
usePopovertakestabBehavior(spec:AST-116FR12–FR15, DEC-11).'contain'(default, the released behavior): Tab and Shift+Tab cycle inside the open popover, whateverisModalsays.'pageOrder':aria-modal.isModal: truewith it is a type error and a development warning; withisModalunset it is not modal.hasLightDismissis on. A touch pan outside is a gesture, not a press. A press on its trigger is left to the trigger.hasEscapeDismiss: falseturns its Escape off even with light dismiss on.isModalis unchanged: it setsaria-modalon a dialog popover and nothing else.tabBehavioris 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 onmain.Current specification
spec:AST-116FR12–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:FR12 gap:,FR15 gap:andAR4 gap:inspec:AST-116;component:Popover'sAR3 gap:; andfamily:overlay-dismissal'sFR2 and FR3 gap:line.family:overlay-dismissal:FR3 gap:a platform close request, such as the Android back gesture, does not reach a'pageOrder'popover.spec:AST-116: "A tooltip and the keyboard hint take no invoker place, so neither takes the popover's."FR12 gap:line inspec: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 gainsTooltip/useTooltip.tsxandhooks/useKeyboardHint.tsx, and its Current-state impact gains one line for them.component:Popover:AR4 gap:for a sheet's focus return, whichspec:AST-116'sFR16 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 ashow()in that press.main.Popover.test.tsx,PopoverOutsidePress.test.tsx,PopoverAnchor.test.tsx,PopoverPresentation.test.tsx,Tooltip.test.tsxanduseKeyboardHint.test.tsx; FR9 addsPopoverOutsidePress.test.tsx; AR2–AR4 namesPopoverAnchor.test.tsx, the two focus-return suites, andPopoverAnnounce.test.tsxwithPopoverAnnounceCount.test.tsx. The AR2–AR4 row named aPopover.test.tsxaccessibility suite that does not exist.component:Popover's "Released default preserved" line follows.architecture:layer-runtimenames a'pageOrder'popover in two places: its list of outside-interaction paths, and the line that says which layers useLayer/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-specat this head:FR3 gap:line, the newAR4 gap:line incomponent:Popover, and theFR9 gap:sentence;FR12 gap:line;architecture:layer-runtimelines, with the modal-dialog rule;usePopover(below), which no record names;tabBehaviorwhile the popover is open is not supported (the option's doc says so).Public delta and caller burden
tabBehavior?: 'contain' | 'pageOrder'onUsePopoverOptions, default'contain'.usePopover's signature gains one type parameter,TabBehavior, inferred from thetabBehavioroption. It exists to rejectisModal: truewithtabBehavior: 'pageOrder'at the call. A value typedUsePopoverOptionsis still accepted, an unknown option is still an error, andUsePopoverOptionsstays an interface.Tooltip,useTooltipanduseKeyboardHint(the hint a Toolbar, TabList or SegmentedControl shows) no longer pass their trigger to the browser as the popover invoker (showPopover'ssource). A tooltip's position, itsaria-describedbylink, 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.isModal, Tab containment, Escape, light dismiss and the popover's place in the focus order are unchanged for every released caller. Callers that setisModal: falsein this repo (PowerSearch's filter popover, the rich text link form, Popover's own tests, theLayerSamePressstory) are untouched. One documented behavior changes, as an accessibility fix with its own changeset: the announcement (AR4).useFocusTrapInternalgainsisContainingandisEscapeInScope; the latter reaches the shared dismissal stack'sisPresent. useLayer's owner watch for pointers outside the open layer (watchesOutside, waswatchesOutsidePans) also runs for a layer without the browser's light dismiss, and carries the'pageOrder'press watch. The layer hands that watch adismiss, which closes the layer and absorbs ashow()from the same press, as the browser's light dismiss does.Layer/outsidePress.tsgainsignoresPans, andLayer/outsidePanClaim.tsgainswatchOutsidePresses, the press watch a'pageOrder'popover gives its layer.utils/focusReturn.tsexportsfocusableWithinfor the invoker. The deprecatedhasActiveFocusTrapEscape()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 takesgetInvoker, the element whose place in the focus order the open layer takes.:hoveranswer. The other Core compositions were not read for this.Design and alternatives
Decided in
spec:AST-116DEC-11 (#13015). Rejected there:isModal: falseas the switch for no containment, which changes every released caller of it; one three-value modality input in place ofisModal; and ahasFocusTrapboolean, wherearchitecture:public-component-apiINV2 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 onmain, 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 ashow()ortoggle()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
Popover.test.tsx, theusePopover Tab behavior and modalitysuite, 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;isModaltrueandfalse;'pageOrder'popover for the next page control;'pageOrder'popover while focus is on its separate anchor, and passes it while focus is elsewhere;usePopoverdoes not have fails to compile;isModal: falsecloses on an Escape pressed elsewhere;aria-modalis present only on a modal'contain'dialog popover;isModal: truewith'pageOrder'fails to compile (@ts-expect-erroron that line), warns in development and carries noaria-modal;hasEscapeDismiss: falseturns Escape off for a'pageOrder'popover with light dismiss on;aria-modal, wraps Tab with'contain'and lets it leave with'pageOrder'(FR14);'pageOrder'popover, and one on its trigger closes it.Popover focus region (DEC-9)inPopover.test.tsxhas no changed line and passes.'pageOrder'popover (PopoverOutsidePress.test.tsx):'contain'one stays an auto popover forisModaltrueandfalse;onHideonce;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 onmain.PopoverPresentation.test.tsx): the sheet is the modal sheet forisModaltrueandfalse(FR16).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.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), andPopoverAnnounce.test.tsxandPopoverAnnounceCount.test.tsxfor AR4 (throughusePopover; no test opens a controlled<Popover>from code).PopoverTabBehavior.interaction.browser.spec.tson the seven Popover Tab Behavior stories; 10 of 10 pass in Chromium and in WebKit (Playwright's container):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 theuseTooltipchange;useTooltipchange;useKeyboardHintchange;isModal: false): Tab wraps from the fallback close control to the first control, the dialog has noaria-modal, the page can take focus, and Escape from the page closes it.'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.useTooltipanduseKeyboardHintpass 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 itstooltipprop 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 byaria-describedby; neither uses the invoker. Checked with and without the tooltip change: Chromium's accessibility tree for a Tooltip and for a Button withtooltipis 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.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, bothtabBehaviordoc entries and the JSDoc state the limit.'pageOrder'popover (jsdom covers the press rules).'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 aselement.click(), after which ashow()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)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 PowerSearchpnpm test:interaction PopoverTabBehavior.interaction.browser.spec.ts --project chromium, and the same spec in WebKit: 10 passed eachPopoverAnchor3,LayerFocusReturn2,PopoverFocusReturn2,LayerSamePress10): all pass in Chromium; in WebKit all pass and oneLayerSamePresstest is skipped by the specpackages/core/srcTooltip, Text, Button, InfoTip, Popover, Layer, hooks, DropdownMenu, Dialog, utils, Toolbar, TabList and SegmentedControl: 5,013 passed. The CLI search goldens andresolution-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 uisuite ran before the rebase with theuseTooltipchange only: 26,866 tests; 26,861 passed, and the other five pass when their files run alone, with and without the change.tsc --noEmiton Core, strict ESLint on the changed files,pnpm check:knowledge: cleantest-uiunder CI's new deferral rule, so the unit command above stands in for itpnpm exec vitest run packages/richtext(the link form setsisModal={false}): 846 passedpnpm exec vitest run --project node scripts/: 5,313 passed; two tests that fetch from a remote host timed out with no network pathChanges since the last review
This PR is rebuilt. It implemented
isModal: falseas the switch for no Tab containment;spec:AST-116DEC-11 (#13015) keepsisModalas released and addstabBehavior.tabBehavior: 'pageOrder', onusePopoveronly.isModalis back to its released meaning in the hook and in its docs.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, theLayerSamePressstory change, and the two Non Modal Popover stories.usePopover Tab behavior and modalitysuite, the type error and development warning forisModal: truewith'pageOrder', and two browser tests (a popover withisModal: falseholds Tab; a'pageOrder'popover stays open when another popover opens).'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.'pageOrder'popover is left to that dialog. The earlier version closed the popover and kept the dialog open.'pageOrder'popover through the layer's dismissal, so the click of that press does not open it again.usePopover.tsx, andfocusReturn.tsusesisFocusLostwhere it had a second copy of it.FR12 gap:for a trigger with a separate anchor, and said the same in the changeset, the twotabBehaviorentries inusePopover.doc.mjsand thetabBehaviorJSDoc. 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.useTooltipfix or to state the limit in full: this head lands the fix and states what is left.useTooltipanduseKeyboardHintpass 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 earlierFR12 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 twotabBehaviordoc 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 inlayerHost.tsthat said every layer passes its trigger as the invoker is corrected. The branch is rebased ontomain.useLayer.tsxaboveshowPopovernames the invoker, not the trigger, and the local is renamed to match.[feat]fortabBehavior, which names no behavior change forisModal, and the[fix]for the announcement.Writing rubric results
Run over the changed record lines in
spec:AST-116,family:overlay-dismissal,component:Popoverandarchitecture:layer-runtime:FR3 gap:,FR12 gap:,AR4 gap:and the extendedFR9 gap:), each stating an observable mismatch.First-load size (INV10)
pnpm size:pages --page popover=Popover,Button,Text, this PR's change in gzip bytes against the code before it: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:This second table was measured before the
useTooltipanduseKeyboardHintchanges. 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-116DEC-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-boundariesnotes that a local run can print gzip sizes a few tenths of a KB apart from CI's, andpnpm size:pages --unused-onholds 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.