Skip to content

spec(Tooltip, HoverCard): rename pressTrigger to triggerBehavior ('adaptive' | 'hover' | 'toggle') - #9379

Merged
cixzhang merged 5 commits into
mainfrom
spec/trigger-behavior
Nov 1, 2026
Merged

cixzhang merged 5 commits into
mainfrom
spec/trigger-behavior

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

Tooltip and HoverCard's pin-on-press prop is renamed from pressTrigger to triggerBehavior, with the values 'adaptive' | 'hover' | 'toggle' (default 'adaptive'). One prop now answers how the layer opens on each device, so touchTrigger folds into it. Nothing has shipped under the old name: it exists only in merged records, so this is a rename before release, not a deprecation. The open implementation pull requests adopt the new name.

  • 'adaptive' (default): today's shipped behavior. Hover on a fine pointer and keyboard focus preview the layer; on touch and pen, a tap opens it unless the trigger performs its own action (Tooltip FR5, DEC-1; the released touchTrigger="auto"); no press pins it.
  • 'hover': hover and keyboard focus preview only; no touch or pen tap opens it (the released touchTrigger="none"); no press pins it.
  • 'toggle': hover and focus still preview it; on every device a click, a completed tap, Enter, or Space pins it, and the same press on a pinned layer closes it (Tooltip and HoverCard FR9, FR10). It replaces touchTrigger="tap" and the earlier pressTrigger="toggle".

Exact decision needed

The public name and values of the prop that decides how a Tooltip or HoverCard opens on each device, including whether a press pins it.

Existing authority searched

Every merged occurrence of pressTrigger under docs/ and in *.doc.mjs files: the Tooltip, HoverCard, InfoTip, and StatusDot component records, architecture:interaction-modality (the toggletip guidance and the INV4 verification row), and the native-first surfaces spec. FieldLabel, AST-003, AST-090, and component docs do not name the prop.

Decision

The owner decided the name triggerBehavior and the values 'adaptive' | 'hover' | 'toggle', default 'adaptive', on 2026-11-01. The records carry the decided values only; no option text is recorded.

  • DEP-0016 deprecates touchTrigger="tap" in favor of triggerBehavior="toggle". touchTrigger remains supported until the next minor; only "tap" is deprecated now. Until then an explicit touchTrigger decides taps under 'adaptive', and 'hover' and 'toggle' ignore it. The deprecating release's codemod is unchanged apart from the target name: it rewrites only icon and span triggers and reports every other site.
  • CLN-0024 removes touchTrigger at the next minor, and 'adaptive' gains FR5's walk then. The minor's codemod maps touchTrigger="auto" by removing it (the default 'adaptive' reproduces it), "none" to triggerBehavior="hover", and "tap" to triggerBehavior="toggle" on icon, span, and identifiable own-text triggers. Button, link, and unknown sites keep the per-kind replacements and reports already recorded.

Rejected alternatives

  • A separate touchTrigger beside triggerBehavior, which splits one question across two props (Tooltip DEC-1).

Claim scope and non-goals

Only the prop's name, values, and default change, plus the DEP-0016 and CLN-0024 wording and the FR5, FR9, and DEC-1 text that name them. Every other rule and word is unchanged. Wider API guidance on behavior-based props is not part of this pull request.

Evidence and implementation relationship

Spec-only. The open implementation pull requests for the toggle, its HoverCard counterpart, InfoTip, the own-text pin, and the tap deprecation adopt triggerBehavior.

Changed records

  • docs/specs/components/Tooltip/Tooltip.spec.md (contract table, compatibility, DEP-0016, CLN-0024, current-state impact, public concepts, FR5, FR9, FR10, AR6, verification map, DEC-1)
  • docs/specs/components/HoverCard/HoverCard.spec.md (same sections)
  • docs/specs/components/InfoTip/InfoTip.spec.md
  • docs/specs/components/StatusDot/StatusDot.spec.md (names the released default touch behavior that 'adaptive' keeps)
  • docs/architecture/interaction-modality.md (toggletip guidance, INV4 verification)
  • docs/specs/AST-082-native-first-surfaces/spec.md

