Repository navigation
fix(Tooltip, HoverCard): a disabled control's reason opens on a tap - #8207
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC |
|---|---|---|
| charts/Chart | 67.1 kB (+918 B) · 20 B CSS (0) | — |
| charts/ChartLegend | 56.4 kB (+907 B) · 20 B CSS (0) | — |
| ContextMenuItem | 56.4 kB (+839 B) · 9.9 kB CSS (0) | — |
120 more components
| Component | Size | LoC |
|---|---|---|
| charts/ChartTooltip | 56.3 kB (+824 B) · 20 B CSS (0) | — |
| lab/Schedule | 63.7 kB (+786 B) · 3.9 kB CSS (0) | — |
| CodeBlock | 63.1 kB (+383 B) · 11.0 kB CSS (0) | — |
| SideNav | 67.3 kB (+382 B) · 10.9 kB CSS (0) | — |
| Stepper | 50.4 kB (+375 B) · 9.9 kB CSS (0) | — |
| TopNavMenu | 60.6 kB (+375 B) · 10.5 kB CSS (0) | — |
| SideNavCollapseButton | 49.5 kB (+373 B) · 9.8 kB CSS (0) | — |
| TabMenu | 58.2 kB (+373 B) · 10.4 kB CSS (0) | — |
| ToggleButton | 46.7 kB (+373 B) · 9.5 kB CSS (0) | — |
| ChatSendButton | 48.6 kB (+372 B) · 9.4 kB CSS (0) | — |
| IconButton | 45.9 kB (+371 B) · 9.4 kB CSS (0) | — |
| Button | 45.9 kB (+368 B) · 9.4 kB CSS (0) | — |
| Calendar | 58.0 kB (+365 B) · 10.3 kB CSS (0) | — |
| SideNavItem | 57.6 kB (+363 B) · 10.4 kB CSS (0) | — |
| ChatLayoutScrollButton | 49.3 kB (+361 B) · 9.9 kB CSS (0) | — |
| Thumbnail | 53.6 kB (+356 B) · 11.3 kB CSS (0) | — |
| TopNav | 55.1 kB (+356 B) · 10.7 kB CSS (0) | — |
| BaseTypeahead | 58.4 kB (+355 B) · 10.2 kB CSS (0) | — |
| Banner | 50.7 kB (+351 B) · 10.2 kB CSS (0) | — |
| ChatDictationButton | 49.3 kB (+351 B) · 9.8 kB CSS (0) | — |
| Link | 46.4 kB (+348 B) · 7.9 kB CSS (0) | — |
| ChatLayout | 51.9 kB (+347 B) · 10.2 kB CSS (0) | — |
| MobileNav | 54.1 kB (+347 B) · 10.4 kB CSS (0) | — |
| TableSelectionToolbar | 55.1 kB (+346 B) · 11.4 kB CSS (0) | — |
| MobileNavToggle | 49.1 kB (+345 B) · 9.7 kB CSS (0) | — |
| TopNavMegaMenu | 57.3 kB (+343 B) · 11.1 kB CSS (0) | — |
| HoverCard · Storybook | 18.2 kB (+342 B) · 5.0 kB CSS (0) | 683 (0) |
| Tooltip · Storybook | 17.8 kB (+342 B) · 5.0 kB CSS (0) | 577 (0) |
| Lightbox | 54.4 kB (+340 B) · 10.1 kB CSS (0) | — |
| lab/Comments | 225.5 kB (+340 B) · 2.5 kB CSS (0) | — |
| AlertDialog | 59.7 kB (+333 B) · 12.7 kB CSS (0) | — |
| lab/InfoTip | 23.0 kB (+327 B) · 458 B CSS (0) | — |
| SideNavHeading | 61.5 kB (+322 B) · 10.5 kB CSS (0) | — |
| ChatComposerInput | 58.7 kB (+321 B) · 10.3 kB CSS (0) | — |
| ChatComposerTokenElement | 58.7 kB (+319 B) · 10.3 kB CSS (0) | — |
| Avatar | 39.0 kB (+317 B) · 6.5 kB CSS (0) | — |
| ChatComposer | 64.0 kB (+317 B) · 11.1 kB CSS (0) | — |
| SegmentedControl | 40.5 kB (+316 B) · 6.5 kB CSS (0) | — |
| AvatarGroupOverflow | 42.4 kB (+315 B) · 6.5 kB CSS (0) | — |
| Carousel | 53.4 kB (+315 B) · 10.5 kB CSS (0) | — |
| StatusDot | 20.1 kB (+315 B) · 6.3 kB CSS (0) | — |
| AvatarGroup | 41.5 kB (+310 B) · 6.6 kB CSS (0) | — |
| lab/CommentPin | 50.2 kB (+308 B) · 1.2 kB CSS (0) | — |
| TopNavHeading | 60.9 kB (+306 B) · 10.3 kB CSS (0) | — |
| DialogHeader | 51.7 kB (+302 B) · 10.1 kB CSS (0) | — |
| Popover | 52.5 kB (+302 B) · 12.4 kB CSS (0) | — |
| lab/TourStep | 57.9 kB (+301 B) · 590 B CSS (0) | — |
| Toast | 62.8 kB (+296 B) · 10.0 kB CSS (0) | — |
| AppShell | 71.5 kB (+290 B) · 12.0 kB CSS (0) | — |
| DrawerHeader | 51.8 kB (+285 B) · 11.5 kB CSS (0) | — |
| BreadcrumbItem | 70.2 kB (+279 B) · 11.4 kB CSS (0) | — |
| LayerProvider | 66.9 kB (+268 B) · 10.4 kB CSS (0) | — |
| richtext/RichTextEditorToolbar | 216.5 kB (+263 B) · 454 B CSS (0) | — |
| lab/CommentThread | 220.8 kB (+258 B) · 2.4 kB CSS (0) | — |
| NumberInput | 58.9 kB (+257 B) · 11.0 kB CSS (0) | — |
| richtext/RichTextView | 253.5 kB (+248 B) · 2.3 kB CSS (0) | — |
| Markdown | 148.4 kB (+246 B) · 18.2 kB CSS (0) | — |
| lab/CommentComposer | 97.8 kB (+243 B) · 1.9 kB CSS (0) | — |
| ContextMenu | 78.0 kB (+242 B) · 15.2 kB CSS (0) | — |
| CheckboxListItem | 57.5 kB (+239 B) · 11.0 kB CSS (0) | — |
| TableHeaderCell | 78.8 kB (+239 B) · 15.4 kB CSS (0) | — |
| lab/ListInput | 78.4 kB (+237 B) · 1.6 kB CSS (0) | — |
| TextInput | 56.6 kB (+231 B) · 10.8 kB CSS (0) | — |
| RadioList | 47.6 kB (+230 B) · 8.3 kB CSS (0) | — |
| TableCell | 79.2 kB (+229 B) · 15.7 kB CSS (0) | — |
| TimeInput | 91.9 kB (+229 B) · 14.1 kB CSS (0) | — |
| CheckboxInput | 52.9 kB (+228 B) · 9.6 kB CSS (0) | — |
| TextArea | 51.5 kB (+221 B) · 9.7 kB CSS (0) | — |
| DateTimeInput | 115.1 kB (+220 B) · 15.6 kB CSS (0) | — |
| Table | 87.9 kB (+219 B) · 15.9 kB CSS (0) | — |
| RadioListItem | 55.5 kB (+215 B) · 10.0 kB CSS (0) | — |
| Slider | 50.9 kB (+215 B) · 8.8 kB CSS (0) | — |
| FileInput | 57.3 kB (+213 B) · 10.7 kB CSS (0) | — |
| InputGroup | 46.8 kB (+213 B) · 8.3 kB CSS (0) | — |
| lab/MobilePowerSearch | 159.9 kB (+213 B) · 1.2 kB CSS (0) | — |
| Switch | 51.3 kB (+210 B) · 9.7 kB CSS (0) | — |
| ComplexSelector | 59.4 kB (+202 B) · 11.0 kB CSS (0) | — |
| Field | 46.2 kB (+202 B) · 8.3 kB CSS (0) | — |
| ListItem | 56.9 kB (+200 B) · 11.0 kB CSS (0) | — |
| CheckboxList | 48.0 kB (+193 B) · 8.5 kB CSS (0) | — |
| Selector | 80.1 kB (+192 B) · 15.4 kB CSS (0) | — |
| MultiSelector | 76.0 kB (+191 B) · 15.0 kB CSS (0) | — |
| richtext/RichTextEditor | 273.0 kB (+190 B) · 2.6 kB CSS (0) | — |
| lab/MobileTokenizer | 95.9 kB (+189 B) · 880 B CSS (0) | — |
| DateInput | 103.5 kB (+188 B) · 15.1 kB CSS (0) | — |
| DateRangeInput | 72.9 kB (+179 B) · 11.5 kB CSS (0) | — |
| Typeahead | 66.0 kB (+176 B) · 11.6 kB CSS (0) | — |
| lab/ChatEmojiPicker | 68.5 kB (+174 B) · 773 B CSS (0) | — |
| DropdownMenu | 76.0 kB (+173 B) · 15.4 kB CSS (0) | — |
| Pagination | 88.6 kB (+173 B) · 15.7 kB CSS (0) | — |
| lab/TransferList | 70.4 kB (+173 B) · 1.7 kB CSS (0) | — |
| lab/ChatReactionBar | 69.1 kB (+162 B) · 1.1 kB CSS (0) | — |
| lab/EmojiPicker | 66.3 kB (+162 B) · 722 B CSS (0) | — |
| MoreMenu | 76.2 kB (+153 B) · 15.4 kB CSS (0) | — |
| FieldLabel | 39.9 kB (+146 B) · 5.9 kB CSS (0) | — |
| DropdownMenuSubMenu | 61.3 kB (+143 B) · 9.9 kB CSS (0) | — |
| lab/DiffViewer | 47.0 kB (+139 B) · 2.1 kB CSS (0) | — |
| lab/TransferListSelector | 76.1 kB (+124 B) · 1.9 kB CSS (0) | — |
| PowerSearch | 173.3 kB (+111 B) · 20.3 kB CSS (0) | — |
| Tokenizer | 73.1 kB (+79 B) · 16.9 kB CSS (0) | — |
| Overlay | 19.7 kB (+32 B) · 4.0 kB CSS (0) | — |
| TreeList | 41.7 kB (+30 B) · 5.0 kB CSS (0) | — |
| Item | 12.7 kB (+28 B) · 4.9 kB CSS (0) | — |
| Token | 31.4 kB (+27 B) · 4.8 kB CSS (0) | — |
| DropdownMenuCheckboxItem | 17.6 kB (+26 B) · 5.9 kB CSS (0) | — |
| ClickableCard | 14.0 kB (+25 B) · 7.1 kB CSS (0) | — |
| DropdownMenuRadioItem | 17.7 kB (+24 B) · 5.9 kB CSS (0) | — |
| SelectableCard | 13.8 kB (+23 B) · 7.3 kB CSS (0) | — |
| DropdownMenuItem | 16.9 kB (+21 B) · 5.5 kB CSS (0) | — |
| SelectorOption | 16.0 kB (+11 B) · 5.4 kB CSS (0) | — |
| Heading | 7.9 kB (+3 B) · 6.0 kB CSS (0) | — |
| ProgressBar | 7.9 kB (+1 B) · 6.9 kB CSS (0) | — |
| Timer | 9.5 kB (+1 B) · 6.9 kB CSS (0) | — |
| ChatMessageList | 29.8 kB (0) · 7.9 kB CSS (0) | — |
| CommandPaletteInput | 33.6 kB (0) · 8.4 kB CSS (0) | — |
| Spinner | 25.5 kB (0) · 6.7 kB CSS (0) | — |
| Text | 7.4 kB (0) · 6.0 kB CSS (0) | — |
| Timestamp | 28.2 kB (0) · 9.9 kB CSS (0) | — |
| ChatToolCalls | 32.8 kB (−1 B) · 9.2 kB CSS (0) | — |
| CommandPalette | 54.0 kB (−1 B) · 12.1 kB CSS (0) | — |
Package size: @astryxdesign/core 6.56 MB packed (+2.9 kB); no new dependencies.
Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approval waits on an engineering-owner decision: no current spec defines what touchTrigger="auto" does, and this pull request widens it from the trigger itself to any ancestor control (links, buttons, <label>s, options, menu items, tabs, and rows or cards made clickable with useClickableContainer). An engineering owner needs to approve or narrow that rule and identify the spec that states it, recording the decision by commenting /approve-spec <full head SHA> on this pull request; as an engineering owner, the author may do so. Separately, the widened rule leaves the labelTooltip info icon that FieldLabel renders inside its <label> with no touch path: tapping it on FieldLabel, TextInput or Switch focuses or toggles the control and never shows the help text. That needs a fix whichever way the rule is decided, for example touchTrigger="tap" on that icon with its click kept from activating the label, plus a touch test for it.
[Automated review]
| ) { | ||
| if ( | ||
| node instanceof HTMLElement && | ||
| (isActionTrigger(node) || |
There was a problem hiding this comment.
isActionTrigger returns true for any LABEL, so this walk also treats a <label> around a trigger as the tap's destination. FieldLabel renders its labelTooltip info icon inside its <label> (packages/core/src/Field/FieldLabel.tsx:286-290) with the default touchTrigger="auto", so on a touch screen that icon no longer opens: the tap focuses the field (or toggles a Switch) and the help text has no touch path. Give that icon its own touch path (for example touchTrigger="tap" with its click kept from activating the label) or leave <label> ancestors out of this walk, and add a FieldLabel touch case.
d29ee1a to
583ffa7
Compare
There was a problem hiding this comment.
Approval waits on an engineering-owner decision: no current spec defines what touchTrigger="auto" does, and this pull request widens it from the trigger itself to any ancestor control or useClickableContainer row, card or field. An engineering owner needs to approve or narrow that rule and identify the spec that states it, recording the decision by commenting /approve-spec <full head SHA> on this pull request; as an engineering owner, the author may do so. Whichever way that goes, two touch paths need restoring first, each with a touch test:
- Tapping a disabled TextInput, TextArea, NumberInput, TimeInput or FileInput no longer shows its
disabledMessage, because the tooltip sits on the field container thatuseClickableContainermarks withdata-pressable-container, disabled or not. - Tapping the
labelTooltipinfo icon thatFieldLabelrenders inside its<label>(FieldLabel, TextInput, Switch) only focuses or toggles the control and never shows the help text.
[Automated review]
| if ( | ||
| node instanceof HTMLElement && | ||
| (isActionTrigger(node) || | ||
| node.hasAttribute(PRESSABLE_CONTAINER_ATTRIBUTE)) |
There was a problem hiding this comment.
useClickableContainer writes this mark on every container it is handed, disabled or not (useClickableContainer.ts:174-179), and useInputContainer hands it the field container of TextInput, TextArea, NumberInput and TimeInput (FileInput marks its surface itself). Those components attach their disabledMessage tooltip to that same container, so this walk returns true at the trigger itself and a tap on a disabled field no longer shows why it is disabled; focus cannot stand in on touch (useTooltip.tsx:435). Judging the trigger itself with isActionTrigger alone, and counting a marked ancestor only while its click acts, would keep the reason reachable; a touch case for disabledMessage would guard it.
There was a problem hiding this comment.
Approval waits on an engineering-owner decision: no current spec defines what touchTrigger="auto" does, and this pull request widens it from the trigger itself to any ancestor control, <label> or container marked by useClickableContainer. An engineering owner needs to approve or narrow that rule, identify the spec that states it, and confirm whether the change ships as a [fix], recording the decision by commenting /approve-spec <full head SHA> on this pull request; as an engineering owner, the author may do so. Whichever way that goes, two touch paths still need restoring first, each with a touch test:
- Tapping a disabled TextInput, TextArea, NumberInput, TimeInput or FileInput no longer shows its
disabledMessage, because the tooltip sits on the field container thatuseClickableContainermarks whether or not it is disabled. - Tapping the
labelTooltipinfo icon thatFieldLabelrenders inside its<label>only focuses the field and never shows the help text.
[Automated review]
There was a problem hiding this comment.
Approval waits on an engineering-owner decision: no current spec defines what touchTrigger="auto" does, and this pull request widens it from the trigger itself to any ancestor control, <label> or container marked by useClickableContainer. An engineering owner needs to approve or narrow that rule, identify the spec that states it, and confirm whether the change ships as a [fix], recording the decision by commenting /approve-spec <full head SHA> on this pull request; as an engineering owner, the author may do so. Whichever way that goes, two touch paths still need restoring first, each with a touch test:
- Tapping a disabled TextInput, TextArea, NumberInput, TimeInput or FileInput no longer shows its
disabledMessage, because the tooltip sits on the field container thatuseClickableContainermarks whether or not it is disabled. - Tapping the
labelTooltipinfo icon thatFieldLabelrenders inside its<label>only focuses the field and never shows the help text.
[Automated review]
There was a problem hiding this comment.
Approval waits on an engineering-owner decision: no current spec defines what touchTrigger="auto" does, and this pull request widens it from the trigger itself to any ancestor control, <label> or enabled useClickableContainer row or card, and makes a click on the labelTooltip icon stop activating its label for every pointer, including a mouse. An engineering owner needs to approve or narrow both changes, identify the spec that states the auto rule, and confirm whether the change ships as a [fix], recording the decision by commenting /approve-spec <full head SHA> on this pull request; as an engineering owner, the author may do so. The two touch regressions from the previous round (disabledMessage and the label help) are fixed on this head, and one docs correction is needed whichever way the decision goes:
Field.doc.mjsandFieldLabel.doc.mjs(both languages) say a click on thelabelTooltipicon shows the help, but a mouse press hides it, so describe hover and tap instead.
[Automated review]
| type: 'string', | ||
| description: 'Tooltip text for the info icon after the label.', | ||
| description: | ||
| 'Tooltip text for the info icon after the label. A tap on the icon opens it on a touch screen, and a tap or click on the icon shows the help only: it does not focus the field or toggle the control.', |
There was a problem hiding this comment.
This says a click on the icon shows the help, but a mouse press on a Tooltip trigger hides an uncontrolled tooltip (Tooltip/useTooltip.tsx:454-472), so on a desktop the click closes the help that hover opened and, with the cancelled label activation, does nothing else. Describe hover and tap instead (for example: hover shows the help, a tap opens it on a touch screen, and a tap or click on the icon never focuses the field or toggles the control), and match Field.doc.mjs:124 and the Chinese entry at :181.
There was a problem hiding this comment.
Approval waits on an engineering-owner decision: no current spec defines what touchTrigger="auto" does, and this pull request widens it from the trigger itself to any ancestor control, <label> or enabled useClickableContainer row or card, and makes a click on the labelTooltip icon stop activating its label for every pointer, including a mouse. An engineering owner needs to approve or narrow both changes, identify the spec that states the auto rule, and confirm whether the change ships as a [fix], recording the decision by commenting /approve-spec <full head SHA> on this pull request; as an engineering owner, the author may do so. Whichever way that goes, the docs need correcting:
Field.doc.mjsandFieldLabel.doc.mjs(both languages) say a click on thelabelTooltipicon shows the help, but a mouse press hides it, so describe hover and tap instead.- If the widened rule is approved, the HoverCard guidance "Leave touchTrigger on auto so a tap opens the card on triggers that do nothing else" (three entries in
HoverCard.doc.mjs) must change with it.
[Automated review]
| type: 'string', | ||
| description: 'Tooltip text for the info icon after the label.', | ||
| description: | ||
| 'Tooltip text for the info icon after the label. A tap on the icon opens it on a touch screen, and a tap or click on the icon shows the help only: it does not focus the field or toggle the control.', |
There was a problem hiding this comment.
This says a click on the icon shows the help, but a mouse press on a Tooltip trigger hides an uncontrolled tooltip (Tooltip/useTooltip.tsx:459-478), so on a desktop the click closes the help that hover opened and, with the cancelled label activation, does nothing else. Describe hover and tap instead (for example: hover shows the help, a tap opens it on a touch screen, and a tap or click on the icon never focuses the field or toggles the control), and match Field.doc.mjs:124 and the Chinese entry at :181.
22d9d2d to
d21a875
Compare
There was a problem hiding this comment.
Changes requested: the current Tooltip and HoverCard component records define touchTrigger="auto" as opening on a tap "unless the trigger performs its own action", so keeping the layer shut for a trigger that only sits inside a link, button, label, option or clickable row or card replaces that recorded contract rather than restoring it, and cancelling every click on the labelTooltip icon changes FieldLabel's recorded native label activation. Please keep auto judged by the trigger and let label clicks activate the control, or treat the wider rule as a change to those records that an engineering owner proposes and approves first; a [fix] patch changeset does not fit replacing a documented contract.
- The new
labelTooltipdocs say a click on the info icon shows the help, but a mouse press closes an uncontrolled tooltip, so they should describe hover and tap instead.
[Automated review]
| const mode = | ||
| touchTrigger === 'auto' | ||
| ? trigger != null && isActionTrigger(trigger) | ||
| ? trigger != null && tapHasDestination(trigger) |
There was a problem hiding this comment.
This swaps the trigger-only check for the ancestor walk. The current component:Tooltip and component:HoverCard records define auto as opening on a tap "unless the trigger performs its own action", so a trigger that only sits inside a link, option or clickable row/card is one these records open. Keeping isActionTrigger(trigger) here conforms; widening the rule is a change to those records.
| icon="info" | ||
| size="sm" | ||
| color="inherit" | ||
| onClick={preventLabelActivation} |
There was a problem hiding this comment.
preventDefault here runs for every pointer, so a mouse click on the info icon no longer focuses the field or toggles a Switch (checked in Chromium: the base turns Auto-save on, the head leaves it off). component:FieldLabel records native label activation as shipped behavior.
| type: 'string', | ||
| description: 'Tooltip text to display in an info icon at the end of the label.', | ||
| description: | ||
| 'Tooltip text to display in an info icon at the end of the label. A tap on the icon opens it on a touch screen; a tap or click on the icon shows the help without focusing the field.', |
There was a problem hiding this comment.
A mouse press on an uncontrolled Tooltip's trigger closes it (useTooltip.tsx:459-478, component:Tooltip FR6), so a click on the icon hides the help that hover opened rather than showing it. Describe hover and tap instead; the same wording is in FieldLabel.doc.mjs:76 and :181.
d21a875 to
c826904
Compare
There was a problem hiding this comment.
Approval waits on an engineering-owner decision. This pull request amends the current Tooltip and HoverCard records so that, under touchTrigger="auto", a tap on a trigger inside a link, button, label, option, menu item, tab, or clickable row, card or input container goes only to that control. An engineering owner needs to approve or narrow DEC-1 and the reworded FR5, including whether the interaction-modality rule that touch can reach every supported interaction gets this exception, by commenting /approve-spec <full head SHA>; the author may do so as an engineering owner. Whichever way that goes, a few fixes are needed:
- On this head the
labelTooltipinfo icon insideFieldLabel's<label>has no tap path, so land #9089 first, or carry itstouchTrigger="tap"here with a touch test. - Callers must add
touchTrigger="tap"to keep a documented tap-open inside a control (andTextandAvatarcannot), so the[feat]patch changeset and the "Released default preserved:yes" rows need reclassifying under the compatibility policy. - The three HoverCard "Leave touchTrigger on auto" guidance entries should match the new rule, and so should DEC-1 and FR5, which do not list the disabled controls, tabs and input containers the walk counts.
[Automated review]
| * | ||
| * Exported for its unit test only; Layer/index.ts does not re-export it. | ||
| */ | ||
| export function tapHasDestination(trigger: Element): boolean { |
There was a problem hiding this comment.
isActionTrigger is true for any LABEL, so this walk also keeps shut the labelTooltip info icon that FieldLabel renders inside its <label> (Field/FieldLabel.tsx:287-290). With real touch on Switch, the base shows the help and this head only toggles the switch. Land #9089 first, or carry its touchTrigger="tap" on the icon here, with a FieldLabel touch case.
| ) { | ||
| if ( | ||
| node instanceof HTMLElement && | ||
| (isActionTrigger(node) || |
There was a problem hiding this comment.
isActionTrigger never reads disabled or aria-disabled, so a hint inside a disabled option, menu item or tab now stays shut on a tap that activates nothing. In jsdom, a Tooltip inside role="option" aria-disabled="true" opens on the base and stays shut here. DEC-1 exempts only the hook's "disabled" mark. Skip :disabled and [aria-disabled="true"] ancestors, or record that they count.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] Tooltip and HoverCard: a tap on a trigger that sits inside a control goes to that control alone. On a touch screen, tapping a truncated `Link` followed the link and also opened the truncation tooltip, and tapping a truncated ID or a name avatar on a `ClickableCard` or a clickable list row opened the card and the tooltip at once, so one tap did two things and left a tooltip over whatever the control opened. With `touchTrigger="auto"` (the default), a tap now leaves the layer shut when the trigger performs an action or sits inside something that does: a link, a button, a label, an option or menu item, or a row or card made clickable with `useClickableContainer`. A truncated label in running text still opens its tooltip on a tap, `touchTrigger="tap"` still always opens, and mouse hover is unchanged. A disabled field or card takes no tap, so a tap on a disabled field still shows its `disabledMessage`. |
There was a problem hiding this comment.
A caller who put an info-icon Tooltip inside a checkbox <label> or a ClickableCard gets the help on a tap in 0.7.5. On this head they have to add touchTrigger="tap" to keep it, and Text and Avatar tooltips cannot be restored at all. Under AST-017 FR1 that is breaking (FR6: approval does not change it), so a [feat] patch does not fit. It needs [breaking] in a declared minor, with that migration.
| - Released default preserved: `yes` | ||
| - Compatibility class: records shipped behavior; runtime, DOM, styling, | ||
| targets, and public API remain unchanged | ||
| - Released default preserved: `yes`; DEC-1 narrows when the `auto` default opens |
There was a problem hiding this comment.
This says the released default is preserved, while DEC-1 narrows what that default does and the migration row names touchTrigger="tap" as the way back. Those can't all be true. State the narrowing as a compatibility change (the same row is in HoverCard.spec.md:59).
| type: "'auto' | 'tap' | 'none'", | ||
| description: | ||
| 'What a tap does where there is no hover. auto opens on tap unless the trigger performs an action of its own (a button, link, or form control), whose tap belongs to the control. tap always opens. none never opens on touch. A tap-opened card is dismissed by a tap outside it.', | ||
| 'What a tap does where there is no hover. auto opens on tap unless the tap already performs an action, either the trigger itself (a button, link, or form control) or a control it sits inside (a link, an option, a clickable row or card), whose tap belongs to that control. tap always opens. none never opens on touch. A tap-opened card is dismissed by a tap outside it.', |
There was a problem hiding this comment.
The guidance at :170, :349 and :401 still says "Leave touchTrigger on auto so a tap opens the card on triggers that do nothing else". With this rule, a name in a clickable row or card does nothing else, and its card stays shut. Update those entries with the rule.
|
/approve-spec a0138b1 |
There was a problem hiding this comment.
Changes requested: the approved touchTrigger="auto" direction is in place and disabled Button and menu-item reasons now open on a tap, but two things need fixing before this lands.
- A tap inside a default
Overlaynow opens the hover layer of an enclosing link or action while the link still runs, becauseuseOverlaywrites the new"disabled"container mark whenever it simply takes no click; please make that mark mean disabled and add the Overlay case totouchTriggerTargets.test.tsx. - FR5, the
touchTriggerdocs and the changeset say a tap on a nativelydisabledcontrol opens its reason, but browsers send noclickto a disabled control, so it still opens nothing (including a caller's<Tooltip>around<Button isDisabled>withouttooltip); please narrow the wording toaria-disabledcontrols and labels for disabled controls, and drop the row-or-card "now".
A new commit needs a fresh /approve-spec <full head SHA> from an engineering owner, and rebasing onto main should let the Storybook job and interaction proofs run.
[Automated review]
| el.setAttribute('data-pressable-container', 'true'); | ||
| el.setAttribute( | ||
| PRESSABLE_CONTAINER_ATTRIBUTE, | ||
| disabled ? 'disabled' : 'true', |
There was a problem hiding this comment.
useOverlay passes disabled: !needsTouchToggle, so every default (showOn="always") Overlay gets "disabled" here, and tapLandsOnDisabledControl reads it as a disabled container. With real touch, a Tooltip on a link that wraps an Overlay now opens on a tap while the link is still followed. Could this mark be written only for a truly disabled container (or the walk dropped, since the isActionTrigger change covers every reproduced case)?
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] Tooltip and HoverCard: a tap on a disabled `Button`, `IconButton` or `ToggleButton`, or a disabled menu item, now opens the tooltip that explains why it is disabled, and nothing activates. Before, with `touchTrigger="auto"` (the default), the tap counted as the control's own action, so on a touch screen the disabled reason could not be reached (`spec:AST-085` FR5, `architecture:interaction-modality` INV4). A disabled or `aria-disabled` control now performs no action, also when the tap lands in a label for one or in a clickable row or card marked disabled. Taps on enabled controls, `touchTrigger="tap"` and `"none"`, and mouse hover are unchanged. |
There was a problem hiding this comment.
A tap on a natively disabled control gets no click in the browser, so its reason still does not open, including a caller's <Tooltip> around <Button isDisabled> without tooltip (it renders native disabled). A disabled field inside a clickable card already opened before this change. Suggest naming aria-disabled controls and labels for disabled controls only.
a0138b1 to
3db2fc4
Compare
|
/approve-spec 3db2fc4 |
There was a problem hiding this comment.
Changes requested: the owner-approved disabled-reason tap works (a tap on a disabled Button, IconButton, ToggleButton or menu item now shows its reason and nothing runs), but three small fixes remain, and the new commit will need a fresh /approve-spec <head SHA> from an engineering owner, which the author may give as one.
isDisabledControlinLayer/useTouchTrigger.tsrepeats the one ingestures/haptics.ts, so move it to one shared utility (for exampleutils/disabledInteraction.ts) and import it in both.- The changeset does not mention that a tap on a disabled control inside another trigger that acts (an option row, a link-role card) now also opens that trigger's own tooltip or hover card, so please add it.
HoverCard.spec.mdcitestouchTriggerTargets.test.tsx, which has no HoverCard case, so add one or drop the citation.
[Automated review]
| * Whether this element is a disabled control: `aria-disabled="true"`, or a | ||
| * form control the browser counts as `:disabled`. | ||
| */ | ||
| function isDisabledControl(element: Element): boolean { |
There was a problem hiding this comment.
This repeats isDisabledControl in gestures/haptics.ts (same name, same :disabled or aria-disabled="true" check). Could both import one shared predicate, for example from utils/disabledInteraction.ts, so the two never disagree about a control?
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] Tooltip and HoverCard: a tap on a disabled `Button`, `IconButton` or `ToggleButton`, or a disabled menu item, now opens the tooltip that explains why it is disabled, and nothing activates. Before, with `touchTrigger="auto"` (the default), the tap counted as the control's own action, so on a touch screen the disabled reason could not be reached (`spec:AST-085` FR5, `architecture:interaction-modality` INV4). An `aria-disabled` control now performs no action, and a tap on a label for a disabled control opens its reason too. Taps on enabled controls, `touchTrigger="tap"` and `"none"`, and mouse hover are unchanged. |
There was a problem hiding this comment.
A tap on a disabled control inside another trigger that acts (an option row, a role="link" card) with its own Tooltip or HoverCard now opens that trigger's layer too, which FR5 allows, but this changeset names only the control's own reason and the closing "unchanged" line reads as covering the enclosing trigger. Suggest naming that case.
| | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------- | | ||
| | FR1, FR2, FR8 | `HoverCard.test.tsx` render, wrapper, portal, theme font, and SSR tests | Text and element triggers; default open | A stray target, lost font, or hydration mismatch fails. | `audit:HoverCard/anatomy` | | ||
| | FR3, AR1 | `HoverCard.test.tsx` role and trigger-attribute tests | Labelled and unlabelled; supported and unsupported roles | Wrong role, or trigger attributes that are not replaced and restored as stated, fail. | `audit:HoverCard/accessibility` | | ||
| | FR4–FR6, AR2 | `HoverCard.test.tsx` hover, Escape, refocus, and touch tests; `useTouchTrigger.test.ts` disabled-control cases; `touchTriggerTargets.test.tsx` | Hover, focus, tap, Escape from trigger and content | A card that cannot be reached or dismissed fails. | `audit:HoverCard/behavior` | |
There was a problem hiding this comment.
touchTriggerTargets.test.tsx has no HoverCard case, so this row (and verified_by) cites a test that never exercises HoverCard. Add a HoverCard on a disabled Button there, or drop the citation.
…9175) ## Exact decision needed How a person on touch, keyboard, or a screen reader keeps a tooltip open long enough to read it, and how an info icon offers that help. Today the help behind an info icon, a field label's info icon, or a status dot opens on hover, and a tap opens it when the trigger performs no action (the default `touchTrigger="auto"`) or always with `touchTrigger="tap"`; but a scroll or a tap elsewhere closes it, no mouse or keyboard press keeps it open, and neither the field label's icon nor the status dot can be reached with Tab. ## Existing authority searched - `component:Tooltip`, `component:HoverCard`: hover, focus, and tap opening (`touchTrigger` `auto` | `tap` | `none`); no press-to-pin for a mouse or keyboard. - `spec:AST-003` FR4: every Tooltip is passive in Escape order, so a tooltip someone chose to keep open could not take Escape before a Dialog beneath it. - `component:FieldLabel` FR8, AR5: the label tooltip must be keyboard-reachable through a named trigger; the shipped icon is neither. - `component:StatusDot` FR5: an info-only trigger whose information lives only in its tooltip, with no keyboard path. - Lab `InfoTip`: a named button around Tooltip with `touchTrigger="tap"`; no Core record. - `architecture:public-component-api` INV9, INV21; `spec:AST-017` FR28–FR29d (deprecation, codemods); `spec:AST-094` FR42 (touch hit area); `component:MoreMenu` (a component built entirely on another). - Open work: #8207's contract change (a tap that already acts stays with its control) is folded into this pull request's Tooltip and HoverCard DEC-1; its implementation lands separately. FieldLabel's FR9 and DEC-1 (a finger or pen tap on the info icon opens its help) are current; this pull request amends both in place so a tap, click, or key press on the info trigger never activates the control. - `architecture:interaction-modality` INV4: every modality has an operable path; it said nothing about a tap on an action trigger that also carries a tooltip. No current record lets a mouse or keyboard press keep a tooltip or hover card open, or says what an info icon is. ## Decision User impact: people on a phone, a keyboard, or a screen reader can open the help behind an InfoTip, a field label's info button, or a standalone StatusDot, keep it open while they read, and close it; a StatusDot inside a button, link, menu item, or option tells screen-reader users its status through the host's accessible name; and asking what a setting does never changes the setting. - **Tooltip and HoverCard pin on a press.** A new prop, `pressTrigger: 'none' | 'toggle'` (default `'none'`), on `Tooltip`, `HoverCard`, `useTooltip`, and `useHoverCard`. With `'toggle'`, hover and keyboard focus still preview the layer; a click, tap, Enter, or Space on a button trigger pins it open; Escape, a second press, a press outside, or focus moving away closes it; a pinned layer stays open when the pointer leaves. The trigger carries `aria-expanded` (true only while pinned) and `aria-controls`, and the layer is announced once through a polite live region when it pins. A trigger whose role is not `button` gets a development warning and keeps tap-only opening. A controlled layer reports the toggled value through `onOpenChange` (`component:Tooltip` FR9, FR10, AR6, DEC-1; `component:HoverCard` FR9, FR10, AR3, DEC-1). - **A pinned layer takes Escape first.** `spec:AST-003` FR4 and DEC-6: an unpinned Tooltip stays passive and never wins or blocks Escape; a Tooltip or HoverCard pinned by a press is an active owner, so Escape closes it before the Dialog beneath it. - **A closing pinned layer gives up Escape.** `spec:AST-090` FR5: a leaving unpinned Tooltip stays passive; a pinned Tooltip or HoverCard that is closing plays its exit and leaves the dismissal stack when the exit starts, so the member beneath takes the next Escape. Its layer-runtime and overlay-dismissal impact lines carry the same exception. - **InfoTip is the info preset.** New `component:InfoTip` in Core: a named button with the registry's info icon, wrapped in Tooltip with `pressTrigger="toggle"`, with no layer, listener, or dismissal rule of its own. Props: `content`, `label` (a translated "More information" by default), and `size` (`sm`). It is one API with Tooltip under INV21, as MoreMenu is with DropdownMenu. - **A tap that already acts stays with its control.** Components declare `pressTrigger="toggle"` where the layer is the only home of their information. Under `touchTrigger="auto"`, the fallback until the fold, a tap that already acts does not open the layer: walking out from the tapped element, the innermost control decides (a button, link, label, form control, option, menu item, or clickable row or card, the trigger included), and a disabled or `aria-disabled` control is not an action, so its reason opens on a tap. A role-less `onClick` element needs a role (`component:Tooltip` FR5, DEC-1; `component:HoverCard` FR5, DEC-1). - **Action triggers never open on a tap.** `architecture:interaction-modality` INV4: a tooltip that labels an action trigger whose accessible name already carries its text is not a separate interaction, so a tap performs the action; hint-only information is reachable on touch through `pressTrigger="toggle"`. - **Own-text triggers may toggle without being buttons.** A trigger whose tooltip repeats its own visible text, such as a truncated Text that is its own tab stop, may take `pressTrigger="toggle"` with no development warning, no `aria-expanded` or `aria-controls`, and no announcement (`component:Tooltip` FR9). - **FieldLabel's info icon becomes an InfoTip.** `labelTooltip` renders an InfoTip after the label element, outside it, named with the label text ("About Auto-save"). FR9 and DEC-1 are amended in place: a tap, click, Enter, or Space on it toggles the help and never activates, focuses, or toggles the control, reversing the mouse-click activation FR9 kept. With a `labelTooltip`, one inline-flex row wraps the label element and the InfoTip, as FieldLabel already wraps the label and description; callers see that extra wrapper only when `labelTooltip` is set, and their class, `xstyle`, and ref stay on the label element. With `isLabelHidden`, the InfoTip is visually hidden with the label, takes no layout space, and becomes visible while it has keyboard focus. FR8, AR5, and the mouse-click part of FR9 stay implementation gaps until this is built (`component:FieldLabel` FR8, FR9, AR5, DEC-1). - **StatusDot declares the toggle when standalone.** A standalone dot with a tooltip becomes a button named by its label inside Tooltip with `pressTrigger="toggle"`, adopted no later than FR5's walk ships, so its tooltip is reachable on touch and by keyboard; under a coarse pointer it reaches 44 px through the shared invisible hit area where its neighbors leave room (AST-094 FR42, `component:StatusDot` AR2). A dot inside a button, link, menu item, or option stays an image whose tooltip previews on hover only; sighted touch users lose its visible tooltip text there, and its status reaches screen-reader users through the host's accessible name, since a control cannot nest another control; a host named by `aria-label` includes the status in that label (`component:StatusDot` FR5, AR1, AR2). - **Overlay dismissal follows.** `family:overlay-dismissal` FR8 and its Escape table: an unpinned Tooltip never wins or blocks Escape; a pinned Tooltip or HoverCard takes it first. ### Migration notes - FR5's walk (under the default `touchTrigger="auto"`, a tap that already acts on a control around the trigger does not open the layer) needs app code where a hint-only trigger sits inside a control, so it is breaking under AST-017 FR1 and ships with CLN-0024 in the next minor. No caller's behavior changes in a patch: until then `auto` keeps its released behavior, except that a disabled control's reason opens on a tap, which ships separately as #8207's patch `[fix]`. Hint-only triggers inside controls migrate by declaring `pressTrigger="toggle"`; InfoTip, FieldLabel's info button, and StatusDot do so before the minor. - `touchTrigger="tap"` is deprecated in the same release that adds `pressTrigger` (`component:Tooltip` DEP-0016), with static `@deprecated` metadata and no runtime warning. When both are given, `pressTrigger="toggle"` wins. - A codemod ships through the existing `astryx upgrade` path, staged in `packages/cli/assets/codemods/transforms/next/` with tests and fixtures and checked by the codemod verify workflow, in the release that deprecates `tap`: it rewrites `touchTrigger="tap"` to `pressTrigger="toggle"` only where the trigger is statically a non-interactive icon or span, where the result is observably the same because Tooltip FR9 keeps a non-button toggle trigger on tap-only opening; it reports every other `tap` site (an own-text trigger, a button, a link, or an unknown element) with a manual-migration note and leaves it unchanged, since the toggle changes what a click, Enter, or Space does there (and on a button adds `aria-expanded`); it removes `touchTrigger="auto"` and reports spreads and dynamic values. The deprecated `tap` keeps working until the minor. - At the next minor, `touchTrigger` folds into `pressTrigger` and is removed (CLN-0024): `pressTrigger` takes `auto` | `toggle` | `none`, default `auto`, where `auto` is today's `touchTrigger="auto"` and `none` is today's `touchTrigger="none"`. Each remaining `touchTrigger="tap"` site gets a named replacement there: a button or link whose only job is its tooltip takes `pressTrigger="toggle"` (it keeps its touch path); a button or link with its own action whose accessible name already carries the layer's text drops `tap` and takes `auto` (a tap performs the action and opens no layer); any other button or link with its own action moves the layer's information to an adjacent InfoTip (or another info trigger with `pressTrigger="toggle"`) or into its visible label, then drops `tap`; a trigger whose tooltip repeats its own text takes `pressTrigger="toggle"`; an unknown element is reported for a manual choice. That minor's codemod rewrites `touchTrigger="none"` to `pressTrigger="none"`, removes `touchTrigger="auto"` and today's explicit `pressTrigger="none"`, keeps `pressTrigger="toggle"`, rewrites own-text sites it can identify, reports every button and link `tap` site with all three options in its note (no static check tells them apart), and reports every other remaining `tap` site and dynamic value. - Lab `InfoTip` callers change the import to `@astryxdesign/core`; the Lab export stays one release as a deprecated re-export. ## Rejected alternatives - A new general Toggletip component: its hover preview of text or a card would repeat Tooltip and HoverCard (INV21). - Widening `touchTrigger="tap"` to also pin on a mouse click and keys: a touch-named prop would then govern mouse and keyboard. ## Claim scope and non-goals - Records only: no implementation, docs, or codemod in this pull request; consumer docs change with the build. - StatusDot's adoption is recorded here; any other component adopting `pressTrigger="toggle"` is a follow-up under its own record. - Not covered: a truncated label inside a link or button, where a tap belongs to the control. ## Evidence and implementation relationship - The owner chose this option from a comparison of three: this one, the toggle on Tooltip and HoverCard without InfoTip, and a new general Toggletip. The records stand without that comparison. - Implementation follows in separate pull requests; every new requirement is marked as an implementation gap with an evidence gap in its verification row until then. ## Writing rubric results Run over `component:Tooltip`, `component:HoverCard`, `component:FieldLabel`, `component:StatusDot`, the new `component:InfoTip`, `spec:AST-003`, `architecture:interaction-modality`, `family:overlay-dismissal`, and `spec:AST-090`, and `spec:AST-082` (FR3's example now names `pressTrigger`). - R1 narration: AST-090's amended lines state the system in the present tense; one found elsewhere, FieldLabel's compatibility line said a press "no longer" activates the control; rewritten as "does not". The Compatibility lines compare FR5 with the released `auto`, which the template asks for. DEP-0016's `state: proposed` is the lifecycle field value, not narration. - R2 research in the record: none; the options comparison lives in the linked artifact, and each record keeps one sentence of conclusion inside its DEC. - R3 evidence naming a change: none; new basis cells cite DEC-1, WCAG, WAI-ARIA, and the HTML label content model, and new verification cells name test files or an evidence gap. - R4 rejected alternatives over one line or outside a decision: six, each one line inside its decision (two in Tooltip DEC-1, one each in HoverCard DEC-1, InfoTip DEC-1, FieldLabel DEC-1 (amended), and AST-003 DEC-6). - R5 pull request or issue references remaining: none in the records. - R6 ruled open questions still listing options: none; FieldLabel's OQ1 is unrelated, unanswered, and unchanged. ## Scope - [x] This PR contains specification records only. - [x] It records observable behavior and preserves equivalent internal implementations. - [x] Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract. - [x] Verification states the evidence layer and failure signal without prescribing CI job/workflow topology. - [x] It records one intentional durable decision, not a rescue for a separable tagalong. - [x] The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision. - [x] Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them. - [x] Public text and artifacts contain no internal Meta context. ## Validation - `pnpm check:knowledge`: "Knowledge templates and records are aligned." - `pnpm check:repo`: passes. - Prettier on the ten records. - `git diff --check`: clean.
…w without raising the keyboard (#9189) <!-- Use this template only when the primary intent is to restore broken behavior. --> ## User impact On a phone, a tap on a pasted-text token in `ChatComposerInput` opens its preview and also raises the keyboard over it, because the composer around the token takes focus. On the iOS 26.2 simulator the keyboard covers all but the preview's first two lines. ## Problem and solution fit The token sits inside the editable composer, and the mouse press the browser makes of a tap focuses it, so the keyboard hides the preview the tap opened. A finger or pen tap now stops at the token: the token cancels that mouse press, so focus and caret stay put while the click still opens the preview. Cancelling the pointer press instead was rejected because WebKit then drops the click. With a mouse, a click still places the caret, and hover opens the preview. ## Expected behavior and authority - `spec:AST-017` FR53: a patch `[fix]` serving `architecture:interaction-modality` INV4 (every modality has an operable path). Today the touch path to the preview is blocked, because the keyboard covers it. No prop, type, default, export or DOM changes. - `spec:AST-017` FR59: fine-pointer behavior is unchanged. - No record describes the token's tap or focus (`component:ChatComposerInput` covers paste-as-token conversion only), so no record changes. ## Smallest restoration - The stop lives in one helper, `useTapStop` in `Layer/useTouchTrigger.ts` beside `TOUCH_POINTER_TYPES`, which takes the event to cancel. The token uses `mousedown`. FieldLabel's info icon had its own copy of the same tracking for `click`, and now calls the helper in a one-line swap, with no behavior change. `useTapStop` is internal, not re-exported from the Layer index. - The card's tap still opens through the default `touchTrigger`, which already resolves to a tap for this trigger; no tap opt-in is added. - Prior art: I checked every open pull request's diff of these files, and searched for `touchTrigger` and `pressTrigger`. #7358 (per-component English slices) edits this file's i18n import and translator line; whichever lands second keeps both. #8207 and #9175 change tap triggers but not this file. ## Evidence - **Reproduction before the change:** iOS 26.2 simulator (iPhone 17 Pro, Mobile Safari), `Core/ChatComposerInput` Controlled with a 314-character paste, one finger tap on the token, checked frame by frame. In 7 of 7 takes the preview opened, and 130–200 ms later the keyboard rose over it (visual viewport 714 → 377 pt). Chromium and WebKit with touch show the same focus and caret. - **Result after the change:** 5 of 5 takes opened the preview with the keyboard down (714 pt) and no focus or caret in the composer; Chromium and WebKit agree. - **Representative unchanged path:** a tap on the composer's own text raises the keyboard and places the caret in both builds. With a mouse, hover opens the preview and a click places the caret. - **Regression tests:** - The browser spec fails on main in Chromium and WebKit, after first checking that one painted token and one composer are on the page. - The finger and pen unit cases fail with main's component. - With `useTapStop` made to cancel nothing, both the token's and FieldLabel's finger and pen tap cases fail. `useTouchTrigger.test.ts` covers the helper itself. - Stress on the tap specs: Chromium on two cores ×24 120/120; WebKit at 3 CPUs ×20 with 16 workers 60/60 and ×10 with one worker 30/30; the WebKit CI job's profile (4 CPUs, one worker) ×10 30/30. ## Scope - [x] One defect is restored. - [x] Separable contradictory or unsettled tagalongs were removed or split. - [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label. - [x] Public text and artifacts contain no internal Meta context. ## Testing - `pnpm exec vitest run --project ui packages/core/src/Chat/ChatPastedTextToken.test.tsx packages/core/src/Field/FieldLabel.test.tsx packages/core/src/Layer/useTouchTrigger.test.ts` - `pnpm exec playwright test --config playwright.config.ts --project chromium packages/core/src/Chat/__tests__/ChatPastedTextTokenTap.a11y.browser.spec.ts` against a built Storybook, and the same spec with `--project=webkit` through the WebKit container script. Local gates at eb86569: prettier, eslint, the harness typecheck, the root build, the UI project, and the node project. In the node project only `cache.test.mjs`'s two process-timing cases fail, and they fail on main too under this machine's load. The token and FieldLabel tap specs pass in Chromium and WebKit.
3db2fc4 to
b81e650
Compare
|
Fixed in b81e650: one shared |
|
/approve-spec b81e650 |
There was a problem hiding this comment.
Recommend approval: on touch screens a disabled Button, IconButton, ToggleButton or menu item now shows its reason on a tap with nothing activating, the new tests fail on main and pass here, and an engineering owner approved the Tooltip and HoverCard records at this head. A few optional follow-ups:
- When a disabled control with its own tooltip sits inside an option row or card that has its own Tooltip, one tap opens both and the row's covers the reason; it is worth deciding which layer wins.
tapLandsOnDisabledControlcan walk past an enabled trigger thatisActionTriggercounts as an action (amenuitemradio, a contenteditablerole="textbox") when a disabled ancestor sits above it; acceptingisActionTriggerelements in the walk's test closes that.- The HoverCard case named "… and nothing activates" never asserts it, and its plain
aria-disabledbutton does runpublish.
[Automated review]
| export function tapLandsOnDisabledControl(tapped: Element): boolean { | ||
| const innermost = innermostInteractive( | ||
| tapped, | ||
| null, | ||
| element => | ||
| matchesInteractiveSelectors(element) || | ||
| element.tagName === 'LABEL' || | ||
| isDisabledControl(element), | ||
| ); | ||
| return innermost != null && isDisabledTarget(innermost); | ||
| } |
There was a problem hiding this comment.
Non-blocking: this walk accepts INTERACTIVE_SELECTORS, labels and disabled elements, but not every element isActionTrigger counts as an action (menuitemcheckbox, menuitemradio, textbox, searchbox, contenteditable, aria-readonly controls). Such a trigger is skipped, so a disabled ancestor above it decides: in jsdom a Tooltip on a contenteditable role="textbox" inside <fieldset disabled>, or on an enabled menuitemradio inside a role="group" aria-disabled="true", now opens on a tap that also acts, where main keeps it shut. Accepting isActionTrigger elements in the test (or stopping the walk at the trigger) keeps those taps with the trigger.
| }); | ||
|
|
||
| describe('HoverCard: a disabled control performs no action', () => { | ||
| it('a tap on an aria-disabled trigger opens its hover card, and nothing activates', async () => { |
There was a problem hiding this comment.
Non-blocking: the name says "and nothing activates", but the case never asserts it, and this plain <button aria-disabled="true" onClick={publish}> does run publish on the tap. Drop the clause or render a control that cancels its click and assert publish was not called.
A disabled or aria-disabled control performs no action. With touchTrigger="auto", a tap whose innermost interactive element is a disabled control, a label for one, or a clickable container marked disabled now opens the tooltip that explains why, and nothing activates; every other tap is still the trigger's to decide. The walk is useClickableContainer's own (innermostInteractive, which hasInteractiveAncestor now uses), and useClickableContainer marks a disabled container "disabled". Disabled Button, IconButton and ToggleButton reasons, and a disabled menu item's, now open on a tap.
b81e650 to
952974c
Compare
|
/approve-spec 952974c |
There was a problem hiding this comment.
Recommend approval: on a touch screen, a tap on a disabled Button, IconButton, ToggleButton or menu item now opens the tooltip that explains why, with nothing activating, as the Tooltip and HoverCard records' patch exception describes, and an engineering owner approved the reworded FR5 and DEC-1 at this head. Two optional follow-ups:
- Inside an acting row that has its own tooltip, one tap on a disabled control with its own tooltip opens both, and the row's covers the reason.
- The tap walk in
useTouchTrigger.tsdoes not stop at every roleisActionTriggertreats as an action (menuitemcheckbox,textbox, contenteditable), so a disabled ancestor can decide for them.
[Automated review]
# Conflicts: # packages/core/src/HoverCard/HoverCard.spec.md # packages/core/src/Tooltip/Tooltip.spec.md
…ate the card, row or field around it (#9252) * fix(Tooltip, HoverCard): a press inside an open surface stays in the surface component:Tooltip FR11 and component:HoverCard FR11: a press inside an open surface acts only within it, never on the trigger, a clickable container around it, or the control a label names. React bubbles a click on the surface to the trigger's ancestors even when the surface is portaled, so a click on a FileInput status tooltip's text opened the file picker. Each surface's content now stops the click. Tests: a click on tooltip or card content does not reach a clickable container (the trigger's own click still does); a card's own button keeps working; inside a label the control is not toggled; FileInput compact and dropzone status tooltips open no picker while a surface click still does. Browser: FileInputTooltipPress.a11y.chromium.spec.ts checks the same with real file-chooser events. * fix(Tooltip, HoverCard): a middle-button press on the surface stays too; FR11 rows have three cells useClickableContainer opens a ClickableCard's href in a new tab on a middle-button mouseup, so the surface content stops mouseup as well as click. Tests: a middle mouseup on tooltip or card text reaches no container. The FR11 rows lose a fourth cell their three-column tables never rendered. * test(FileInput): the tooltip-press browser spec also runs when Tooltip changes * fix(Tooltip, HoverCard): the stopPropagation helper sits below the hook so the hook keeps its JSDoc * Merge main (af268d3, with #8207's FR5) into the surface-press fix # Conflicts: # packages/core/src/HoverCard/HoverCard.spec.md # packages/core/src/Tooltip/Tooltip.spec.md * Merge main (e0a0376, with #9007's spec move) * fix(Tooltip, HoverCard): mark a surface press instead of stopping it, so document listeners still see it Stopping the click at the surface also ended the native event at the React root, so a Typeahead inside an open HoverCard no longer opened. The surfaces now mark the press (a module-private WeakSet), and useClickableContainer — which FileInput, ClickableCard and Item rows use — leaves a marked click or middle-button mouseup alone. FR11 states that page-level listeners still receive the press. Tests: ClickableCard with onClick and with href ignores a click or middle mouseup on tooltip or hover-card content; document listeners still get the click; FileInput opens no picker from tooltip text. With main's useClickableContainer, six of these fail. * fix(Tooltip, HoverCard): the shared interactive-ancestor walk treats an open surface as something else Only useClickableContainer read the per-event mark, so Item rows with onClick, TreeList rows and Table row-click rows still ran on a click on tooltip text. The surfaces now register their content element, and hasInteractiveAncestor, which every one of those containers already calls, counts a registered surface as not the container's. Item's own guard asks isInLayerSurface. The event keeps propagating to page-level listeners. Tests: an Item row with onClick ignores a click on tooltip text in its endContent. With main's useClickableContainer and Item, seven surface-press cases fail. * fix(Token, Item): their own row guards walk with isLayerSurface; one walk for the surface rule Token's onClick guard checked only button and a, so a click on an open tooltip in its icon or endContent still ran it; it now asks innermostInteractive(target, row, isLayerSurface) like Item. The separate isInLayerSurface walk is gone. The changeset names the surfaces covered. Test: a Token with onClick ignores a click on tooltip text in its endContent. * docs(useClickableContainer): hasInteractiveAncestor's JSDoc names the open-surface case * fix(HoverCard, Tooltip): the layer root around a surface's content counts too A caller's style, xstyle or className (padding) lands on the layer root, so a press on a padded HoverCard's edge still activated the container. registerLayerSurface also registers the content element's popover root. Test: a padded HoverCard's own edge does not activate a ClickableCard (fails without the root registration). * docs(spec): container records cross-reference Tooltip FR11; FR11 cites DEC-1 by id Token FR4, TreeList FR7, ClickableCard FR2 and SelectableCard FR2 each say a press inside an open Tooltip or HoverCard surface does not activate the container (component:Tooltip FR11). Tooltip FR11's basis cites component:Tooltip DEC-1 instead of an unnamed tap strategy. * chore(changeset): name the containers covered and credit the author
User impact
On a touch screen, a tap on a disabled Button, IconButton or ToggleButton, or on a disabled menu item, never shows the tooltip that explains why it is disabled. These controls are
aria-disabledso that they keep their reason reachable, buttouchTrigger="auto"treats them as an action, so the reason has no touch path.Problem and solution fit
autoasks whether the trigger performs an action, and anaria-disabledcontrol still counts as one.An
aria-disabledcontrol performs no action. Underauto, when the tap's innermost interactive element is anaria-disabledcontrol or a label for a disabled control, that element takes the tap. The reason opens and nothing activates. Every other tap is still the trigger's to decide, so taps on enabled controls do not change. A nativelydisabledcontrol receives noclickfrom the browser, so this restores thearia-disabledpath only.Expected behavior and authority
spec:AST-085FR5: a disabled control's reason is exposed with it.architecture:interaction-modalityINV4: every modality has an operable path, and hover is never the only discovery path. On touch, that reason had no path.component:Tooltipandcomponent:HoverCardDEC-1 and FR5: a disabled control is not an action, so its reason opens on a tap, and that restoration ships on its own as a patch (Compatibility and migration). This pull request is that patch. Tooltip's current-state gap "a disabled control's reason opens on no tap" goes, and both verification rows cite the disabled-control tests; theautowalk stays a gap until CLN-0024. Where the records said "a disabled oraria-disabledcontrol", they now say "anaria-disabledcontrol, or a label for a disabled control": a nativelydisabledcontrol receives noclickfrom the browser.spec:AST-017FR53: an accessibility behavior fix ships as a patch[fix], and the changeset names the old and new behavior and its targets.Smallest restoration
isActionTrigger: a disabled control (aria-disabled="true", or:disabled), or a label whose control is disabled, is no action.tapLandsOnDisabledControlwalks out from the tapped element on the clickable containers' own walk,innermostInteractiveinuseClickableContainer, whichhasInteractiveAncestornow also uses. It answers one question: whether the innermost interactive element is anaria-disabledcontrol or a label for a disabled control.isDisabledControlis one shared predicate inutils/pressDisabled.ts, which press feedback (gestures/haptics.ts) imports too, so the two never disagree about a control. It stays outside the gesture code, which a public import that uses no gesture never carries, and the CI WebKit lane's scope already covers it.touchTriggerdocs (English and Chinese) for Tooltip, HoverCard,useTooltipanduseHoverCardadd the disabled clause, named foraria-disabledcontrols: a nativelydisabledcontrol receives noclickfrom the browser.Evidence
tooltipopens nothing, and so does a tap on a disabled menu item inside a caller's Tooltip.touchTrigger="tap"andtouchTrigger="none". A tap on an enabled control is still decided by the trigger: a truncated label inside a link still opens its tooltip and the link still runs, and a tap inside a default Overlay within a link leaves that link's tooltip shut, as before. The 19 form controls'disabledMessagetooltips already opened on a tap, also inside a clickable card, and still do.touchTriggerTargets.test.tsxtaps every Core disabled-reason tooltip and expects the reason to open with nothing activating.tooltip.disabledMessage: CheckboxInput, CheckboxList, DateInput, DateRangeInput, DateTimeInput, FileInput, MultiSelector, NumberInput, PowerSearch, RadioList, SegmentedControl, Selector, Slider, Switch, TextArea, TextInput, TimeInput, Tokenizer and Typeahead.useTouchTrigger.test.tsadds the disabled-control rows forisActionTriggerandtapLandsOnDisabledControl, andutils/pressDisabled.test.tscoversisDisabledControl.Scope
Writing rubric results
Tooltip.spec.mdandHoverCard.spec.md:autostill does.Testing
Local gates at 952974c (on main 66c0d38):
pnpm check:repo,pnpm check:knowledge,pnpm check:changesets,pnpm typecheck(0 errors), ESLint on the touched TypeScript files, Prettier on the touched TypeScript and Markdown files, the root build, and the Storybook build. The touched.doc.mjsfiles keep main's formatting.pnpm test:ui: 17,237 tests pass.pnpm test:node: 14,949 pass, includingtouch-support-bundle.test.mjs(8) and the WebKit lane scope testci-interaction-webkit.test.mjs(12). Its 2 failures, in the releasecache.test.mjs, are independent of this change (fix(cli): a crashed run's release install is recognized by the Node it ran on, whatever its name #8520).TouchTrigger.a11y.chromium.spec.tspasses in Chromium, twice (24 of 24).