Repository navigation
Conversation
Browsers match :focus-visible on a text field whatever the input, and WebKit on an element focused by script, so a tap or a click that focused a disabled field, or opened a sheet whose row takes focus, painted a ring (interaction-modality INV1, AST-085 FR6). The modality store now sets one private custom property on each document's root, --astryx-focus-ring: 0 after a pointer press, cleared after a navigation key (unset reads as 1, so server markup and a page with no input yet keep keyboard rings). The shared rings scale by it: focusOutlineStyles and the focus-owner ring multiply their outline width, and the disabled-field rings mix their border back to the rest color and zero their inset shadow. Text fields start the store through useFieldInputStyling, so a disabled field alone on a page is covered. Tests that pinned the ring's exact declarations are updated.
…operty form A leading underscore marks an implementation-protocol custom property that themes do not set, as --_container-bleed-block-* and --_section-padding- propagated are. Still a typed defineVars number (stylex.types.number).
…b included Safari moves focus with Option+Tab, which the store ignored as a modifier press, so the rings stayed off after a click. Tab now counts as keyboard input whatever is held. Any key that makes the modality keyboard turns the rings on, typing included, as INV1 says.
…ocus-ring, 1) No exported vars object: focusRingVars made the switch reachable from the package's focusOutline.stylex export (public-component-api INV12). The ring styles now read Core's underscore property literally, with fallback 1, and the modality store sets it by name. focusOutlineStyles keeps the public type it had before the gate. Adds a forced-colors keyboard-focus check.
…r Tooltip iOS sends mouseover, mouseenter and mousemove after a tap, also to an element that moved under the finger and saw no pointer of its own. The shared interaction-modality store now records the last pointer's type (pointerdown, and a passive capture pointerover, which a mouse or pen sends before its mouseover). HoverCard and Tooltip ignore hover while the last pointer was a finger. A store an older bundle made answers 'not touch', which keeps today's behavior.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
… is a tracked name isLastPointerTouch joins the modality-tracking concern, its pointerover listener joins the listener pattern, and the concern claims INV11, the hover-intent rule the reader serves.
|
/approve-spec b0a8c4d |
The record says a key with Meta, Alt or Control held leaves the modality alone; a Tab with them (Safari's Option+Tab) still moves focus, so it now only clears the ring switch. INV6 names that case. Test expectations take StyleX's emitted var(--_focus-ring,1), and the two Wheel snapshots are regenerated at this head.
|
/approve-spec 846a801 |
There was a problem hiding this comment.
Changes requested: the moved-trigger tap no longer opens HoverCard or Tooltip when Core is already tracking input, but the fix misses pages where it is not, changes how hover-opened layers close, and needs a few corrections.
Blocking
- The fix only works when another Core component was already tracking input when the finger went down: in Chromium, a tap whose handler mounts a
touchTrigger="none"Tooltip under the finger on an otherwise untracked page still opens it, while the changeset says such a tap no longer does; narrow the claim and record the gap, or make the store hear the press before a hover layer mounts. - Where the next tap sends the trigger a compatibility
mouseleave(as both hooks' comments say touch does), a HoverCard or Tooltip that a mouse hover opened no longer closes when a finger taps elsewhere, because the mouse-leave handlers now return early after any finger press and a hover-opened layer arms no outside dismissal (useTooltip.tsx:538,useHoverCard.tsx:420and:724); gate only the enter handlers on the document's last pointer. - The same
isTouchHovercheck is added to bothuseHoverCard.tsxanduseTooltip.tsxinstead of once inLayer/useTouchTrigger.ts, which already owns the hover layers' touch state; answer it there on the internal return, have HoverCard useuseTouchTriggerInternalas Tooltip does, and delete both copies. .changeset/focus-rings-keyboard-only.mdsays "Focus rings show for keyboard focus only", but only the shared, focus-owner and disabled-field rings change; reword it to name those rings.
Also needed before approval
- A real-browser case for the hover fix: a tap that moves a
touchTrigger="none"trigger under the finger, then a mouse and a pen hovering it, as the interaction-modality record asks for behavior that depends on touch synthesis. - First-load gzip deltas for the whole pull request against
mainon the four reference pages; the description measures from #12591's head.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- A tap that leaves a trigger under the finger no longer opens HoverCard or Tooltip: verified in unit tests (the new cases fail on the merge base and pass here) and in Chromium when a Core tracker was mounted before the tap; false when the trigger mounts as the page's first tracker.
- Mouse and pen users, hybrid devices included, are unchanged: false under the tests' own event model; a mouse-opened layer stays open after a finger tap elsewhere (Chromium's touch emulation sends no compatibility mouseleave, so both sides stay open there).
- The store records the last pointer type from
pointerdownand one passive capturepointeroverlistener that writes one field: verified (interactionModality.ts:103,:112,:193-198). - A store made by an older bundle answers false: verified (
interactionModality.ts:417-430). - The mouse enter and leave handlers, and the card surface's, skip while either pointer was a finger: verified (
useHoverCard.tsx:411,:420,:717,:724;useTooltip.tsx:527,:538). - The record's front matter names the reader, widens the listener pattern and claims INV11: verified (
interaction-modality.md:45-57). - No public API change: verified; the API report's one row for
focusOutlineStylesis the same type written through a local alias. - The same cases check that a later mouse still hovers: verified.
- The listed suites pass, typecheck and lint are clean: 2,888 tests in 54 related files pass here, Core's build typechecks, and lint on the changed files reports no errors (two warnings in the new browser spec).
- Size deltas from #12591's head: not re-measured; whole-PR deltas from the merge base are +203 B, +462 B, +258 B and +270 B gzip on the four pages.
- Knowledge check aligned: verified.
- Hover changeset (iPhone and iPad taps no longer open; mouse and pen still hover after a tap): broader than the change (see above); a later mouse hover still opens, verified.
- Focus-ring changeset: its first sentence is broader than the change (see above); the disabled-field and sheet-row cases match the code.
Files (31):
HoverCard/useHoverCard.tsx,Tooltip/useTooltip.tsx: findings above..changeset/focus-rings-keyboard-only.md,.changeset/hover-ignores-tap-compat-mouse.md: findings above.utils/interactionModality.ts: finding above (the reader depends on listeners an earlier tracker started).docs/architecture/interaction-modality.md: clear.HoverCard.test.tsx,Tooltip.test.tsx,utils/interactionModality.test.ts: clear; no case covers the hybrid leave path.utils/focusOutline.stylex.ts,privateAttributes/focusOwner.stylex.ts,Field/inputDisabledFocus.ts,Field/fieldParts.ts: clear; two comments could be shorter.utils/__tests__/FocusRingModality.a11y.browser.spec.ts,apps/storybook/stories/BottomSheet.stories.tsx: clear.- 14 ring and markup test updates (DateRangeInput, DateTimeInput, Dialog, DropdownMenuForcedColors, two MultiSelector, NumberInput, two Selector, TextArea, TextInput, TimeInput, TreeList, Typeahead) and 2 Wheel snapshots: clear; they pin the gated values and pass here.
…rowser shows the rings After a click, Tab out of an iframe (or from the browser's interface) moved focus into this document with no key event here, so the rings stayed off. After the first pointer press the store also hears the window's blur: it notes whether focus left for a child frame or the window, and the next focusin, unless a press comes first, turns the rings back on. The window giving focus back to the element it left from is a restore and keeps them as they were. The changeset names the rings this changes, and four source comments are shorter.
… and cover devices without hover useTouchTriggerInternal answers isTouchHover for both hover layers: the trigger's own finger, the document's last pointer as a finger, or (any-hover: none). HoverCard moves to useTouchTriggerInternal. Only the enter handlers gate on it, so a mouse-opened layer still closes on a tap's compatibility mouseleave. A real-browser spec covers the moved-trigger tap and the mouse and pen hover after it. The changeset names the gap on hybrid devices.
|
/approve-spec a08f299 |
…eard pointer outranks the media query isTouchInteraction counts focus a finger press gave anywhere in the document, with no navigation key since, so HoverCard's focus path no longer opens on a tap that moved its trigger under the finger. isTouchHover reads (any-hover: none) only before the page has heard a pointer, so a mouse or pen that announced itself with pointerover still hovers. The store's reader becomes getLastPointerType. The browser spec scopes its locator to the layer and checks that the compatibility mouseover reached the trigger.
|
/approve-spec 8d12af8 |
|
/approve-spec 71124da |
…nsumer With no listener left there, nothing could turn the rings back on, so keyboard focus in an iframe or Picture-in-Picture window drew no shared ring after a pointer press. The last release drops the override in a microtask, so an object-ref consumer that releases and holds again in one commit keeps it.
There was a problem hiding this comment.
Changes requested: a tap that leaves a Tooltip or HoverCard trigger under the finger no longer opens it and mouse and pen hover still work, but focus that script moves after a tap elsewhere no longer opens a layer the component specs say opens, and the branch fails a TreeList test once merged with main.
Blocking
- The widened
isTouchInteractioninLayer/useTouchTrigger.tstreats any focus after a finger press anywhere as tap focus, so a tap that focuses a text field wrapped in a Tooltip, or a HoverCard trigger, by script no longer opens the layer (it does onmain), against Tooltip FR4 and FR13 and HoverCard FR4 and FR12; count the last finger only for focus the tap itself gives the trigger (for example amousedownon it with nopointerdownof its own), or have an owner amend those clauses, and mention the wideruseTouchTrigger().isTouchInteraction()answer in the changeset. - Regression: once merged with current
main, the TreeList case "draws the focus ring on a plain row that has keyboard focus" (TreeList.test.tsx:447, added by #12153) fails because it expects the unscaled--_focus-outlinethat this branch now scales by--_focus-ring; mergemainand update that assertion as this branch already does for the other TreeList ring case.
The earlier HoverCard focus, (any-hover: none) and browser-spec findings are fixed, and the new Chromium spec passes.
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- A tap that leaves a trigger under the finger no longer opens HoverCard or Tooltip on a phone or tablet: verified (new unit cases fail on the base and pass here; the new Chromium spec passes; touch-enabled Chromium frames show the base opening both layers and this branch neither).
- On a device with a mouse too, the same holds once a Core component has seen a press: verified in unit tests (the store starts with its first consumer, as the known gap says).
- A mouse or pen still hovers, also right after a tap: verified (unit cases; the Chromium spec's mouse and pen steps under touch emulation pass).
- The shared, focus-owner and disabled-field rings show for keyboard focus only, including focus back from a frame or the browser, and component rings are unchanged: verified (the ring browser spec passes in Chromium; unit tests); WebKit was not run.
- The store records the last pointer type from the press listener and one passive capture pointer-over listener that writes one field: verified (
interactionModality.ts). - The new reader returns the type, or nothing before any pointer or in a store an older bundle made: verified.
- The touch helper answers touch hover from the trigger's pointer and the document's last pointer, with the no-hover media query only before any pointer: verified (
useTouchTrigger.ts). - The focus check also counts focus that a finger press elsewhere gave: verified as written, but it also blocks focus that script moves after a tap elsewhere (first finding).
- HoverCard uses the internal helper as Tooltip does, only the enter handlers gate on touch hover, and the leave handlers keep the trigger's own check: verified.
- The record's front matter names the reader, widens the listener pattern and claims the hover-intent invariant: verified; through the merged branch the focus-modality invariant also gains a sentence.
- No public API change: verified for signatures (the generator's one row is the same type through a local alias); the public touch hook's focus answer widens (first finding).
- New cases fail on the base and pass here: verified (three fail on the base).
- Leave still closes, Tab after a tap still opens a HoverCard, and a no-hover device ignores an unannounced mouse: verified in unit tests.
- The real-browser spec shows a tap opening nothing and then a mouse and a pen opening the layer: verified (passes in Chromium here).
- The listed suites pass and typecheck and lint are clean: suites verified (203 files, 5,903 tests); Core typecheck and lint on the 28 changed code files exit 0.
- The modality tests list the pointer-over listener: verified.
- Whole-branch size against the merge base (docs +502 B, form +732 B, menu +554 B, table +526 B gzip): verified within 30 B (+503, +745, +584, +552); the own-change share was not measured.
- A device take will be added: not in the pull request; not required here.
- Knowledge check aligned: verified.
- Hover changeset: all three sentences verified as above; it does not mention the touch hook's wider focus answer (first finding).
- Focus-ring changeset: verified as above.
- The fix restores one defect and hides no new interaction model under the fix label: false for focus that script moves after a tap elsewhere (first finding).
- Public text carries no internal context: verified.
- Overlap with other open pull requests: not checked here.
Files (33):
Layer/useTouchTrigger.ts: first finding; the helper still detaches the hook's JSDoc, and the touch-hover JSDoc is one 60-word sentence (non-blocking).utils/focusOutline.stylex.ts,TreeList/TreeList.test.tsx: second finding (fails with currentmain's new TreeList case).HoverCard/useHoverCard.tsx,Tooltip/useTooltip.tsx: first finding (their focus paths read the widened check)..changeset/hover-ignores-tap-compat-mouse.md: first finding (silent on the touch hook).docs/architecture/interaction-modality.md: the new sentence omits the frame and window focus return (non-blocking).Field/fieldParts.ts: second documents stay untracked (non-blocking).utils/interactionModality.ts,.changeset/focus-rings-keyboard-only.md: clear.HoverCard.test.tsx,Tooltip.test.tsx,utils/interactionModality.test.ts,Tooltip/__tests__/TouchCompatibilityHover.a11y.chromium.spec.ts: clear.privateAttributes/focusOwner.stylex.ts,Field/inputDisabledFocus.ts: clear.utils/__tests__/FocusRingModality.a11y.browser.spec.ts,apps/storybook/stories/BottomSheet.stories.tsx: clear.- 13 ring and markup test updates (DateRangeInput, DateTimeInput, Dialog, DropdownMenuForcedColors, two MultiSelector, NumberInput, two Selector, TextArea, TextInput, TimeInput, Typeahead) and 2 Wheel snapshots: clear.
| * hovering pointer: the trigger's own pointer is a finger, the document's | ||
| * last pointer was a finger (a tap's compatibility mouse events also reach | ||
| * a trigger that moved under the finger), or, before the page has heard | ||
| * any pointer, the device has no pointer that can hover. Gate hover-opening on it; a leave keeps the trigger's own |
There was a problem hiding this comment.
Non-blocking: this JSDoc is one 60-word sentence, and this line runs to 117 characters. Suggested: "Whether a mouse arrival on the trigger comes from a finger. The trigger's own finger counts, and so does a last document pointer that was a finger. Before the page hears any pointer, a device with no pointer that can hover counts. Gate hover-opening on it. A leave keeps the trigger's own check, so a mouse-opened layer still closes."
… again An object-ref consumer in a second document releases and holds again after every commit; the release removed the window's blur listener and the hold never added it back, so focus returning there by keyboard after a press showed no ring on its first stop. Listening that resumes while the switch is 0 now hears the window too.
|
/approve-spec 6fe7dc5 |
There was a problem hiding this comment.
Changes requested: the moved-trigger tap no longer opens HoverCard or Tooltip, and the two commits merged from #12591's branch since the last review look correct, but both defects from the last review are still present at this head.
isTouchInteractioninLayer/useTouchTrigger.ts(lines 483-489) treats any focus after a finger press anywhere in the document as tap focus, so focus that script moves after a tap on another control no longer opens a text-entry Tooltip trigger or a HoverCard, which the Tooltip and HoverCard specs say it does (Tooltip FR4 and FR13, HoverCard FR4 and FR12); count the finger only for focus the tap itself gives the trigger, and add a test for each case.- Regression: merging current
mainfailsTreeList.test.tsx:447, whose plain-row case still expects the ungated--_focus-outlinethatfocusOutline.stylex.ts:247now gates; mergemainand update that assertion as the other TreeList ring case was updated.
The non-blocking notes (two JSDoc placements in useTouchTrigger.ts, the INV6 sentence, and the Field tracker's dropped ref) are in the open review threads.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
Claims:
- A tap that leaves a HoverCard or Tooltip trigger under the finger opens nothing, also with touch trigger none: verified, the new unit cases pass at this head.
- Mouse and pen hover is unchanged, also right after a tap: verified by the unit cases' mouse steps; the browser spec's mouse and pen steps did not run in CI for this draft.
- The modality store records the last pointer type from pointer down and a passive pointer-over listener, and a new reader returns it or nothing: verified (
interactionModality.ts:136-149,:521-536). - The hover layers answer touch hover once; before any pointer, a device with no hovering pointer counts, and a heard mouse or pen always hovers: verified (
useTouchTrigger.ts:491-502). - The focus check also counts focus a finger press elsewhere gave: true as written, and it also blocks script focus after a tap elsewhere (blocking finding).
- Only the enter handlers use the touch-hover answer; the leave handlers keep the trigger's own check: verified (
useHoverCard.tsx:404,:413,:710,:717;useTooltip.tsx:520,:531). - The record's front matter names the new reader, widens the listener pattern and claims the hover-intent rule: verified.
- No public API change: verified for exports and types; the public hook's focus answer widens (blocking finding).
- Red first on the base, leave still closes, Tab after a tap still opens a HoverCard, and the no-hover-device cases: the cases pass at this head; the red-first run was checked in the last review and these tests are unchanged since.
- The browser spec runs in CI's Chromium leg: CI has not run for this draft head.
- The named suites pass: verified, HoverCard, Tooltip, Layer, TreeList, utils, Field, CheckboxInput, IconButton and others pass at this head.
- Typecheck and lint are clean: not checked in this review.
- Bundle-size deltas on the four reference pages: reported in the description; not re-measured after the two newly merged commits.
- Hover changeset (phone or tablet tap no longer opens; hybrid devices once a Core component saw a press; mouse and pen still hover): verified.
- Ring changeset (shared and disabled-field rings show for keyboard focus only, including focus returning from a child frame or the browser; component-owned rings unchanged): verified by the modality and ring markup tests.
Files:
Layer/useTouchTrigger.ts: blocking (the widened focus answer); two non-blocking JSDoc notes.utils/focusOutline.stylex.ts: regression once merged with currentmain(TreeList plain-row assertion).docs/architecture/interaction-modality.md: non-blocking (the INV6 sentence omits two ways the ring switch clears).Field/fieldParts.ts: non-blocking (the tracker's ref is dropped).- Clear: both changesets,
BottomSheet.stories.tsx,Field/inputDisabledFocus.ts,HoverCard/useHoverCard.tsx,Tooltip/useTooltip.tsx,privateAttributes/focusOwner.stylex.ts,utils/interactionModality.ts,utils/interactionModality.test.ts,HoverCard.test.tsx,Tooltip.test.tsx,TouchCompatibilityHover.a11y.chromium.spec.ts,FocusRingModality.a11y.browser.spec.ts,TreeList.test.tsx, the two DateInput snapshots, and the ring-assertion updates in the DateRangeInput, DateTimeInput, Dialog, DropdownMenuForcedColors, MultiSelector (two), NumberInput, Selector (two), TextArea, TextInput, TimeInput and Typeahead tests.
…rd-only TreeList's plain-row ring case, new on main, expects the ring width that the shared ring switch scales, as the branch's other TreeList case does.
…ts as touch A finger's compatibility arrival on a trigger that saw no pointer of its own marks it, and isTouchInteraction counts the last finger only for that trigger, so focus that script moves after a tap elsewhere still opens a Tooltip or HoverCard (Tooltip FR4/FR13, HoverCard FR4/FR12). The changeset names the wider isTouchInteraction answer.
|
/approve-spec b820d0f |
There was a problem hiding this comment.
Changes requested: both defects from the last review are fixed (focus that script moves after a tap elsewhere opens the card again, and the TreeList ring case passes after the merge of main), but two new ones need fixing.
- After a tap once leaves a trigger under the finger,
isFingerArrivalRefinLayer/useTouchTrigger.ts(lines 517-521) stays set until that trigger's own next pointer event, so focus that a later tap's handler moves to the trigger opens no HoverCard or text-entry Tooltip, although Tooltip FR4 and HoverCard FR4 say it opens; clear the mark when that tap ends (for example on the trigger'smouseleave) and add the second-tap case as a test. .changeset/hover-ignores-tap-compat-mouse.mdsaysuseTouchTrigger().isTouchInteraction()now answers true for the moved trigger's tap focus, but the public hook has no mouse-arrival handler and answers exactly as before; drop that sentence or say that HoverCard and Tooltip count that focus as touch.
The non-blocking notes (JSDoc placement and length in useTouchTrigger.ts, the INV6 sentence, the Field tracker's dropped ref, and naming Layer and utils on the Scope line) are in the review threads and the review.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
Claims:
- A tap that leaves a HoverCard or Tooltip trigger under the finger opens nothing, also with touch trigger none: verified (new unit cases pass; touch-enabled Chromium, both default stories).
- A tap on a trigger still follows its touch-trigger setting: verified (existing touch suites pass).
- Mouse and pen hover is unchanged, also right after a tap: verified by the unit cases; the browser spec's mouse and pen steps did not run in CI for this draft.
- The modality store records the last pointer type from pointer down and a passive pointer-over listener, and a new reader returns it or nothing: verified (
interactionModality.ts). - The hover layers answer touch hover once; before any pointer, a device with no hovering pointer counts, and a heard mouse or pen always hovers: verified (
useTouchTrigger.ts:504-515). - A finger's arrival on a trigger that saw no pointer of its own makes the focus that tap gives count as touch: true, but the mark outlives that tap (blocking finding).
- Focus that script moves to a trigger after a tap elsewhere still opens it: verified for a trigger the finger never reached; false after an earlier tap left the trigger under the finger (blocking finding).
- Only the enter handlers use the touch-hover answer; the leave handlers keep the trigger's own check: verified (
useHoverCard.tsx:405,:414,:711,:718;useTooltip.tsx:520,:531). - The record's front matter names the new reader, widens the listener pattern and claims the hover-intent rule: verified.
- No public API change: verified.
- Known gap on a device with both a finger and a mouse before any Core component listens: consistent with the code (the store listens from its first consumer).
- Red first on the base: the base opens both layers on the moved-trigger tap in touch-enabled Chromium; the unit cases were not rerun on the base in this review.
- Leave still closes, a Tab after a tap and script focus after a tap open a HoverCard, and the no-hover-device cases: verified, the cases pass at this head.
- The browser spec runs in CI's Chromium contract leg: CI has not run for this draft head.
- The named suites pass: verified (HoverCard, Tooltip, Layer, TreeList, utils, Field and the ring-assertion suites pass at this head).
- Typecheck and lint are clean: not checked in this review.
- Bundle-size deltas on the four reference pages: reported in the description; not re-measured after the latest commit.
- A device take will be added: not stated yet.
- Hover changeset, phone or tablet tap and hybrid devices once a Core component saw a press: verified; mouse and pen still hover: verified; script focus still opens: false after an earlier landing (blocking finding); the public focus-answer sentence: false (blocking finding).
- Ring changeset (shared and disabled-field rings show for keyboard focus only, including focus returning from a child frame or the browser; component-owned rings unchanged): verified by the modality and ring markup tests.
Files:
Layer/useTouchTrigger.ts: blocking (the finger-arrival mark); non-blocking JSDoc notes and a behavior tag-along note..changeset/hover-ignores-tap-compat-mouse.md: blocking (the public hook claim).utils/interactionModality.ts: non-blocking (behavior tag-along note for the Scope line).docs/architecture/interaction-modality.md: non-blocking (the INV6 sentence omits two ways the ring switch clears).Field/fieldParts.ts: non-blocking (the tracker's ref is dropped).- Clear:
.changeset/focus-rings-keyboard-only.md,BottomSheet.stories.tsx,Field/inputDisabledFocus.ts,HoverCard/useHoverCard.tsx,Tooltip/useTooltip.tsx,privateAttributes/focusOwner.stylex.ts,utils/focusOutline.stylex.ts,utils/interactionModality.test.ts,HoverCard.test.tsx,Tooltip.test.tsx,TouchCompatibilityHover.a11y.chromium.spec.ts,FocusRingModality.a11y.browser.spec.ts,TreeList.test.tsx, the two DateInput snapshots, and the ring-assertion updates in the DateRangeInput, DateTimeInput, Dialog, DropdownMenuForcedColors, MultiSelector (two), NumberInput, Selector (two), TextArea, TextInput, TimeInput and Typeahead tests.
handleMouseDeparture clears the finger-arrival mark on the trigger's mouse departure, so focus that a later tap moves by script opens the layer again (Tooltip FR4, HoverCard FR4). The changeset says HoverCard and Tooltip count the tap's focus as touch; the public hook's answer is unchanged.
|
/approve-spec 24f5724 |
There was a problem hiding this comment.
Changes requested. One duplication still needs a change:
- Miss:
utils/interactionModality.tsadds a secondgetLastPointerType, fed by its ownpointeroverlistener and store field, beside the existinggetLastPointerTypeinutils/inputStream.tsthatLayer/inputHold.tsand TopNav already read, so take the pointer type from the input stream (subscribepointeroverandpointerdownthroughsubscribeInput) and drop the copy, or say in the description why the stream cannot serve this case.
The hover and focus fix itself behaves as described: a tap that leaves a HoverCard or Tooltip trigger under the finger opens nothing, while mouse and pen hover and a later tap's script focus still open the layer. Non-blocking notes on the useTouchTriggerInternal JSDoc placement, the isTouchHover JSDoc and the INV6 wording remain in their open threads.
Claims and files checked
Review mode: same-head; reason: none
- Claim: a tap that leaves a HoverCard or Tooltip trigger under the finger opens nothing, and the focus it gives counts as touch for both: verified (new unit cases; touch-enabled Chromium, both default stories).
- Claim: a mouse or pen still hovers, also right after a tap, and a mouse-opened layer still closes on a tap elsewhere: verified (unit cases).
- Claim: focus that script moves to a trigger after a tap still opens it: verified (Chromium second-tap capture; HoverCard unit case; text-field Tooltip probe).
- Claim: on a device with a mouse, the gate holds once the store hears a press; phones are covered by the no-hover media query: verified (
isTouchHover). - Claim: the store records the pointer type from
pointerdownand a passivepointerover, and the reader answers undefined before any pointer: verified; it duplicates the input stream (finding above). - Claim: only the enter handlers gate on touch hover, and the leave handlers keep the trigger's own check: verified.
- Claim: the record's front matter names the reader, widens the listener pattern and claims the hover-intent rule: verified.
- Claim: no public API change: verified.
- Claim: the shared and disabled-field rings show for keyboard focus only, including focus back from a frame or the browser: verified in unit tests; the browser spec has not run at this head.
- Claim: the unchanged suites pass: verified (123 files, 2,641 tests).
- Claim: the Chromium spec runs in CI's Chromium contract leg: verified in the Playwright config; CI has not run on this draft.
- Claim: first-load size deltas on the four reference pages: reported, not re-measured.
- Claim: the device take predates this head and a retake is booked: stated in text, not required.
- Claim: the rubric results cover a front-matter-only record change: true for this pull request's own commits; the carried INV6 sentence has none.
- File
utils/interactionModality.ts: duplicate last-pointer reader (blocking); the ring switch and focus return are clear. - File
Layer/useTouchTrigger.ts: JSDoc placement and length (non-blocking); the logic is clear. - File
docs/architecture/interaction-modality.md: INV6 omits two ways the rings return (non-blocking). - File
Field/fieldParts.ts: the tracker's ref is dropped (non-blocking). - Files
HoverCard/useHoverCard.tsx,Tooltip/useTooltip.tsx,Field/inputDisabledFocus.ts,utils/focusOutline.stylex.ts,privateAttributes/focusOwner.stylex.ts, both changesets and the BottomSheet story: clear. - Files
HoverCard.test.tsx,Tooltip.test.tsx,interactionModality.test.ts,TreeList.test.tsx,Dialog.test.tsx,DropdownMenuForcedColors.test.tsx, the DateRangeInput, DateTimeInput, MultiSelector (2), NumberInput, Selector (2), TextArea, TextInput, TimeInput and Typeahead ring assertions, and both browser specs: clear. - Files: the two DateInput snapshots: clear (class-name churn only).
…ed input stream The modality store's second lastPointerType, its pointerover listener and getLastPointerType copy are gone, with the record touch they needed. useTouchTriggerInternal subscribes pointerover and pointerdown through subscribeInput while a hover trigger is mounted, and reads inputStream's getLastPointerType, which Layer's input hold and TopNav already read.
|
/approve-spec be6fb12 |
There was a problem hiding this comment.
Changes requested: the hover fix behaves as described and the earlier description corrections are in, but one statement in the description is still false (no code change is needed).
- Miss: the Scope section's Overlap line says this pull request's own change is "the touch-pointer fact in the shared store plus HoverCard's and Tooltip's mouse handlers", but on top of #12591 it changes only
Layer/useTouchTrigger.ts, the two hooks' mouse handlers, their tests, the Chromium spec and the hover changeset, and no store, which also contradicts the description's own "This PR no longer changes the modality store"; suggested wording: "this PR's own change is the touch trigger's touch-hover gate and arrival mark (Layer/useTouchTrigger.ts) plus HoverCard's and Tooltip's mouse handlers".
The size figures, the explanation of the growth and the test-list sentence now match this head. The non-blocking notes on the helper JSDoc in Layer/useTouchTrigger.ts and on the INV6 wording stay in their threads, and CI has not run on this draft yet.
Claims and files checked
Review mode: same-head; reason: none
- Claim: a tap that leaves a HoverCard or Tooltip trigger under the finger opens nothing, even with
touchTrigger="none": verified (new unit cases fail on the base and pass here; touch-enabled Chromium on both default stories). - Claim: a direct tap on a trigger still follows
touchTrigger: verified (existing touch suites pass). - Claim: mouse and pen still hover, also right after a tap on a hybrid device: verified for a mouse (unit cases and Chromium); pen by code, as the new Chromium spec has not run.
- Claim: this pull request no longer changes the modality store and does not need #12591's code: verified (its own change on top of #12591 applies cleanly to the base and uses only exports the base has).
- Claim: the input stream is unchanged and already records the last pointer type that Layer's input hold and TopNav read: verified.
- Claim: the touch trigger keeps the stream listening for
pointeroverandpointerdownwhile a hover trigger is mounted, with no listener of its own: verified. - Claim: the touch-hover answer covers the trigger's own finger, a last pointer that was a finger, and a device with no hover pointer before any pointer is heard: verified.
- Claim: a finger's arrival makes the focus that tap gives the trigger touch, the next mouse departure ends it, and script focus after a tap elsewhere still opens the layer: verified (unit cases).
- Claim: only the enter handlers gate, the leave handlers keep the trigger's own check, and HoverCard moves onto the internal hook as Tooltip uses: verified.
- Claim: no public API change: verified (API surface comparison and a type-equality check).
- Claim: the hybrid-device gap the description names: consistent with the code.
- Claim: red first, leave still closes, keyboard and script focus still open, and the no-hover-device case: verified (unit cases).
- Claim: the new Chromium spec checks the compatibility
mouseoverand runs in CI's Chromium contract leg: verified in the spec and the Playwright configuration; it has not run at this head. - Claim: the named suites pass, and typecheck and lint are clean: verified (the test count depends on how the suites are filtered; all pass).
- Claim: the first-load size figures against #12591's head (+289, +288, +325 and +291 B; Tooltip +313 B, HoverCard +274 B): verified.
- Claim: every reference page already loads the input stream on the base, so the growth is the gate, the arrival mark and the subscription: verified.
- Claim: the gate is default behavior, so the optional-feature cap does not apply, and these are the shared-module deltas to report: verified.
- Claim: the simulator take carries to this head: stated in text; no current record requires device evidence for this change.
- Claim: the scope checklist (one defect, nothing hidden under the fix label, no internal context): verified.
- Claim: #12591's files appear here only through the merge of its branch: verified.
- Claim: this pull request's own change is the touch-pointer fact in the shared store plus the mouse handlers: false (finding above).
- Claim: other open pull requests that touch these files change other lines: not verified (13 other open pull requests also change the hover hooks, their tests or the touch trigger, and their hunks were not compared with this head).
- Changeset (hover): verified, including the hybrid-device sentence for pages with a field or a pressable.
- Changeset (focus rings): verified (a click on a disabled field draws no ring, Tab draws it; unit tests cover focus returning from a frame or the window).
- File
Layer/useTouchTrigger.ts: misattached helper JSDoc and a longisTouchHoverJSDoc (non-blocking); the logic is clear. - Files
HoverCard/useHoverCard.tsxandTooltip/useTooltip.tsx: clear. - Files
utils/interactionModality.ts,utils/focusOutline.stylex.ts,privateAttributes/focusOwner.stylex.tsandField/inputDisabledFocus.ts: clear. - File
Field/fieldParts.ts: the tracker's ref is dropped (non-blocking). - File
docs/architecture/interaction-modality.md: INV6 omits focus returning from a frame or the window (non-blocking); owner-approved at this head. - Files: both changesets and the BottomSheet story: clear.
- Files
HoverCard.test.tsx,Tooltip.test.tsx,interactionModality.test.ts,TreeList.test.tsx,Dialog.test.tsx,DropdownMenuForcedColors.test.tsx, the DateRangeInput, DateTimeInput, MultiSelector (2), NumberInput, Selector (2), TextArea, TextInput, TimeInput and Typeahead ring assertions, and both browser specs: clear. - Files: the two DateInput snapshots: clear (class-name churn only).
| * @internal | ||
| */ | ||
| /** | ||
| * Whether the trigger's device has no pointer that can hover, as on a phone: |
There was a problem hiding this comment.
Non-blocking: this JSDoc and useTouchTriggerInternal's JSDoc above it (with its @internal tag) now both precede windowOf, so windowOf reads as "Whether the trigger's device has no pointer that can hover", hasNoHoverPointer has no doc, and the built declaration of useTouchTriggerInternal loses @internal. Move windowOf, lastPointerTypeAt, ignorePointer and hasNoHoverPointer above line 352, with this block directly above hasNoHoverPointer.
Primary intent
Fix: on iPhone and iPad, a tap no longer opens a HoverCard or Tooltip whose trigger the tap leaves under the finger.
Stacked on #12591 (the shared modality store's focus-ring switch). This PR no longer changes the modality store, so it does not need #12591's code; it stays stacked for its history. Until #12591 merges, this diff includes its commits; compare against #12591's head.
User or maintainer impact
touchTrigger="none", and nothing closed it.touchTriggersetting.Expected behavior and authority
architecture:interaction-modalityINV11: hover intent answers mouse and pen hover only; a finger is never gated or served by it. INV4: hover is never the only path, and a tap follows the trigger's touch rule.component:HoverCardFR4 and FR5, andcomponent:Tooltip'stouchTrigger: a tap opens a card only through the tap path.The change
utils/inputStream.ts(unchanged): the shared input stream already records the last pointer's type (getLastPointerType, which Layer's input hold and TopNav read). A mouse or pen sendspointeroverbefore itsmouseover, and a tap's compatibility mouse events have no pointer of their own.Layer/useTouchTrigger.ts: while a hover trigger is mounted,useTouchTriggerInternalsubscribespointeroverandpointerdownthroughsubscribeInputin its window, so the stream hears the pointer type (one shared native listener per type, no listener of its own). It answersisTouchHover()once for the hover layers: the trigger's own pointer is a finger, or the document's last pointer was a finger; before the page has heard any pointer, a device with no pointer that can hover ((any-hover: none), as on a phone) counts too. A heard mouse or pen always hovers. The trigger's own mouse arrival (handleMouseArrival()) marks a finger's compatibility arrival on a trigger that saw no pointer of its own, and its mouse departure (handleMouseDeparture(), the next tap's compatibilitymouseleave) clears the mark;isTouchInteraction(), which the focus paths read, then counts the focus that tap gives that trigger as touch (with no navigation key since). Focus that script moves to a trigger after a tap elsewhere is not marked, so it still opens the layer (Tooltip FR4 and FR13, HoverCard FR4 and FR12).HoverCard/useHoverCard.tsx(now onuseTouchTriggerInternal, as Tooltip is) andTooltip/useTooltip.tsx: only the mouse-enter handlers (and HoverCard's card-surface enter) gate onisTouchHover(). The leave handlers keep the trigger's own pointer check, so a mouse-opened layer still closes on the compatibilitymouseleaveof a tap elsewhere.(any-hover: none).Evidence
mouseover/mouseenter/mousemoveafter a touch on another control) and pass here. HoverCard's case also focuses the trigger, as Chromium does for a tapped button. The same cases then move a mouse onto the trigger (pointeroverwithpointerType: 'mouse') and check that hover still opens: the hybrid-device path.pointeroverstill opens it.Tooltip/__tests__/TouchCompatibilityHover.a11y.chromium.spec.ts(Tooltip and HoverCard default stories, touch-enabled Chromium): a real tap on a control whose pointer release moves the trigger under the finger sends the trigger compatibilitymouseoverevents (checked) and opens nothing; a mouse then opens it, and after it closes, a pen (CDPpointerType: 'pen') opens it. It runs in CI's Chromium contract leg.pnpm size:pages, gzip, the four reference pages, this PR's own change from fix(core): shared and disabled-field focus rings show for keyboard focus only #12591's head 7a5ea5d): docs +289 B, form +288 B, menu +325 B, table +291 B; Tooltip page +313 B, HoverCard page +274 B. The touch-hover gate is default behavior, soarchitecture:component-import-boundariesINV10's 0.3 KB cap for optional features does not apply (DEC-5); these are the deltas INV10 asks a shared-module change to report. Every reference page already loadsutils/inputStream.tson the base, through press feedback, so the growth is the touch trigger's new gate, its arrival mark and its stream subscription.main432354a): a constructed page, the same on both builds, where a tap on one control drops a HoverCard or Tooltip trigger under the finger; a take counts only when the dropped trigger heard all six compatibility events (mouseover,mouseenter,mousemove,mousedown,mouseup,click). Card trigger under the finger:mainopened the card 6 of 6, this branch 0 of 6. Hint trigger:main6 of 6, this branch 0 of 6. A tap whose handler focuses a trigger by script opens it on both, 3 of 3. Two taps (the first drops the trigger, the second's handler focuses it by script):mainopens at the first tap, this branch opens nothing at the first and opens at the second, 3 of 3. Direct taps on a hint-only Tooltip and an info trigger open on both; desktop mouse hover opens on both. This head changes 24f5724's runtime only in where it reads the last pointer type (the shared input stream instead of a store copy); the same reading, so the take stands.Simulator frames (24f5724 against
main432354a)mainScope
Components: HoverCard, Tooltip (and the shared Layer touch trigger they use)
Overlap checked: #12591 (stacked on it: its files appear here only through the merge of its branch; this PR's own change is the touch-pointer fact in the shared store plus HoverCard's and Tooltip's mouse handlers, a separate defect; other open PRs that touch these files change other lines)