Writing rubric results

  • R1 narration: one now, in the requested lifecycle sentence in DEP-0016 and CLN-0024 ("only "tap" is deprecated now"); it states the deprecation window, not history, so it stays. "Released" and "shipped" name the current public behavior that 'adaptive' and 'hover' keep, not history. No other narration added.
  • R2 research in the record: none.
  • R3 evidence naming a change: none; basis cells are unchanged. The new verification rows name evidence gaps until built, not changes.
  • R4 rejected alternatives over one line or outside a decision: one added, one line, inside Tooltip DEC-1. Existing Rejected: lines are one line each inside their decisions.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none. The open questions in the touched records (interaction-modality OQ1, StatusDot OQ1, the native-first surfaces OQ1) are unanswered and unchanged.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm check:knowledge: Knowledge templates and records are aligned.
  • Prettier on every changed file.
  • git diff --check: clean.

@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 1, 2026 7:51pm 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
🟢 Reviewed (for maintainers only) Nov 1, 2026, 7:57 PM UTC

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

cixzhang commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9d7ccd1

@github-actions github-actions Bot removed 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 · 6ae5662

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; 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

@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.

The rename itself is owner-approved and complete across all six records; two small record edits are needed before merge.

  • HoverCard.spec.md line 82 still says CLN-0024 brings FR5's walk to auto, but CLN-0024 now gives the walk to triggerBehavior="hover".
  • The touchTrigger="none" fallback in CLN-0024 (Tooltip.spec.md line 110) should say that isEnabled={false} on coarse pointers also stops hover and keyboard-focus opening on those devices, and should name the media query.

Because a new commit clears the current approval, an engineering owner re-posts /approve-spec <full head SHA> once the edits land; the author can do this as an engineering owner.

[Automated review]

`triggerBehavior="toggle"` a press on a controlled card reports the toggled
value through `onOpenChange` and does not change the state itself (FR9)
- Migration decision: `component:Tooltip` DEP-0016, then CLN-0024 in the next
minor; both cover HoverCard's and `useHoverCard`'s `touchTrigger`, with the

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 next line still says CLN-0024 brings FR5's walk to auto. CLN-0024 now gives the walk to triggerBehavior="hover" (Tooltip.spec.md line 109), so this should name hover.

| id | `CLN-0024` |
| lifecycle | `DEP-0016` |
| delta | `touchTrigger` is removed from `Tooltip`, `HoverCard`, `useTooltip`, and `useHoverCard`; `touchTrigger` remains supported until the next minor; only `"tap"` is deprecated now (DEP-0016). `triggerBehavior` keeps `hover` and `toggle`, default `hover`: `hover` takes on the released `touchTrigger="auto"` (a tap opens the layer unless the trigger performs its own action, and no press pins it), and `toggle` is unchanged. `touchTrigger="none"` has no value in `triggerBehavior`: remove it, and touch then follows FR5's rule (a tap that already acts leaves the layer shut; an info-only tap opens it); a caller who needs no touch opening at all sets `isEnabled={false}` on coarse pointers. `hover` gains FR5's walk: a tap that already acts on a control around the trigger does not open the layer. A hint-only trigger inside a control migrates by declaring `triggerBehavior="toggle"`, which no codemod can decide; Astryx's own info-only triggers (InfoTip, FieldLabel's info button, and a standalone StatusDot) declare it before this minor; a StatusDot inside a button, link, menu item, or option stays an image whose status the host's accessible name carries. One prop decides what a press does |
| replacement | `touchTrigger="none"` has no value in `triggerBehavior`: remove it, and touch then follows FR5's rule (a tap that already acts leaves the layer shut; an info-only tap opens it); a caller who needs no touch opening at all sets `isEnabled={false}` on coarse pointers. Each remaining `touchTrigger="tap"` site has a named replacement (`spec:AST-017` FR8): a button or link whose only job is its tooltip takes `triggerBehavior="toggle"`, so its tooltip keeps a touch path; a button or link with its own action whose accessible name already carries the layer's text drops `tap` and keeps the default `hover`, so a tap performs the action and opens no layer (`architecture:interaction-modality` INV4's case); any other button or link with its own action moves the layer's information to an adjacent info trigger that declares `triggerBehavior="toggle"`, such as an InfoTip, or into its visible label, so that information keeps a touch path, and then drops `tap`; a trigger whose tooltip repeats its own text takes `triggerBehavior="toggle"` (FR9's own-text exception); an unknown element is reported for a manual choice (`architecture:interaction-modality` INV4) |

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.

isEnabled={false} on coarse pointers also stops hover and keyboard focus from opening the layer on those devices; released touchTrigger="none" only stopped taps. Worth one clause saying so, and naming the query (for example useMediaQuery('(pointer: coarse)')).

@cixzhang cixzhang changed the title spec(Tooltip, HoverCard): rename pressTrigger to triggerBehavior ('hover' | 'toggle') spec(Tooltip, HoverCard): rename pressTrigger to triggerBehavior ('adaptive' | 'hover' | 'toggle') Nov 1, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 1, 2026
@cixzhang

cixzhang commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 6ae5662

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval 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.

The rename is owner-approved at this head and consistent across all six records; one wording fix is needed before merge.

  • Tooltip.spec.md says triggerBehavior="hover" keeps a pen from opening the layer (lines 46, 111, 112, 204 and 344), but FR3 still opens the tooltip on a hovering pen, as the released touchTrigger="none" does; say that no touch or pen tap opens it, as FR5 already does.

A new commit clears the current approval, so an engineering owner re-posts /approve-spec <full head SHA> once the edit lands; the author can do this as an engineering owner.

[Automated review]

| Concept | Closed values or states | Meaning | Availability by variant/orientation/state | Default | Owner | Stability | Invalid-value behavior |
| ---------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------- | ------------------- | ------------------------------------------------------------------------- | -------------------------------- |
| Focus trigger | `auto`, `always`, `never` | Whether keyboard focus opens the tooltip: on focusable triggers (FR4's gap), always, or never. | Every trigger mode. | `auto` | `component:Tooltip` | Stable | TypeScript rejects other values. |
| Trigger behavior | `adaptive`, `hover`, `toggle` | How the trigger opens the tooltip; under every value, hover on a fine pointer and keyboard focus preview it (FR3, FR4). Under `adaptive`, a tap opens it unless the tap already acts (FR5, DEC-1), and no press pins it; under `hover`, touch and pen never open it, and no press pins it; under `toggle`, a click, a completed tap, Enter, or Space pins it, and the same press on a pinned tooltip closes it (FR9). | Every trigger; `toggle` pins only on a button or own-text trigger, and any other trigger keeps tap-only opening (FR9). | `adaptive` | `component:Tooltip` | Stable | TypeScript rejects other values. |

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.

Under hover, a hovering pen still previews through FR3 (this cell's own first clause), and released touchTrigger="none" keeps a pen in detection range on the hover path. Suggest "no touch or pen tap opens it" here, and the same wording at L46, L111, L112 and L344.

@cixzhang

cixzhang commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 456c674

@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.

The pressTrigger to triggerBehavior rename is owner-approved at this head and consistent across all six records; one wording fix remains.

  • Tooltip.spec.md DEC-1 (lines 344-345) still says hover means "touch and pen never open the layer", but FR3, the trigger-behavior row and the released touchTrigger="none" keep a hovering pen's preview; say "no touch or pen tap opens the layer", as the other four places now do.
  • The description's 'hover' bullet says the same and should match.

A new commit clears the current approval, so an engineering owner re-posts /approve-spec <full head SHA> once the edit lands; the author can do this as an engineering owner.

[Automated review]

Comment on lines +344 to +345
opens on a tap; `hover` previews on hover and keyboard focus only, so touch and
pen never open the layer; `toggle` adds the pin on every device. Under

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.

Under hover a hovering pen still previews through FR3 (line 213), as the trigger-behavior row (line 204) and the released touchTrigger="none" say. Suggest: "hover previews on hover and keyboard focus only, so no touch or pen tap opens the layer".

@cixzhang

cixzhang commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec e531412

@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.

The pressTrigger to triggerBehavior rename is owner-approved at this head and consistent across all six records, and the earlier DEC-1 wording fix ("no touch or pen tap opens the layer") has landed, so this is ready to merge. Nothing else is needed; if the branch gets another commit, an engineering owner re-posts /approve-spec <full head SHA>, which the author can do as an engineering owner.

[Automated review]

@cixzhang
cixzhang merged commit a68e0e3 into main Nov 1, 2026
54 checks passed

This branch was successfully deployed

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant