Skip to content

feat(Tooltip): triggerBehavior="toggle" pins the tooltip on a press - #9232

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:feat/tooltip-press-trigger
Nov 3, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:feat/tooltip-press-trigger

Conversation

@vjeux

@vjeux vjeux commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Status: the gates under Testing ran at this head, 11693c4, on main 032c4a1. It needs /approve-spec at this head.

User need

Some tooltips are the only place their information lives, such as an info icon or a "What is this?" button. Touch, keyboard, and screen-reader users can't keep those tooltips open. Hover opens one, and leaving closes it. touchTrigger="tap" opens it on a tap, but a mouse click, Enter, or Space doesn't keep it open, and nothing pins it. That makes the information hover-only, which architecture:interaction-modality rules out for content that exists nowhere else.

Problem and solution fit

  • triggerBehavior="toggle" turns the trigger into a toggle. On a button trigger, a click, a tap, Enter, or Space pins the tooltip, and the same press closes it. Hover and focus still preview it, so every input has one way to keep the tooltip.
  • The person pinned the tooltip themselves, so it takes Escape before the layer beneath it (spec:AST-003 FR4, DEC-6).
  • The press stops at its trigger, so a toggle inside a clickable row, card, or label doesn't also activate the container.

Current specification

component:Tooltip FR9, FR10, AR6 and DEC-1, plus spec:AST-003 FR4 and DEC-6, all current at 1d8696a (#9175). The prop's name and values, triggerBehavior: 'adaptive' | 'hover' | 'toggle' with default 'adaptive', and FR5's rules for them come from #9379, merged as a68e0e3. The record lines this pull request changes use #9379's wording.

Public delta and caller burden

  • triggerBehavior: 'adaptive' | 'hover' | 'toggle' on Tooltip and useTooltip, with the closed-union type TooltipTriggerBehavior. Hover and keyboard focus preview the tooltip under every value.
    • adaptive, the default, changes nothing. It is the released touch behavior: a tap opens the tooltip unless the trigger performs an action of its own. An explicit touchTrigger still decides taps under adaptive, until CLN-0024 removes touchTrigger in 0.8.0.
    • hover: no touch or pen tap opens the tooltip, and no press pins it. This is the released touchTrigger="none".
    • toggle, on a button trigger (a <button> or role="button"): a click, a tap, Enter, or Space pins the tooltip, and the same press closes it.
    • A pinned tooltip stays when the pointer leaves, and a press on its own text keeps it pinned. It closes on Escape, a second press, a press outside, or a scroll that starts outside. It also closes when focus moves to an element outside the trigger and the tooltip, whatever focusTrigger is, in the trigger's own document.
    • A controlled tooltip reports the toggled value through onOpenChange and doesn't change itself.
    • The trigger carries aria-expanded (true only while pinned) and, while the tooltip shows, aria-controls. When the tooltip pins, the shared rendered-text announcer reads its text once (spec:AST-086 FR12), through useAnnounce. Inside a modal, that announcement plays in the modal's own region (FR14).
    • The press stops at its trigger, in the React tree only. Its default action is prevented, the trigger's own handlers still run, and page-level click listeners still see it. A clickable row, card, or container around the trigger doesn't activate, and a <label> around it doesn't operate its control. With anchorRef, or useTooltip with a caller's trigger, the caller's own handlers still receive the press. A plain onClick element around the trigger receives the press unless the trigger's onClick stops it. Astryx clickable rows, cards, and containers ignore the press. One recorded gap: an Item row still runs on such a trigger when it is not a native button, until feat(Tooltip): a trigger whose tooltip repeats its own text pins without toggle state #9361.
    • A trigger that is not a button gets one development warning and keeps tap-only opening.
    • Under hover or toggle, touchTrigger is ignored.

Before and after:

// before: a tap opens it; nothing keeps it
<Tooltip content="Rows are ranked by how many places import the icon" touchTrigger="tap">
  <Button label="What is this?">?</Button>
</Tooltip>
// after: a click, tap, Enter or Space pins it; the same press closes it
<Tooltip content="Rows are ranked by how many places import the icon" triggerBehavior="toggle">
  <Button label="What is this?">?</Button>
</Tooltip>

Not in this pull request (each stacked above, in this order; all ship in the same release):

Supersedes: nothing. This pull request carries the toggle itself.

API changes

These are added public rows, decided by component:Tooltip FR9 and FR10 (#9175). They go to human review under architecture:public-component-api INV25. packages/core/api-report.md lists exactly these rows.

Change Package Signature Usage
added @astryxdesign/core TooltipProps.triggerBehavior?: TooltipTriggerBehavior (default 'adaptive') <Tooltip content="…" triggerBehavior="toggle"><Button label="What is this?">?</Button></Tooltip>
added @astryxdesign/core TooltipOptions.triggerBehavior?: TooltipTriggerBehavior (default 'adaptive') useTooltip({triggerBehavior: 'toggle'})
added @astryxdesign/core type TooltipTriggerBehavior = 'adaptive' | 'hover' | 'toggle' const mode: TooltipTriggerBehavior = 'toggle';

Design and alternatives

  • One press-pin hook serves the hover layers: Layer/usePressPin.ts. It owns the layer's touch trigger (useTouchTriggerInternal), so useTooltip makes one usePressPin call (architecture:react-component-runtime INV16). The touch trigger gets tap under toggle (the pin decides), none under hover, and the caller's touchTrigger under adaptive.
  • A pin closes through the hover layers' existing owners. The touch trigger's outside dismissal, which the pin arms, handles a press or scroll outside. The pin's own focus-out listener on the trigger handles focus moving away, whatever focus listeners the host attaches. It tests the next element against the trigger's own window, so a trigger in an iframe closes too. Escape in another document stays FR6's recorded implementation gap, and a press outside there is FR9's, until fix(Tooltip): Space on keyup and a press outside in another document, with triggerBehavior evidence #9406.
  • The stop is built once: the click listener prevents the default action and marks the event. The component's wrapper then stops it in the React tree only, after the trigger's own handlers, through Layer/layerClickBoundary.ts's stopInReactTree, which the layer roots use too. Page-level listeners still see the press.
  • Internal, by the spec owners' ruling: LayerTriggerBehavior and the touch trigger's armOutsideDismiss stay off the Layer entry point. The public useTouchTrigger return is unchanged.
  • The toggle owns aria-expanded and aria-controls while it wires a button trigger, and restores the trigger's own values when it unwires.
  • The records reject a toggle on every trigger: a non-button can't announce the toggle state, so it keeps tap-only opening.

Evidence

  • Red first:
    • With main's sources, the pinned Tooltip case in layerDismissalFamilies.test.tsx fails.
    • At this head, with stopPropagation() in the wrapper's stop (724181f's), the clickable-row case fails: a document click listener sees 0 of its 2 presses.
    • With e8efbb9's press pin, the case for a trigger in another document fails: the pin stays when focus moves to another control there.
    • At this pull request's earlier heads, each case that a review asked for failed before its fix: the announcement through useAnnounce (inside a modal too), a scroll outside, a press on the tooltip's own text, a triggerBehavior change after mount, the single usePressPin call, the focusTrigger="never" close, and the hover mapping.
  • Layer/usePressPin.test.tsx (33 tests): click, tap, Enter, and Space pin. Pointer leave and a press on the tooltip's own text keep the pin. Escape, a second press, a press outside, a scroll starting outside, and focus leaving close it. Focus leaving also closes it under focusTrigger="never" and for a trigger in another document. The file also covers the controlled case, the non-button warning, triggerBehavior changes, the trigger state, one announcement (inside a modal Dialog too), the stop inside a clickable row (with a page-level listener that still sees each press), a ClickableCard, an Item row, and a <label>, and the anchorRef cases.
  • layerDismissalFamilies.test.tsx: a pinned Tooltip over a Dialog takes Escape first, and the Dialog stays open.
  • Layer/usePressPin.calls.test.tsx: the host makes one usePressPin call per render, and every touch-trigger call comes from inside it.
  • hooks/useAnnounceRenderedText.adopters.test.tsx: a pinned Tooltip hands its text to the shared announcer and announces none of it itself (architecture:react-component-runtime INV10).
  • TouchTrigger.a11y.chromium.spec.ts, on the new a11y/Tooltip toggle behavior stories: a real tap pins and the next tap closes, a tap outside closes, Enter pins and Space closes, and inside a ClickableCard the tap pins and the card stays shut. Under a mouse, a click on the tooltip's own text keeps the pin, an anchored trigger runs its own click handler and pins, and with focusTrigger="never", Tab to another control closes a pin.
  • Records (Tooltip.spec.md):
    • The "not yet built" notes on FR9, FR10, and AR6 are dropped, and so is the "Toggle pinning is not built" current-state item.
    • FR9 gains the owners' clause for anchorRef and for useTooltip with a caller's trigger, with a FR9 (anchorRef) verification row.
    • FR9 keeps a gap note for its own-text clause. It records two more gaps: a press outside a pin in another document, and an Item row on an anchored trigger that is not a native button. Each gap has a current-state item. FR9 is the requirements table's widest row, so Prettier re-pads that table; the other rows change in padding only.
    • FR5 and FR9's triggerBehavior verification row names its evidence gap.
    • The compatibility row says DEP-0016's metadata and codemod are not yet built, plus thirteen further gaps.
    • system_specs adds spec:AST-086/FR12 and /FR14, and a path-applicability block links Layer/usePressPin.ts. Those links replace the citations that its source comments dropped.
  • Overlaps with open pull requests: fix(ChatMessageList, Tooltip, HoverCard): the chat log and text trigger spans draw the shared focus ring #8876 edits Tooltip.tsx, and fix(HoverCard): focusTrigger="auto" decides when focus arrives, through Tooltip's shared check #9597 moves useTooltip's isFocusForTrigger into utils/triggerFocus.ts. Whichever lands second rebases.

Split

Four pieces stack above this one, by the maintainers' rulings, and all ship in the same release: #9406, #9361, #9291, and #9246 (see above). This one is 17 files, +1,935/−64 (1,999 lines): the shared press pin and touch-trigger wiring, Tooltip's wiring, its tests and stories, its record lines and docs, its API report rows, and its changeset. Space on keyup moved to #9406, by the maintainers' ruling, to keep this one under 2,000 lines, and so did the press-outside close for a trigger in another document. Rebased onto main 032c4a1, past #9366 (focus counting), #9417, #9398, #9531, #9516 (comment provenance), and #9589 (API reports).

Scope

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

Writing rubric results

The rubric in docs/contributing/spec-writing.md, over the changed parts of Tooltip.spec.md:

  • R1 narration: none; the rows state what the tooltip does.
  • R2 research in the record: none.
  • R3 evidence naming a change: none; the verification cells name test files and cases.
  • R4 rejected alternatives over one line or outside a decision: none.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none.

Testing

Local gates at this head, 11693c4 (on main 032c4a1). Since a59321c821, the code changes only by the shared stop helper and comments, so this head re-runs the static checks, the press-pin suites, and both browsers:

  • These pass: pnpm check:knowledge, pnpm check:changesets, pnpm check:i18n-runtime, core tsc (0 errors), ASTRYX_STRICT_LINT=1 pnpm lint (0 errors, check:repo included), Prettier on the touched files, and the Storybook build. The two touched .doc.mjs files stay unformatted, as on main, and load.
  • The API report rows match the exported types, which haven't changed since ff2c7a3. stopInReactTree is not a package export.
  • Layer, Tooltip, and HoverCard suites: 515 tests pass.
  • TouchTrigger.a11y.chromium.spec.ts in Chromium: 19 of 19, twice.
  • In WebKit, Tooltip's two .a11y.browser.spec.ts specs, ten times each: 220 of 220. They run in the CI profile: the Playwright 1.61.1 image, 4 CPUs, CI=1, LP_NUM_THREADS=4, and one worker.
  • At a59321c821: pnpm test:ui passes 730 files, 18,147 tests; pnpm test:node passes 16,011, with 2 expected failures.

@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 2, 2026 11:54pm UTC

Request Review

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

astracat-bot Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Nov 3, 2026, 12:12 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 1, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 11693c4

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
LayerProvider 62.5 kB (+1.8 kB) · 10.5 kB CSS (0) — ✓ · ✓ · ✗
lab/Schedule 🔴 61.1 kB (+3.3 kB) · 3.9 kB CSS (0) — — · — · —
Carousel 🔴 50.5 kB (+3.2 kB) · 10.5 kB CSS (0) — — · — · —
116 more components
Component Size LoC Visual · A11y · RTL
Popover 🔴 49.6 kB (+3.2 kB) · 12.4 kB CSS (0) — — · — · —
lab/TourStep 🔴 55.0 kB (+3.2 kB) · 590 B CSS (0) — — · — · —
TableSelectionToolbar 🔴 52.0 kB (+2.7 kB) · 11.5 kB CSS (0) — — · — · —
DrawerHeader 🔴 48.3 kB (+2.7 kB) · 11.6 kB CSS (0) — — · — · —
DialogHeader 🔴 48.2 kB (+2.6 kB) · 10.2 kB CSS (0) — — · — · —
lab/InfoTip 🔴 26.0 kB (+2.6 kB) · 458 B CSS (0) — — · — · —
Tooltip · Storybook 🔴 20.8 kB (+2.6 kB) · 5.0 kB CSS (0) 644 (+40) ✓ · ✓ · ✓
StatusDot 🔴 23.0 kB (+2.6 kB) · 6.3 kB CSS (0) — — · — · —
ChatLayout 🔴 48.3 kB (+2.6 kB) · 10.3 kB CSS (0) — — · — · —
Stepper 🔴 46.8 kB (+2.6 kB) · 9.9 kB CSS (0) — — · — · —
lab/DiffViewer 🔴 70.5 kB (+2.6 kB) · 2.1 kB CSS (0) — — · — · —
ChatDictationButton 🔴 45.8 kB (+2.6 kB) · 9.8 kB CSS (0) — — · — · —
MobileNavToggle 🔴 45.6 kB (+2.6 kB) · 9.7 kB CSS (0) — — · — · —
FieldLabel 🔴 35.9 kB (+2.6 kB) · 5.9 kB CSS (0) — — · — · —
ToggleButton 🔴 43.1 kB (+2.5 kB) · 9.6 kB CSS (0) — — · — · —
TopNavMenu 🔴 57.9 kB (+2.5 kB) · 10.5 kB CSS (0) — — · — · —
ChatSendButton 🔴 45.0 kB (+2.5 kB) · 9.5 kB CSS (0) — — · — · —
TopNavMegaMenu 🔴 54.0 kB (+2.5 kB) · 11.2 kB CSS (0) — — · — · —
SideNavCollapseButton 🔴 45.9 kB (+2.5 kB) · 9.8 kB CSS (0) — — · — · —
IconButton 🔴 42.2 kB (+2.5 kB) · 9.5 kB CSS (0) — — · — · —
Banner 🔴 47.1 kB (+2.5 kB) · 10.3 kB CSS (0) — — · — · —
ChatLayoutScrollButton 🔴 45.6 kB (+2.5 kB) · 9.9 kB CSS (0) — — · — · —
Button 🔴 42.1 kB (+2.5 kB) · 9.5 kB CSS (0) — — · — · —
Toast 🔴 59.2 kB (+2.5 kB) · 10.1 kB CSS (0) — — · — · —
TabMenu 🔴 55.0 kB (+2.5 kB) · 10.4 kB CSS (0) — — · — · —
Link 🔴 42.7 kB (+2.5 kB) · 7.9 kB CSS (0) — — · — · —
TopNavHeading 🔴 57.8 kB (+2.5 kB) · 10.4 kB CSS (0) — — · — · —
lab/CommentPin 🔴 46.9 kB (+2.4 kB) · 1.2 kB CSS (0) — — · — · —
SideNavHeading 🔴 58.4 kB (+2.4 kB) · 10.5 kB CSS (0) — — · — · —
SideNavItem 🔴 54.3 kB (+2.4 kB) · 10.4 kB CSS (0) — — · — · —
Avatar 🔴 34.9 kB (+2.4 kB) · 6.5 kB CSS (0) — — · — · —
SegmentedControl 🔴 36.6 kB (+2.4 kB) · 6.5 kB CSS (0) — — · — · —
AvatarGroupOverflow 🔴 38.7 kB (+2.4 kB) · 6.5 kB CSS (0) — — · — · —
AvatarGroup 🔴 37.5 kB (+2.4 kB) · 6.6 kB CSS (0) — — · — · —
AppShell 🔴 68.1 kB (+2.3 kB) · 12.1 kB CSS (0) — — · — · —
AlertDialog 🔴 55.9 kB (+2.1 kB) · 12.7 kB CSS (0) — — · — · —
SideNav 🔴 65.5 kB (+2.1 kB) · 10.9 kB CSS (0) — — · — · —
TopNav 🔴 51.6 kB (+2.1 kB) · 10.7 kB CSS (0) — — · — · —
MobileNav 50.0 kB (+2.0 kB) · 10.4 kB CSS (0) — — · — · —
Lightbox 50.2 kB (+2.0 kB) · 10.1 kB CSS (0) — — · — · —
ChatComposerTokenElement 55.7 kB (+1.9 kB) · 10.4 kB CSS (0) — — · — · —
ChatComposerInput 55.7 kB (+1.9 kB) · 10.4 kB CSS (0) — — · — · —
TimeInput 88.4 kB (+1.9 kB) · 14.3 kB CSS (0) — — · — · —
CodeBlock 58.9 kB (+1.9 kB) · 11.1 kB CSS (0) — — · — · —
Calendar 54.1 kB (+1.9 kB) · 10.3 kB CSS (0) — — · — · —
DateInput 101.0 kB (+1.8 kB) · 15.3 kB CSS (0) — — · — · —
charts/ChartTooltip 52.1 kB (+1.8 kB) · 20 B CSS (0) — — · — · —
DateTimeInput 113.0 kB (+1.8 kB) · 15.8 kB CSS (0) — — · — · —
Thumbnail 49.3 kB (+1.8 kB) · 11.3 kB CSS (0) — — · — · —
TableCell 76.0 kB (+1.8 kB) · 15.8 kB CSS (0) — — · — · —
charts/ChartLegend 52.2 kB (+1.8 kB) · 20 B CSS (0) — — · — · —
Drawer 36.1 kB (+1.8 kB) · 8.2 kB CSS (0) — — · — · —
ContextMenu 74.8 kB (+1.8 kB) · 15.3 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 64.7 kB (+1.8 kB) · 773 B CSS (0) — — · — · —
charts/Chart 62.6 kB (+1.8 kB) · 20 B CSS (0) — — · — · —
DropdownMenu 72.6 kB (+1.8 kB) · 15.4 kB CSS (0) — — · — · —
lab/ChatReactionBar 65.2 kB (+1.8 kB) · 1.1 kB CSS (0) — — · — · —
richtext/RichTextView 256.6 kB (+1.7 kB) · 2.3 kB CSS (0) — — · — · —
BreadcrumbItem 66.7 kB (+1.7 kB) · 11.4 kB CSS (0) — — · — · —
TableHeaderCell 75.6 kB (+1.7 kB) · 15.5 kB CSS (0) — — · — · —
MoreMenu 72.8 kB (+1.7 kB) · 15.4 kB CSS (0) — — · — · —
DateRangeInput 69.4 kB (+1.7 kB) · 11.7 kB CSS (0) — — · — · —
FileInput 53.5 kB (+1.7 kB) · 10.7 kB CSS (0) — — · — · —
ComplexSelector 55.2 kB (+1.7 kB) · 11.1 kB CSS (0) — — · — · —
TextInput 52.7 kB (+1.7 kB) · 10.9 kB CSS (0) — — · — · —
Switch 47.0 kB (+1.7 kB) · 9.7 kB CSS (0) — — · — · —
CheckboxList 43.2 kB (+1.7 kB) · 8.6 kB CSS (0) — — · — · —
TextArea 47.1 kB (+1.7 kB) · 9.8 kB CSS (0) — — · — · —
lab/TransferListSelector 80.4 kB (+1.7 kB) · 1.9 kB CSS (0) — — · — · —
lab/EmojiPicker 70.0 kB (+1.7 kB) · 722 B CSS (0) — — · — · —
Field 41.3 kB (+1.7 kB) · 8.3 kB CSS (0) — — · — · —
richtext/RichTextEditor 276.0 kB (+1.7 kB) · 2.6 kB CSS (0) — — · — · —
InputGroup 41.9 kB (+1.7 kB) · 8.4 kB CSS (0) — — · — · —
NumberInput 54.8 kB (+1.7 kB) · 11.2 kB CSS (0) — — · — · —
lab/TransferList 74.2 kB (+1.7 kB) · 1.7 kB CSS (0) — — · — · —
RadioList 42.8 kB (+1.7 kB) · 8.3 kB CSS (0) — — · — · —
CheckboxInput 48.6 kB (+1.7 kB) · 9.7 kB CSS (0) — — · — · —
RadioListItem 51.1 kB (+1.7 kB) · 10.1 kB CSS (0) — — · — · —
Slider 46.1 kB (+1.6 kB) · 8.9 kB CSS (0) — — · — · —
CheckboxListItem 53.2 kB (+1.6 kB) · 11.0 kB CSS (0) — — · — · —
ListItem 52.5 kB (+1.6 kB) · 11.0 kB CSS (0) — — · — · —
lab/MobilePowerSearch 166.5 kB (+1.5 kB) · 1.2 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 221.2 kB (+1.5 kB) · 454 B CSS (0) — — · — · —
lab/MobileTokenizer 100.6 kB (+1.4 kB) · 880 B CSS (0) — — · — · —
ChatComposer 60.6 kB (+1.4 kB) · 11.2 kB CSS (0) — — · — · —
lab/CommentComposer 101.9 kB (+1.4 kB) · 1.9 kB CSS (0) — — · — · —
lab/Comments 231.7 kB (+1.4 kB) · 2.5 kB CSS (0) — — · — · —
BaseTypeahead 54.6 kB (+1.3 kB) · 10.2 kB CSS (0) — — · — · —
lab/CommentThread 226.3 kB (+1.3 kB) · 2.4 kB CSS (0) — — · — · —
Tokenizer 69.6 kB (+1.3 kB) · 17.1 kB CSS (0) — — · — · —
lab/ListInput 81.3 kB (+1.3 kB) · 1.6 kB CSS (0) — — · — · —
PowerSearch 182.3 kB (+1.3 kB) · 20.5 kB CSS (0) — — · — · —
MultiSelector 72.2 kB (+1.3 kB) · 15.2 kB CSS (0) — — · — · —
Selector 76.4 kB (+1.3 kB) · 15.6 kB CSS (0) — — · — · —
Markdown 144.9 kB (+1.2 kB) · 18.3 kB CSS (0) — — · — · —
Typeahead 62.2 kB (+1.2 kB) · 11.8 kB CSS (0) — — · — · —
Pagination 85.3 kB (+1.2 kB) · 15.9 kB CSS (0) — — · — · —
Table 84.1 kB (+1.2 kB) · 16.0 kB CSS (0) — — · — · —
CommandPalette 48.4 kB (+180 B) · 12.2 kB CSS (0) — — · — · —
ProgressBar 8.1 kB (+130 B) · 6.9 kB CSS (0) — — · — · —
ChatMessageList 22.8 kB (+97 B) · 7.9 kB CSS (0) — — · — · —
CommandPaletteInput 26.7 kB (+81 B) · 8.5 kB CSS (0) — — · — · —
HoverCard 18.5 kB (+54 B) · 5.0 kB CSS (0) — — · — · —
Spinner 18.5 kB (+41 B) · 6.7 kB CSS (0) — — · — · —
Timestamp 21.3 kB (+37 B) · 9.9 kB CSS (0) — — · — · —
Timer 9.6 kB (+35 B) · 7.0 kB CSS (0) — — · — · —
ChatToolCalls 25.8 kB (+32 B) · 9.3 kB CSS (0) — — · — · —
Heading 7.9 kB (+19 B) · 6.0 kB CSS (0) — — · — · —
Text 7.4 kB (+14 B) · 6.0 kB CSS (0) — — · — · —
BottomSheet 35.0 kB (0) · 7.5 kB CSS (0) — — · — · —
Dialog 16.6 kB (0) · 6.6 kB CSS (0) — — · — · —
TabList 35.4 kB (0) · 7.5 kB CSS (0) — — · — · —
Toolbar 34.7 kB (0) · 7.9 kB CSS (0) — — · — · —
DropdownMenuSubMenu 55.9 kB (−26 B) · 9.9 kB CSS (0) — — · — · —
layer — — — · ✓ · —
Layer — — ✓ · ✓ · —

Package size: @astryxdesign/core 5.83 MB packed (+12.0 kB); no new dependencies.

API changes: core +4 · ~0 · −0

Committed API report behind this build: core 18 rows; run pnpm api:report.

4 API changes (advisory)
Package Where Signature Usage
+ core . · Components · component Tooltip prop triggerBehavior?: TooltipTriggerBehavior = 'adaptive' <Tooltip triggerBehavior="adaptive" />
+ core . · Types · interface TooltipOptions triggerBehavior?: TooltipTriggerBehavior = 'adaptive' import type {TooltipOptions} from '@astryxdesign/core'; const x: TooltipOptions = {triggerBehavior: …}
+ core . · Types · type TooltipTriggerBehavior type TooltipTriggerBehavior = 'adaptive' | 'hover' | 'toggle' import type {TooltipTriggerBehavior} from '@astryxdesign/core'
+ core ./Tooltip · Also exported from an earlier entry point · TooltipTriggerBehavior TooltipTriggerBehavior (.) import {TooltipTriggerBehavior} from '@astryxdesign/core/Tooltip'

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the toggle behaves as component:Tooltip FR9 describes for button triggers, but a few gaps need fixing first.

  • A pin inside a modal Dialog is announced with announceMessage into the page-body live region, which the modal hides, so announce through useAnnounce or useAnnounceRenderedText to get spec:AST-086 FR14 routing.
  • A labelled HoverCard on a non-button trigger loses aria-controls/aria-expanded under pressTrigger="toggle" (HoverCard.tsx:380), which also makes the codemod's span rewrite change behavior; hand that state to the pin only when it wires the trigger, and test it.
  • The outside-press Effect in usePressPin duplicates useTouchTrigger's outside dismissal; please extend that owner instead.
  • The hook docs promise the press stops at the trigger (it does not without the component wrapper), touchTrigger="tap" has no @deprecated tag, and TooltipPressTrigger/HoverCardPressTrigger are missing from the entry-point exports.
  • At 2,307 authored lines, please split the DEP-0016 codemod and deprecation into a follow-up in the same release.

[Automated review]

Comment thread packages/core/src/Layer/usePressPin.ts Outdated
announcedRef.current = true;
const text = optionsRef.current.announcement()?.trim();
if (text != null && text !== '') {
announceMessage(text, 'polite');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

announceMessage always writes to the page-body live region. Inside an open modal Dialog, that region is inert, so the pin is never heard; useAnnounce() routes to the modal's own region (spec:AST-086 FR14). The shared useAnnounceRenderedText already reads a layer's rendered text and announces it through useAnnounce, so gating it on the pin would replace this Effect.


// Under the toggle, the press pin owns aria-expanded (true only while
// pinned) and aria-controls (FR10); the popup role stays here.
const ownsToggleState = pressTrigger !== 'toggle';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This hands aria-controls/aria-expanded to the press pin for every trigger, but usePressPin wires only button triggers. A labelled HoverCard on a span or link trigger therefore loses HoverCard FR3's popup state, and the codemod rewrites such spans. Something like pressTrigger === 'toggle' && isPressPinTrigger(firstChild) keeps FR3 for the rest.

Comment thread packages/core/src/Layer/usePressPin.ts Outdated
Comment on lines +287 to +319
// While pinned, a press or focus outside the trigger and the layer closes it.
useEffect(() => {
if (!isToggleMode || trigger == null || !isExpanded) {
return;
}
const ownerDocument = trigger.ownerDocument;
const isInside = (target: EventTarget | null) => {
if (!(target instanceof Node)) {
return false;
}
const surface = ownerDocument.getElementById(layerId);
return (
trigger.contains(target) ||
(surface != null && surface.contains(target))
);
};
const onPointerDown = (event: PointerEvent) => {
if (!isInside(event.target)) {
close();
}
};
const onFocusIn = (event: FocusEvent) => {
if (!isInside(event.target)) {
close();
}
};
ownerDocument.addEventListener('pointerdown', onPointerDown, true);
ownerDocument.addEventListener('focusin', onFocusIn, true);
return () => {
ownerDocument.removeEventListener('pointerdown', onPointerDown, true);
ownerDocument.removeEventListener('focusin', onFocusIn, true);
};
}, [isToggleMode, trigger, isExpanded, layerId, close]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

useTouchTrigger (armOutsideDismiss), which both hooks already call, owns outside dismissal for hover layers, armed from the opening handler. This Effect adds a second path with its own containment test. Could the pin arm that owner from toggle, and could focus leaving close a pinned layer through the existing focus-leave path?

{name: 'focusTrigger', type: "'auto' | 'always' | 'never'", description: 'When focus should open the tooltip. auto only attaches focus listeners to naturally focusable elements.', default: "'auto'"},
{name: 'touchTrigger', 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; tap always opens (an info icon rendered as a button); none never opens on touch.', default: "'auto'"},
{name: 'touchTrigger', 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; tap always opens (deprecated, DEP-0016: use pressTrigger="toggle"); none never opens on touch. Ignored under pressTrigger="toggle".', default: "'auto'"},
{name: 'pressTrigger', type: "'none' | 'toggle'", description: 'Whether a press on the trigger pins the tooltip open. none leaves taps to touchTrigger; toggle, on a button trigger, pins on a click, a tap, Enter, or Space and closes on the same press, Escape, a press outside, or focus leaving. The trigger carries aria-expanded and aria-controls, the tooltip is announced once when it pins, and the press stops at the trigger.', default: "'none'"},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"The press stops at the trigger" holds only for the Tooltip/HoverCard components, whose wrapper calls stopPropagation. With the hook alone, a button inside <div onClick> pins the tooltip and also fires the row's handler. The same wording is in useHoverCard.doc.mjs and both hooks' JSDoc.

Comment thread packages/core/src/Tooltip/Tooltip.tsx Outdated
* as a button wants: it looks like an action to the DOM, but revealing the
* tooltip is the only thing it does
* - `tap`: tap always opens the tooltip, even on a trigger that acts.
* Deprecated (DEP-0016): pass `pressTrigger="toggle"` instead; `astryx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is prose only. DEP-0016's warning field and spec:AST-017 FR29a ask for static @deprecated metadata on tap, and the description says it is present, but no @deprecated tag exists for it.

Comment thread packages/core/src/Tooltip/Tooltip.tsx Outdated
export type {TooltipFocusTrigger, TooltipTouchTrigger} from './useTooltip';
export type {
TooltipFocusTrigger,
TooltipPressTrigger,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TooltipPressTrigger (and HoverCardPressTrigger) is not added to Tooltip/index.ts, HoverCard/index.ts or Layer/index.ts. Those files export the FocusTrigger/TouchTrigger siblings, so the new types are unreachable from @astryxdesign/core (architecture:public-component-api INV1).

@vjeux
vjeux force-pushed the feat/tooltip-press-trigger branch from a5250c6 to c543d57 Compare November 1, 2026 02:06
@github-actions github-actions Bot removed the needs:design-review Affects visuals — Design should review label Nov 1, 2026
@vjeux vjeux changed the title feat(Tooltip, HoverCard): pressTrigger="toggle" pins the layer on a press; deprecate touchTrigger="tap" feat(Tooltip, HoverCard): pressTrigger="toggle" pins the layer on a press Nov 1, 2026
@vjeux

vjeux commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Per the owner's ruling, DEP-0016 (the @deprecated metadata, docs and codemod) moved to a stacked follow-up that lands in the same release; the other four points are fixed in c543d57.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the toggle now pins and closes as component:Tooltip FR9 describes and the earlier findings are fixed, but a few gaps remain.

  • In Chromium, a press on a pinned HoverCard's (or Tooltip's) own text closes it, because the focus-leave check treats focus moving to the page body as leaving (usePressPin.ts:353-359), while HoverCard FR9 says such a press keeps the pin.
  • The pin reads textContent and announces it from its own Effect, but architecture:react-component-runtime INV10 puts that in useAnnounceRenderedText, which also keeps an unlabelled card's paragraphs apart (today it says "Ada LovelaceAnalyst, Payments").
  • The HoverCard verification row cites Enter, Space, press-outside, focus-leave, pointer-leave and unlabelled cases that no HoverCard test covers yet.
  • Smaller: the touchDismissRef bridge Effect and the trigger element kept in state in usePressPin, the duplicated stopPressPinClick, and the changeset's forward-looking DEP-0016 sentence.

[Automated review]

Comment on lines +353 to +359
if (
next instanceof Node &&
(trigger?.contains(next) === true || surface?.contains(next) === true)
) {
return true;
}
close();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When the person presses non-focusable text inside the pinned layer, Chromium moves focus from the trigger to the body, so relatedTarget is null and this closes the pin. A pinned HoverCard then closes on a press on its own content, against HoverCard FR9 ("a press on its own content keeps it pinned"), and a pinned Tooltip closes the same way. Could a focus move caused by a press inside the trigger or the layer be left to useTouchTrigger's outside dismissal, with this closing only when focus lands outside both?

Comment thread packages/core/src/Layer/usePressPin.ts Outdated
Comment on lines +399 to +412
useEffect(() => {
if (!isToggleMode || trigger == null || !isExpanded || !wiresState) {
announcedRef.current = false;
return;
}
if (announcedRef.current) {
return;
}
announcedRef.current = true;
const text = optionsRef.current.announcement()?.trim();
if (text != null && text !== '') {
announce(text, 'polite');
}
}, [isToggleMode, trigger, isExpanded, wiresState, announce]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This Effect announces text the hosts read with textContent. architecture:react-component-runtime INV10 keeps reading and announcing a component's rendered text in hooks/useAnnounceRenderedText.ts, which skips aria-hidden content and keeps blocks apart; an unlabelled HoverCard with two paragraphs is announced here as "Ada LovelaceAnalyst, Payments".

Comment thread packages/core/src/Layer/usePressPin.ts Outdated
}, []);

// The wired trigger, as state: its ARIA follows the pin through effects.
const [trigger, setTrigger] = useState<HTMLElement | null>(null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

architecture:react-component-runtime INV1: DOM nodes must not be stored in React state. The trigger can live in triggerRef alone, with attach/detach setting and restoring its aria-expanded/aria-controls, which would also replace the restore Effect below.

Comment on lines +440 to +442
useEffect(() => {
touchDismissRef.current = {arm: armOutsideDismiss, disarm: clearTapOpen};
}, [armOutsideDismiss, clearTapOpen]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This Effect only copies useTouchTrigger's callbacks into a ref, so it synchronizes no external system (INV3), and the same bridge and hideFromTouch are copied in useHoverCard.tsx:450-452. Letting usePressPin own the touch-trigger wiring (or useTouchTrigger take the pin's close) would leave each hook one call.

Comment thread .changeset/press-trigger-toggle.md Outdated
'@astryxdesign/core': patch
---

[feat] Tooltip and HoverCard (and `useTooltip`, `useHoverCard`) take `pressTrigger` (types `TooltipPressTrigger`, `HoverCardPressTrigger`): `none` (the default, unchanged) or `toggle`. With `toggle` on a button trigger, a click, a tap, Enter, or Space pins the layer open and the same press closes it, while hover and focus still preview it. A pinned layer stays until Escape, a second press, a press outside, or focus leaving, and it takes Escape before the layer beneath it. The press stops at its trigger, so a clickable row, card, or label around it does nothing, and the trigger's own handlers still run. The trigger reports `aria-expanded` and `aria-controls`, and the layer is announced once when it pins, inside a modal too (`component:Tooltip` FR9 and FR10, `component:HoverCard` FR9 and FR10). A trigger that is not a button gets a development warning and keeps tap-only opening; beside `pressTrigger="toggle"`, `touchTrigger` is ignored. `touchTrigger="tap"` is deprecated in favor of `pressTrigger="toggle"` in the next patch (DEP-0016).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The last sentence announces the DEP-0016 deprecation, which now ships in the stacked follow-up. Could it move to that follow-up's changeset so this release note describes only what this change does?

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 1, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 1, 2026 03:13
@vjeux
vjeux force-pushed the feat/tooltip-press-trigger branch from c543d57 to 90ae917 Compare November 1, 2026 05:18
@vjeux

vjeux commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in 90ae917, per the spec owners' ruling:

  • A layer's rendered text is announced through useAnnounceRenderedText (spec:AST-086 FR12), with no raw textContent and no Effect of its own. A labelled HoverCard keeps FR10's label: a string, said once from the press handler through useAnnounce (FR14), again with no Effect.
  • A press on a pinned layer's own text keeps it. Focus that moves to no element is left to the outside-press dismissal; only focus landing on an element outside the trigger and the layer closes the pin. Chromium cases cover a click on a pinned tooltip's and card's own text.
  • touchDismissRef is assigned during render, and the copy Effects are gone.
  • A pressTrigger that changes after mount re-wires the trigger, with a rerender test.
  • The trigger stays in a ref, with no DOM node in state, and stopPressPinClick is shared.
  • Each case the HoverCard verification row names now has a HoverCard test. An unlabelled card's paragraphs come out apart ("Ada Lovelace Analyst, Payments"), asserted in jsdom and in Chromium.
  • LayerPressTrigger and armOutsideDismiss stay internal: neither is exported from the Layer entry point, and the public useTouchTrigger return is unchanged (useTouchTriggerInternal carries the arm).

Kept, per the spec owners' ruling: the changeset says tap is deprecated in the next patch, since #9246, which carries the deprecation in its own changeset, merges separately. The Tooltip.tsx:38 exports comment was already fixed in c543d57.

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 1, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the toggle now behaves as component:Tooltip and component:HoverCard FR9 and FR10 describe, and the earlier findings are fixed, but three items remain.

  • The touch-trigger bridge (touchDismissRef, hideFromTouch, the usePressPin call and the touchTrigger override) is copied line for line into useTooltip.tsx:375-439 and useHoverCard.tsx:384-448; moving it into usePressPin, so each hook makes one call, keeps the two layers from drifting apart.
  • At 2,218 authored lines the change is over the 2,000-line threshold; the HoverCard wiring (about 600 lines) could land as a follow-up, or the description could show why the two are inseparable.
  • The changeset's last sentence announces DEP-0016, which ships in #9246, so it belongs in that pull request's changeset.

[Automated review]

Comment on lines +384 to +448
// A press pins the card under `pressTrigger="toggle"` (FR9, FR10). The pin
// arms and drops the touch trigger's outside dismissal, the one owner of a
// hover layer's dismissal by a press outside. That hook takes the pin's
// close as part of its hide, so the pin reaches it through a ref, assigned
// during render below and read only from handlers.
const touchDismissRef = useRef<{arm: () => void; disarm: () => void} | null>(
null,
);
const armTouchDismiss = useCallback(() => touchDismissRef.current?.arm(), []);
const disarmTouchDismiss = useCallback(
() => touchDismissRef.current?.disarm(),
[],
);

const {
isToggleTrigger,
isPinnedRef: isPressPinnedRef,
attach: attachPressPin,
unpin: unpinPress,
closeIfPinned: closePressPin,
handleFocusLeave: handlePressFocusLeave,
isPinShown,
} = usePressPin({
pressTrigger,
isEnabled,
isOpen,
isLayerOpen,
layerId,
component: 'HoverCard',
show: showNow,
hide: hideNow,
report: next => (next ? onShow?.() : onHide?.()),
label,
armOutsideDismiss: armTouchDismiss,
disarmOutsideDismiss: disarmTouchDismiss,
});

// An outside press or scroll closes a pinned layer through the pin, so the
// pin drops with it; otherwise it hides as a tap-open does.
const hideFromTouch = useCallback(() => {
if (closePressPin()) {
return;
}
hideNow();
}, [closePressPin, hideNow]);

const {
isTouchPointerRef,
isTouchInteraction,
handlePointerEnter,
handlePointerDown: handleTouchPointerDown,
clearTapOpen,
} = useTouchTrigger({
touchTrigger,
armOutsideDismiss,
} = useTouchTriggerInternal({
// Under the toggle, a trigger no press can pin keeps tap-only opening.
touchTrigger: pressTrigger === 'toggle' ? 'tap' : touchTrigger,
isEnabled,
isControlled: isOpen !== undefined,
isOpen: isLayerOpen,
layerId: layerId,
triggerRef,
show: showNow,
hide: hideNow,
hide: hideFromTouch,
});
touchDismissRef.current = {arm: armOutsideDismiss, disarm: clearTapOpen};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This block is the same as useTooltip.tsx:375-439 apart from the component name and one option: the touchDismissRef bridge, hideFromTouch, the usePressPin call and the touchTrigger override. A fix to how a pin closes on an outside press would then have to land twice. Could usePressPin (or one Layer hook) call useTouchTriggerInternal itself and hand back the touch handles, so each hook makes one call?

Comment thread .changeset/press-trigger-toggle.md Outdated
'@astryxdesign/core': patch
---

[feat] Tooltip and HoverCard (and `useTooltip`, `useHoverCard`) take `pressTrigger` (types `TooltipPressTrigger`, `HoverCardPressTrigger`): `none` (the default, unchanged) or `toggle`. With `toggle` on a button trigger, a click, a tap, Enter, or Space pins the layer open and the same press closes it, while hover and focus still preview it. A pinned layer stays until Escape, a second press, a press outside, or focus leaving, and it takes Escape before the layer beneath it. The press stops at its trigger, so a clickable row, card, or label around it does nothing, and the trigger's own handlers still run. The trigger reports `aria-expanded` and `aria-controls`, and the layer is announced once when it pins, inside a modal too (`component:Tooltip` FR9 and FR10, `component:HoverCard` FR9 and FR10). A trigger that is not a button gets a development warning and keeps tap-only opening; beside `pressTrigger="toggle"`, `touchTrigger` is ignored. `touchTrigger="tap"` is deprecated in favor of `pressTrigger="toggle"` in the next patch (DEP-0016).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The last sentence announces DEP-0016, which ships in #9246 with its own changeset. If both land together the notes say it twice, and if #9246 slips they promise a deprecation that has not happened. Could it move to #9246?

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: triggerBehavior behaves as component:Tooltip FR9 and FR10 describe for a trigger in the page, an engineering owner approved the record change for this revision, and the pull request is now under 2,000 authored lines, but one FR9 case is not met. A pinned tooltip whose trigger renders in another document, such as an iframe or a Picture-in-Picture window, stays pinned when focus moves to another control, because handleFocusLeave checks relatedTarget against this window's Node (packages/core/src/Layer/usePressPin.ts:370); a press outside and Escape do not reach it there either. Please restore the trigger-window check from the previous revision (about one line), or record the other-document focus close as an FR9 implementation gap until the stacked follow-up lands.

[Automated review]

Comment thread packages/core/src/Layer/usePressPin.ts Outdated
// A press decides focus that leaves for no element. A press on the
// layer's own text moves focus to the body and keeps the pin. A press
// outside closes it through the outside dismissal.
if (!(next instanceof Node)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This tests relatedTarget against this window's Node. When the trigger renders in an iframe or a Picture-in-Picture window, the next control is a Node of that window, so this returns before close() and the tooltip stays pinned after focus moves away (FR9: "focus moving outside them closes it"). A press outside and Escape do not reach it there either. The previous revision's check fixes it in about one line:

const trigger = triggerRef.current;
const view = trigger?.ownerDocument.defaultView;
if (view == null || !(next instanceof view.Node)) {
  return true;
}

If it stays in the stacked follow-up, FR9 and Current-state impact should record the gap, as they do for the own-text clause.

// for WCAG 1.4.13 (Content on Hover or Focus: hoverable).
const scheduleHide = useCallback(() => {
if (isOpen === true) {
// A pinned tooltip stays when the pointer or focus leaves.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Optional (non-blocking): this restates isPressHeldOpen() on the next line, so the comment can go.

@vjeux
vjeux force-pushed the feat/tooltip-press-trigger branch from e8efbb9 to 724181f Compare November 2, 2026 21:51
@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Updated in 724181f. The trigger-window check in handleFocusLeave is restored, with its iframe test; that test fails on e8efbb9. In another document, Escape stays FR6's recorded implementation gap. The press-outside close there is in #9406, which merges right after this one, together with Space on keyup. This head counts 1,998 authored lines.

@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 724181f

vjeux added a commit to vjeux/astryx that referenced this pull request Nov 2, 2026
… with triggerBehavior evidence

Two refinements of the toggle's press pin, carried here by the
maintainers' ruling so meta#9232 stays under 2,000 lines:

- Under `triggerBehavior="toggle"`, Space on a `role="button"` trigger acts
  on keyup, as on a native button. The keydown still prevents the page
  scroll. A click with no pointer while Space is down, or in a key press's
  task, is that same press, so a trigger that clicks itself on Space keydown
  or keyup pins once. A keyup with no keydown on the trigger does nothing.
- The shared touch trigger's outside dismissal also listens on the
  trigger's own document. So a tap-opened or pinned Tooltip, and a
  tap-opened HoverCard, whose trigger renders in an iframe closes on a tap or
  press outside there, or a scroll starting outside (`component:Tooltip` FR5
  and FR9, `component:HoverCard` FR5).

The evidence for `component:Tooltip` FR5 and FR9's `triggerBehavior`
verification row:

- Tooltip.test.tsx: `adaptive` by default and explicitly, `hover`, and
  `toggle`, each under a mouse hover and keyboard focus (both preview it),
  a touch and a pen tap (which opens it, never opens it, or pins it), and a
  mouse click and a tap on a button trigger, which only the toggle pins;
  an explicit `touchTrigger` decides taps beside `adaptive` and is ignored
  beside `hover` and `toggle`.
- TouchTrigger.a11y.chromium.spec.ts: a real finger and a pen-typed press on
  the new TriggerBehaviors story: a tap never opens `hover`, opens
  `adaptive`, and pins `toggle`.
- useTooltip.test.tsx: FR9's `useTooltip` clause with a caller's trigger
  under the toggle: the trigger's own onClick runs and an Astryx
  ClickableCard around it does not activate; a plain onClick element around
  it receives the press unless the trigger's onClick stops it.
- The Tooltip record's `triggerBehavior` verification row names this
  evidence in place of its gap.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: triggerBehavior pins and closes as component:Tooltip FR9 and FR10 describe, and the record change has an engineering owner's approval for this head, but two defects remain in the pin's press handling.

  • The wrapper's stopPressPinClick calls React's stopPropagation(), which also stops the native click, so a page's own document or window click listeners never see a pinning press on a child trigger; stopping it in the React tree only, as Layer/layerClickBoundary.ts does, keeps the row and card stop and passes the existing suites.
  • A tooltip whose trigger renders in an iframe or Picture-in-Picture window stays pinned after a press outside there, because the outside dismissal listens on the page's document; arm it on the trigger's own document, or record the gap in FR9 until the follow-up lands.

[Automated review]

Comment thread packages/core/src/Layer/usePressPin.ts Outdated
*/
export function stopPressPinClick(event: ReactMouseEvent): void {
if (pressPinClicks.has(event.nativeEvent)) {
event.stopPropagation();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

React's stopPropagation() also calls the native one, so document and window click listeners never see a pinning press on a child trigger (in Chromium a document listener counts 0 here, 1 on the base and on the anchorRef path). FR9 only needs the press kept from the row, card or label around the trigger. A React-tree-only stop, as Layer/layerClickBoundary.ts does, keeps that and lets page listeners see the press:

if (pressPinClicks.has(event.nativeEvent)) {
  event.isPropagationStopped = () => true;
}

} else {
setPinned(true);
current.show();
armOutsideDismiss();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This arms the shared outside dismissal, which listens on the page's document (useTouchTrigger.ts:421-422). For a trigger rendered in an iframe or Picture-in-Picture window, a press outside there never reaches it, so the pin stays (aria-expanded="true"), against FR9's "a press outside the trigger and the surface … closes it". Arming it on triggerRef.current?.ownerDocument ?? document fixes this and the tap-open case, or FR9 can record the gap until the follow-up lands.

Comment thread packages/core/src/Layer/usePressPin.ts Outdated
Comment on lines +250 to +251
// A string goes straight to useAnnounce from the press handler, with no
// Effect.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Optional (non-blocking): this narrates the call below it, so the comment can go (INV29).

@vjeux
vjeux force-pushed the feat/tooltip-press-trigger branch from 724181f to 56fa37a Compare November 2, 2026 23:04
@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Updated in 56fa37a (16 files, 1,996 authored lines).

This head needs a spec owner's /approve-spec 56fa37a6f81cabd70eeefdd13a35e302baa7db6e.

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 2, 2026
@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 56fa37a

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 2, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Nov 2, 2026
… with triggerBehavior evidence

Two refinements of the toggle's press pin, carried here by the
maintainers' ruling so meta#9232 stays under 2,000 lines:

- Under `triggerBehavior="toggle"`, Space on a `role="button"` trigger acts
  on keyup, as on a native button. The keydown still prevents the page
  scroll. A click with no pointer while Space is down, or in a key press's
  task, is that same press, so a trigger that clicks itself on Space keydown
  or keyup pins once. A keyup with no keydown on the trigger does nothing.
- The shared touch trigger's outside dismissal also listens on the
  trigger's own document. So a tap-opened or pinned Tooltip, and a
  tap-opened HoverCard, whose trigger renders in an iframe closes on a tap or
  press outside there, or a scroll starting outside (`component:Tooltip` FR5
  and FR9, `component:HoverCard` FR5). FR9's gap sentence about the pin in
  another document goes.

The evidence for `component:Tooltip` FR5 and FR9's `triggerBehavior`
verification row:

- Tooltip.test.tsx: `adaptive` by default and explicitly, `hover`, and
  `toggle`, each under a mouse hover and keyboard focus (both preview it),
  a touch and a pen tap (which opens it, never opens it, or pins it), and a
  mouse click and a tap on a button trigger, which only the toggle pins;
  an explicit `touchTrigger` decides taps beside `adaptive` and is ignored
  beside `hover` and `toggle`.
- TouchTrigger.a11y.chromium.spec.ts: a real finger and a pen-typed press on
  the new TriggerBehaviors story: a tap never opens `hover`, opens
  `adaptive`, and pins `toggle`.
- useTooltip.test.tsx: FR9's `useTooltip` clause with a caller's trigger
  under the toggle: the trigger's own onClick runs and an Astryx
  ClickableCard around it does not activate; a plain onClick element around
  it receives the press unless the trigger's onClick stops it.
- The Tooltip record's `triggerBehavior` verification row names this
  evidence in place of its gap.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: triggerBehavior pins and closes as component:Tooltip FR9 and FR10 describe, the earlier page-listener and other-document points are addressed, and the record change has an engineering owner's approval for this head, but two small fixes remain.

  • stopPressPinClick repeats the React-tree-only stop that Layer/layerClickBoundary.ts already owns as stopInReactTree (usePressPin.ts:56); please export that helper and call it, so both layer stops change together.
  • The changeset and the Tooltip and useTooltip docs say Astryx clickable rows ignore a press on an anchorRef or caller's trigger, but an Item row still runs when that trigger is not a native <button> (the gap FR9 now records); please add that exception or narrow the wording.

Optional: the comment above isPressHeldOpen() in useTooltip.tsx restates the call and can go. After the fix, the new head needs an engineering owner's /approve-spec with its full SHA, which the author may post as an engineering owner.

[Automated review]

Comment thread packages/core/src/Layer/usePressPin.ts Outdated
*/
export function stopPressPinClick(event: ReactMouseEvent): void {
if (pressPinClicks.has(event.nativeEvent)) {
event.isPropagationStopped = () => true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is the stop Layer/layerClickBoundary.ts already owns as stopInReactTree (its lines 57-66). Both rely on React's dispatch asking isPropagationStopped() before each listener, so a fix to one would miss the other. Could you export stopInReactTree from layerClickBoundary.ts and call it here?

export function stopPressPinClick(event: ReactMouseEvent): void {
  if (pressPinClicks.has(event.nativeEvent)) {
    stopInReactTree(event);
  }
}

Comment thread .changeset/trigger-behavior-toggle.md Outdated
'@astryxdesign/core': patch
---

[feat] Tooltip and `useTooltip` take `triggerBehavior` (type `TooltipTriggerBehavior`). `adaptive`, the default, keeps the released behavior. `hover` previews the tooltip on hover and focus, and no touch or pen tap opens it. `toggle` pins the tooltip on a click, tap, Enter, or Space on a button trigger, and the same press closes it. Escape, a press outside, or focus leaving also closes it. The press stops at the trigger: its default action is prevented, the trigger's own handlers still run, and a clickable row, card, or label around it does nothing. With `anchorRef` or a caller's own trigger, a plain `onClick` element around the trigger still receives the press. The trigger reports `aria-expanded` and `aria-controls`, and the tooltip's text is announced once when it pins. A trigger that is not a button gets a development warning. `touchTrigger` now decides taps only under `adaptive`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With an anchored or caller's trigger that is not a native <button> (a role="button" span, say), an Item row around it still runs, because Item's row click skips only native controls; FR9 records this gap. As written, the notes say a clickable row does nothing apart from a plain onClick element. Could this sentence, and the matching ones in Tooltip.doc.mjs, the Tooltip JSDoc and useTooltip's JSDoc and doc, name that exception (or narrow to native-button triggers)?

// for WCAG 1.4.13 (Content on Hover or Focus: hoverable).
const scheduleHide = useCallback(() => {
if (isOpen === true) {
// A pinned tooltip stays when the pointer or focus leaves.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Optional (non-blocking): this restates isPressHeldOpen() on the next line, so the comment can go.

`component:Tooltip` FR9 and FR10, `spec:AST-003` FR4:

- `triggerBehavior` on Tooltip and useTooltip, with the type
  TooltipTriggerBehavior: `adaptive`, the default and the released behavior
  (a tap opens the tooltip unless the trigger acts; an explicit `touchTrigger`
  still decides taps under it until the next minor); `hover` (touch never
  opens it); or `toggle`. Hover and focus preview it under every value. With
  `toggle` on a button trigger, a click, a tap, Enter, or Space pins the
  tooltip and the same press closes it.
- A pinned tooltip stays until Escape, a second press, a press or scroll
  outside (the touch trigger's outside dismissal, which the pin arms: the pin
  owns the layer's touch trigger, so useTooltip makes one usePressPin call),
  or focus moving onto an element outside the trigger and the tooltip (the
  pin listens for it on the trigger, whatever `focusTrigger` is, in the trigger's own document); a press on
  the tooltip's own text keeps it. It takes Escape before the layer beneath
  it. A `triggerBehavior` that changes after mount wires or unwires the
  trigger, and a tooltip whose `triggerBehavior` turns to `adaptive` while pinned
  closes on leave again.
- The press stops at its trigger, in the React tree only, through
  `layerClickBoundary`'s `stopInReactTree`: its default action is prevented,
  the trigger's own handlers still run, and page-level click listeners still
  see it. With `anchorRef`, the caller's own
  handlers still receive the press: the anchor's `onClick` runs, and a plain
  `onClick` element around the anchor receives it unless the anchor's
  `onClick` stops it; Astryx clickable rows, cards, and containers ignore it
  (FR9). The trigger carries aria-expanded and aria-controls on a button
  trigger, and the tooltip's rendered text is announced once when it pins,
  through useAnnounceRenderedText (`spec:AST-086` FR12).
- A non-button trigger gets one development warning and keeps tap-only
  opening (`Layer/usePressPin.ts`, the hover layers' shared press pin).
- `TooltipTriggerBehavior` is a closed union; the API report lists it.
- LayerTriggerBehavior and the touch trigger's armOutsideDismiss
  (useTouchTriggerInternal) stay internal: neither is exported from the Layer
  entry point, and the public useTouchTrigger return is unchanged.
- FR9 records two gaps, each with a current-state item: a pin whose trigger
  renders in another document does not yet close on a press outside there,
  and an Item row still runs on a press of an anchored or caller's trigger
  that is not a native button.
- The changeset, docs and JSDoc name the Item-row exception for an anchored or
  caller's trigger that is not a native button.
@vjeux
vjeux force-pushed the feat/tooltip-press-trigger branch from 56fa37a to 11693c4 Compare November 2, 2026 23:40
@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Updated in 11693c4 (17 files, 1,999 authored lines).

  • Shared stop: layerClickBoundary.ts exports stopInReactTree, and stopPressPinClick calls it, so both layer stops change together. The file's header lists the export.
  • Item-row exception: the changeset, the Tooltip and useTooltip JSDoc, and the Tooltip.doc.mjs (English and Chinese) and useTooltip.doc.mjs texts now say that an Item row still runs when an anchored or caller's trigger is not a native button, matching FR9's recorded gap. feat(Tooltip): a trigger whose tooltip repeats its own text pins without toggle state #9361 closes the gap and narrows those texts.
  • Comment: the comment above isPressHeldOpen() is gone.

This head needs a spec owner's /approve-spec 11693c498b3b50371687fd4d2c79cadeddf7d07c.

@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 11693c4

vjeux added a commit to vjeux/astryx that referenced this pull request Nov 2, 2026
… with triggerBehavior evidence

Two refinements of the toggle's press pin, carried here by the
maintainers' ruling so meta#9232 stays under 2,000 lines:

- Under `triggerBehavior="toggle"`, Space on a `role="button"` trigger acts
  on keyup, as on a native button. The keydown still prevents the page
  scroll. A click with no pointer while Space is down, or in a key press's
  task, is that same press, so a trigger that clicks itself on Space keydown
  or keyup pins once. A keyup with no keydown on the trigger does nothing.
- The shared touch trigger's outside dismissal also listens on the
  trigger's own document. So a tap-opened or pinned Tooltip, and a
  tap-opened HoverCard, whose trigger renders in an iframe closes on a tap or
  press outside there, or a scroll starting outside (`component:Tooltip` FR5
  and FR9, `component:HoverCard` FR5). FR9's gap sentence about the pin in
  another document goes.

The evidence for `component:Tooltip` FR5 and FR9's `triggerBehavior`
verification row:

- Tooltip.test.tsx: `adaptive` by default and explicitly, `hover`, and
  `toggle`, each under a mouse hover and keyboard focus (both preview it),
  a touch and a pen tap (which opens it, never opens it, or pins it), and a
  mouse click and a tap on a button trigger, which only the toggle pins;
  an explicit `touchTrigger` decides taps beside `adaptive` and is ignored
  beside `hover` and `toggle`.
- TouchTrigger.a11y.chromium.spec.ts: a real finger and a pen-typed press on
  the new TriggerBehaviors story: a tap never opens `hover`, opens
  `adaptive`, and pins `toggle`.
- useTooltip.test.tsx: FR9's `useTooltip` clause with a caller's trigger
  under the toggle: the trigger's own onClick runs and an Astryx
  ClickableCard around it does not activate; a plain onClick element around
  it receives the press unless the trigger's onClick stops it.
- The Tooltip record's `triggerBehavior` verification row names this
  evidence in place of its gap.
vjeux added a commit to vjeux/astryx that referenced this pull request Nov 2, 2026
… with triggerBehavior evidence

Two refinements of the toggle's press pin, carried here by the
maintainers' ruling so meta#9232 stays under 2,000 lines:

- Under `triggerBehavior="toggle"`, Space on a `role="button"` trigger acts
  on keyup, as on a native button. The keydown still prevents the page
  scroll. A click with no pointer while Space is down, or in a key press's
  task, is that same press, so a trigger that clicks itself on Space keydown
  or keyup pins once. A keyup with no keydown on the trigger does nothing.
- The shared touch trigger's outside dismissal also listens on the
  trigger's own document. So a pinned Tooltip whose trigger renders in an
  iframe closes on a press outside there, and a tap-opened Tooltip or
  HoverCard closes on a scroll starting outside there, and on a tap outside
  when its trigger takes no focus (`component:Tooltip` FR5 and FR9,
  `component:HoverCard` FR5). FR9's gap sentence about the pin in
  another document goes.

The evidence for `component:Tooltip` FR5 and FR9's `triggerBehavior`
verification row:

- Tooltip.test.tsx: `adaptive` by default and explicitly, `hover`, and
  `toggle`, each under a mouse hover and keyboard focus (both preview it),
  a touch and a pen tap (which opens it, never opens it, or pins it), and a
  mouse click and a tap on a button trigger, which only the toggle pins;
  an explicit `touchTrigger` decides taps beside `adaptive` and is ignored
  beside `hover` and `toggle`.
- TouchTrigger.a11y.chromium.spec.ts: a real finger and a pen-typed press on
  the new TriggerBehaviors story: a tap never opens `hover`, opens
  `adaptive`, and pins `toggle`.
- useTooltip.test.tsx: FR9's `useTooltip` clause with a caller's trigger
  under the toggle: the trigger's own onClick runs and an Astryx
  ClickableCard around it does not activate; a plain onClick element around
  it receives the press unless the trigger's onClick stops it.
- The Tooltip record's `triggerBehavior` verification row names this
  evidence in place of its gap.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval recommended: triggerBehavior pins and closes the tooltip as component:Tooltip FR9 and FR10 describe. The record change has an engineering owner's approval for this head, and the earlier shared-stop and changeset points are fixed.

  • Nothing blocking remains. The FR5, FR9 (triggerBehavior) matrix and FR9's own-text pin stay named evidence gaps in the record, for the stacked follow-ups to close.

[Automated review]

@cixzhang
cixzhang merged commit 1d04d40 into meta:main Nov 3, 2026
61 checks passed
vjeux added a commit to vjeux/astryx that referenced this pull request Nov 3, 2026
… with triggerBehavior evidence

Two refinements of the toggle's press pin, carried here by the
maintainers' ruling so meta#9232 stays under 2,000 lines:

- Under `triggerBehavior="toggle"`, Space on a `role="button"` trigger acts
  on keyup, as on a native button. The keydown still prevents the page
  scroll. A click with no pointer while Space is down, or in a key press's
  task, is that same press, so a trigger that clicks itself on Space keydown
  or keyup pins once. A keyup with no keydown on the trigger does nothing.
- The shared touch trigger's outside dismissal also listens on the
  trigger's own document. So a pinned Tooltip whose trigger renders in an
  iframe closes on a press outside there, and a tap-opened Tooltip or
  HoverCard closes on a scroll starting outside there, and on a tap outside
  when its trigger takes no focus (`component:Tooltip` FR5 and FR9,
  `component:HoverCard` FR5). FR9's gap sentence about the pin in
  another document goes.

The evidence for `component:Tooltip` FR5 and FR9's `triggerBehavior`
verification row:

- Tooltip.test.tsx: `adaptive` by default and explicitly, `hover`, and
  `toggle`, each under a mouse hover and keyboard focus (both preview it),
  a touch and a pen tap (which opens it, never opens it, or pins it), and a
  mouse click and a tap on a button trigger, which only the toggle pins;
  an explicit `touchTrigger` decides taps beside `adaptive` and is ignored
  beside `hover` and `toggle`.
- TouchTrigger.a11y.chromium.spec.ts: a real finger and a pen-typed press on
  the new TriggerBehaviors story: a tap never opens `hover`, opens
  `adaptive`, and pins `toggle`.
- useTooltip.test.tsx: FR9's `useTooltip` clause with a caller's trigger
  under the toggle: the trigger's own onClick runs and an Astryx
  ClickableCard around it does not activate; a plain onClick element around
  it receives the press unless the trigger's onClick stops it.
- The Tooltip record's `triggerBehavior` verification row names this
  evidence in place of its gap.
cixzhang pushed a commit that referenced this pull request Nov 3, 2026
… with triggerBehavior evidence (#9406)

fix(Tooltip): Space on keyup and a press outside in another document, with triggerBehavior evidence

Two refinements of the toggle's press pin, carried here by the
maintainers' ruling so #9232 stays under 2,000 lines:

- Under `triggerBehavior="toggle"`, Space on a `role="button"` trigger acts
  on keyup, as on a native button. The keydown still prevents the page
  scroll. A click with no pointer while Space is down, or in a key press's
  task, is that same press, so a trigger that clicks itself on Space keydown
  or keyup pins once. A keyup with no keydown on the trigger does nothing.
- The shared touch trigger's outside dismissal also listens on the
  trigger's own document. So a pinned Tooltip whose trigger renders in an
  iframe closes on a press outside there, and a tap-opened Tooltip or
  HoverCard closes on a scroll starting outside there, and on a tap outside
  when its trigger takes no focus (`component:Tooltip` FR5 and FR9,
  `component:HoverCard` FR5). FR9's gap sentence about the pin in
  another document goes.

The evidence for `component:Tooltip` FR5 and FR9's `triggerBehavior`
verification row:

- Tooltip.test.tsx: `adaptive` by default and explicitly, `hover`, and
  `toggle`, each under a mouse hover and keyboard focus (both preview it),
  a touch and a pen tap (which opens it, never opens it, or pins it), and a
  mouse click and a tap on a button trigger, which only the toggle pins;
  an explicit `touchTrigger` decides taps beside `adaptive` and is ignored
  beside `hover` and `toggle`.
- TouchTrigger.a11y.chromium.spec.ts: a real finger and a pen-typed press on
  the new TriggerBehaviors story: a tap never opens `hover`, opens
  `adaptive`, and pins `toggle`.
- useTooltip.test.tsx: FR9's `useTooltip` clause with a caller's trigger
  under the toggle: the trigger's own onClick runs and an Astryx
  ClickableCard around it does not activate; a plain onClick element around
  it receives the press unless the trigger's onClick stops it.
- The Tooltip record's `triggerBehavior` verification row names this
  evidence in place of its gap.
@vjeux
vjeux deleted the feat/tooltip-press-trigger branch November 3, 2026 01:03
cixzhang added a commit that referenced this pull request Nov 3, 2026
…#9711)

* fix(Tooltip): remove the unreleased triggerBehavior prop; InfoTip pins through an internal path

triggerBehavior and TooltipTriggerBehavior landed on main in #9232 and were
never released. Tooltip and useTooltip drop them, and touchTrigger keeps
deciding taps as released. InfoTip keeps its press-to-pin through the
module-only TooltipWithTriggerBehavior, so its behavior and public props do
not change. The Space-on-keyup pin and the other-document outside press stay.

- usePressPin's internal behavior type drops the unused hover value, and its
  development warning no longer names the prop.
- Tests use the internal path where they test press-to-pin; the hover cases
  go.
- The a11y story and its Chromium cases use InfoTip, the public press-to-pin
  trigger; the anchored and focusTrigger=never cases go with the prop.
- Tooltip and useTooltip docs return to their released text; InfoTip docs, its
  story and its changeset stop naming the prop; the trigger-behavior
  changeset goes; the core API report is regenerated.

* spec(Tooltip, HoverCard, InfoTip): keep touchTrigger; withdraw triggerBehavior before release

* fix(Tooltip): the public wrappers pin the adaptive behavior; records stop citing HoverCard FR9

CodeBunny on #9711: Tooltip and useTooltip passed a spread or untyped
triggerBehavior through to the press-to-pin path at runtime. Both now pin
triggerBehavior to adaptive, with a regression test each. AST-003 FR4, its
current-state list and the overlay-dismissal Tooltip/HoverCard row no longer
cite component:HoverCard FR9, which the records commit removes; a Tooltip pin
cites Tooltip FR9 and a HoverCard has no press pin. Tooltip's tap guidance
points an info icon at InfoTip.

* docs(AST-003, Tooltip): no HoverCard press pin in AST-003; touchTrigger tap docs point info icons at InfoTip

CodeBunny on #9711: AST-003's current-state list, its FR1–FR6 verification
row, its completion criterion and DEC-6 still named a HoverCard press pin,
which the records commit removes. They now name only the Tooltip pin. The
touchTrigger prop docs say tap is for a button whose only job is the
tooltip, and point an info icon at InfoTip.

* docs(overlay-dismissal, AST-090, StatusDot): no pinned HoverCard; Tooltip zh tap text points at InfoTip

CodeBunny on #9711: overlay-dismissal FR8 and AST-090 FR5, its impact
lines and its verification row still gave a press-pinned HoverCard an
Escape rule. AST-003 FR4 and DEC-6 now name only a pinned Tooltip, so
these lines do too. StatusDot FR5 cites Tooltip DEC-1 for its pin. The
Chinese touchTrigger text matches the English. The wrapper comments say
the option is fixed, not pinned.

* docs(overlay-dismissal): the iframe example and FR8, FR9 verification rows name only a pinned Tooltip

CodeBunny on #9711: two table rows still gave a pinned HoverCard Escape
first. A HoverCard has no press pin, so they name only a pinned Tooltip.

* style(overlay-dismissal): re-pad the two edited table rows

Prettier formatting only, so the lint check passes.

* Merge branch 'main' of https://github.com/meta/astryx into lane4/remove-trigger-behavior

# Conflicts:
#	docs/families/overlay-dismissal.md

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants