Skip to content

feat(core): a Button shows its full label in a tooltip when the label is cut short - #12169

Merged
josephfarina merged 15 commits into
mainfrom
josephfarina/button-label-tooltip
Nov 17, 2026
Merged

josephfarina merged 15 commits into
mainfrom
josephfarina/button-label-tooltip

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What

A Button in a narrow row cuts its label short with an ellipsis (FR5), and nothing showed the rest of it: "Save and co…". Translated labels make this common at phone widths. When keyboard focus reaches a Button whose label is cut, Button now shows its full label in a tooltip, and only then. This is a new requirement, component:Button FR18.

ToggleButton draws its label inside its own wrapper, where the Button's ellipsis could not reach, so a cut ToggleButton label was clipped flat with no "…". The wrapper now shrinks with the label box and its visible line ends in an ellipsis. The line clips with a small clip margin, so glyph edges that paint outside the text box (the foot of an "A") still show on a label that fits (browsers without overflow-clip-margin trim that edge).

Owner decision

The engineering owner's decision is recorded on this pull request: #12169 (comment). This pull request ships its keyboard-focus part: focus on a cut label shows the full label at once, a touch tap opens nothing, and a caller's tooltip wins. Desktop hover is left as it is on main; the Button record's compatibility rows name the decision.

How

  • One internal hook, useCutTextOnKeyboardFocus in the truncation tooltip module (not exported from the package; a test locks that), owns the behavior. When focus reaches the Button, it is :focus-visible, and the shared interaction-modality reader says the last input was a keyboard, the hook measures the label. If the label is cut, it holds the full label until focus leaves, Escape, or a press. A mouse or pen hover, a pointer-focused field and a touch tap show nothing, so desktop hover behaves as on main. The Text record names the hook.
  • Measured only then: nothing is read at rest, so a page of buttons reads no layout and holds no observers. Each focus measures again, so a label that came to fit shows nothing, and a label cut again (after a resize) shows the tooltip again.
  • The tooltip is a small component in the Tooltip module, loaded after the first render as tooltip code is (the Tooltip entry does not export it). It attaches without a description, because its text is the Button's name, so a screen reader hears it once, and it re-attaches whenever Button renders a new element, such as a link Button that becomes disabled.
  • Icon-only buttons and buttons with a caller tooltip are not measured. A Button wrapped in a caller's Tooltip shows only that tooltip.
  • A hidden copy inside the label (ToggleButton's bold-width reservation) and a visually hidden label do not count as cut text.
  • astryx swizzle Button: Button's copy also brings the truncation tooltip module that Button.tsx imports, and that module's own imports, by relative path; every import in the copy resolves.

Evidence

  • In a real browser (mouse and keyboard): hovering a cut label shows nothing, as on main; clicking it shows nothing; Tab onto it shows the full label at once, with no aria-describedby; Escape closes it; Tab onto a cut Button inside a caller's Tooltip shows only the caller's tooltip; a cut ToggleButton label shows "…" and its full label on focus.
  • At rest nothing changes in Chromium: fitting ToggleButton labels (with and without children, pressed and not, sm/md/lg, at 1x and 2x) are pixel-identical to main, every ToggleButton example is byte-identical in 360 px and 1200 px columns, and Button renders the same element.
  • cutTextOnKeyboardFocus.exports.test.ts: the hook is in no entry point and no package export.
  • Button.truncationTooltip.test.tsx: a cut label shows on keyboard focus with no description; a mouse hover and a mouse-press focus show nothing; blur and a press close it; a fitting label shows none; a caller tooltip and a wrapping Tooltip win; a label cut again shows again; a hidden copy is not cut text; a link Button that becomes disabled keeps the tooltip; nothing is measured at rest; icon-only measures nothing.
  • Button, Text, Tooltip, Popover, ToggleButton, ButtonGroup, IconButton, DropdownMenu and Link suites pass; node scripts/check-component-import-boundaries.mjs holds; the swizzle tests pass.
  • First-load JavaScript on the reference pages (pnpm size:pages, minified / gzip bytes, against the branch's base):
Page Change
docs (Text, Heading, Link, Card, Divider, List) +191 / +56
form (Button, IconButton, TextInput, CheckboxInput, Text, Heading, Card) +1,913 / +763
menu (DropdownMenu, ContextMenu, Button, Text) +1,925 / +670
table (Table, Text, Button) +1,929 / +642
  • Build replay over real build requests: no start, alternatives list or block list changes.

Scope

Components: Button, ToggleButton

  • A new requirement (FR18), stated in the Button record; no new prop.
  • Public text contains no internal context.

Writing rubric results

R1 narration: none; FR18 states what Button does, in the present tense.
R2 research: none in the record.
R3 evidence: FR18's basis names the Text truncation tooltip and interaction modality; its verification row names the test and a browser check.
R4 rejected alternatives: none recorded.
R5 change references: none.
R6 open questions: none added.
R7 project status: none.

@vercel

vercel Bot commented Nov 16, 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 17, 2026 6:20am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 6:42 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 16, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 16, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 2d68e89

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

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c900a6d

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Button · Storybook 65.8 kB (+778 B) · 10.8 kB CSS (0) 841 (+39) ✓ · ✓ · ✗
charts/ChartLegend 🔴 47.5 kB (+7.1 kB) · 224 B CSS (0) — — · — · —
Timestamp 🔴 30.4 kB (+3.5 kB) · 11.1 kB CSS (0) — — · — · —
104 more components
Component Size LoC Visual · A11y · RTL
Timer 15.0 kB (+1.9 kB) · 6.1 kB CSS (0) — — · — · —
Heading 13.4 kB (+1.9 kB) · 5.5 kB CSS (0) — — · — · —
Text · Storybook 12.9 kB (+1.8 kB) · 5.5 kB CSS (0) 861 (+121) ✓ · ✓ · —
ChatMessageList 29.2 kB (+1.8 kB) · 7.1 kB CSS (0) — — · — · —
ChatToolCalls 33.5 kB (+1.8 kB) · 8.5 kB CSS (0) — — · — · —
Spinner 25.8 kB (+1.8 kB) · 6.3 kB CSS (0) — — · — · —
lab/LineClamp 15.3 kB (+1.8 kB) · 168 B CSS (0) — — · — · —
ToggleButton 92.9 kB (+840 B) · 10.9 kB CSS (+29 B) — ✓ · ✓ · —
Thumbnail 70.3 kB (+866 B) · 12.4 kB CSS (0) — — · — · —
lab/TransferList 113.1 kB (+845 B) · 1.2 kB CSS (0) — — · — · —
lab/ChatReactionBar 115.7 kB (+840 B) · 1.1 kB CSS (0) — — · — · —
richtext/RichTextView 283.4 kB (+836 B) · 2.3 kB CSS (0) — — · — · —
lab/Comments 371.2 kB (+831 B) · 2.5 kB CSS (0) — — · — · —
lab/TransferListSelector 122.0 kB (+830 B) · 1.4 kB CSS (0) — — · — · —
Carousel 75.6 kB (+819 B) · 11.7 kB CSS (0) — — · — · —
lab/CommentThread 364.4 kB (+818 B) · 2.4 kB CSS (0) — — · — · —
Lightbox 146.8 kB (+815 B) · 12.0 kB CSS (0) — — · — · —
lab/TourStep 94.1 kB (+806 B) · 691 B CSS (0) — — · — · —
lab/ChatEmojiPicker 114.5 kB (+803 B) · 773 B CSS (0) — — · — · —
TableSelectionToolbar 76.2 kB (+802 B) · 14.1 kB CSS (0) — — · — · —
SideNav 122.1 kB (+796 B) · 12.2 kB CSS (0) — — · — · —
Tokenizer 105.1 kB (+792 B) · 20.4 kB CSS (0) — — · — · —
charts/ChartTooltip 216.3 kB (+791 B) · 451 B CSS (0) — — · — · —
Pagination 124.7 kB (+788 B) · 19.1 kB CSS (0) — — · — · —
IconButton 65.9 kB (+786 B) · 10.8 kB CSS (0) — — · — · —
richtext/RichTextEditor 306.7 kB (+784 B) · 2.6 kB CSS (0) — — · — · —
Calendar 76.9 kB (+778 B) · 11.4 kB CSS (0) — — · — · —
ChatSendButton 66.2 kB (+775 B) · 10.8 kB CSS (0) — — · — · —
Toast 104.5 kB (+775 B) · 11.1 kB CSS (0) — — · — · —
Banner 67.8 kB (+773 B) · 11.3 kB CSS (0) — — · — · —
SideNavItem 77.8 kB (+773 B) · 11.9 kB CSS (0) — — · — · —
Popover 99.5 kB (+772 B) · 15.2 kB CSS (0) — — · — · —
charts/Chart 239.2 kB (+769 B) · 516 B CSS (0) — — · — · —
ChatDictationButton 66.4 kB (+767 B) · 10.9 kB CSS (0) — — · — · —
lab/CommentComposer 174.8 kB (+767 B) · 1.9 kB CSS (0) — — · — · —
DrawerHeader 68.9 kB (+766 B) · 13.8 kB CSS (0) — — · — · —
MobileNav 77.1 kB (+764 B) · 11.4 kB CSS (0) — — · — · —
DialogHeader 68.7 kB (+761 B) · 12.4 kB CSS (0) — — · — · —
SideNavHeading 83.4 kB (+758 B) · 12.1 kB CSS (0) — — · — · —
TopNav 78.8 kB (+757 B) · 11.8 kB CSS (0) — — · — · —
TopNavHeading 82.9 kB (+757 B) · 12.0 kB CSS (0) — — · — · —
MobileNavToggle 66.1 kB (+756 B) · 10.8 kB CSS (0) — — · — · —
Stepper 67.5 kB (+753 B) · 10.9 kB CSS (0) — — · — · —
AlertDialog 129.5 kB (+752 B) · 15.5 kB CSS (0) — — · — · —
lab/ListInput 94.4 kB (+751 B) · 922 B CSS (0) — — · — · —
Typeahead 88.7 kB (+747 B) · 13.5 kB CSS (0) — — · — · —
SideNavCollapseButton 66.7 kB (+744 B) · 10.8 kB CSS (0) — — · — · —
MultiSelector 102.3 kB (+743 B) · 17.8 kB CSS (0) — — · — · —
PowerSearch 307.7 kB (+743 B) · 25.6 kB CSS (0) — — · — · —
NumberInput 78.3 kB (+737 B) · 12.2 kB CSS (0) — — · — · —
ChatLayoutScrollButton 66.4 kB (+735 B) · 11.0 kB CSS (0) — — · — · —
lab/EmojiPicker 93.3 kB (+735 B) · 751 B CSS (0) — — · — · —
ChatLayout 89.1 kB (+730 B) · 11.4 kB CSS (0) — — · — · —
Markdown 203.8 kB (+725 B) · 22.0 kB CSS (0) — — · — · —
FileInput 74.9 kB (+723 B) · 11.7 kB CSS (0) — — · — · —
Selector 113.7 kB (+723 B) · 18.7 kB CSS (0) — — · — · —
CodeBlock 81.2 kB (+720 B) · 12.1 kB CSS (0) — — · — · —
ChatComposer 85.3 kB (+719 B) · 12.9 kB CSS (0) — — · — · —
lab/DialogHeroHeader 89.5 kB (+719 B) · 372 B CSS (0) — — · — · —
TabMenu 79.6 kB (+714 B) · 11.9 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 300.4 kB (+709 B) · 454 B CSS (0) — — · — · —
TimeInput 175.7 kB (+705 B) · 17.0 kB CSS (0) — — · — · —
TopNavMegaMenu 76.9 kB (+698 B) · 12.7 kB CSS (0) — — · — · —
ChatComposerInput 83.0 kB (+697 B) · 12.1 kB CSS (0) — — · — · —
ChatComposerTokenElement 83.0 kB (+696 B) · 12.1 kB CSS (0) — — · — · —
BaseTypeahead 79.1 kB (+693 B) · 11.7 kB CSS (0) — — · — · —
TopNavMenu 82.3 kB (+689 B) · 12.0 kB CSS (0) — — · — · —
lab/DiffViewer 93.9 kB (+667 B) · 2.1 kB CSS (0) — — · — · —
lab/Schedule 115.4 kB (+667 B) · 3.9 kB CSS (0) — — · — · —
DateRangeInput 100.0 kB (+666 B) · 13.3 kB CSS (0) — — · — · —
AppShell 98.4 kB (+662 B) · 14.4 kB CSS (0) — — · — · —
TextInput 73.4 kB (+654 B) · 12.0 kB CSS (0) — — · — · —
DateInput 200.8 kB (+649 B) · 18.0 kB CSS (0) — — · — · —
DateTimeInput 224.3 kB (+644 B) · 19.8 kB CSS (0) — — · — · —
MoreMenu 108.4 kB (+636 B) · 18.9 kB CSS (0) — — · — · —
ComplexSelector 78.3 kB (+633 B) · 12.7 kB CSS (0) — — · — · —
DropdownMenu 108.1 kB (+629 B) · 18.9 kB CSS (0) — — · — · —
Table 120.8 kB (+609 B) · 19.7 kB CSS (0) — — · — · —
TableHeaderCell 103.6 kB (+608 B) · 19.0 kB CSS (0) — — · — · —
ContextMenu 102.7 kB (+604 B) · 18.8 kB CSS (0) — — · — · —
BreadcrumbItem 97.6 kB (+598 B) · 13.3 kB CSS (0) — — · — · —
TableCell 103.9 kB (+598 B) · 19.2 kB CSS (0) — — · — · —
Switch 109.0 kB (+65 B) · 10.0 kB CSS (0) — — · — · —
Link 56.5 kB (+58 B) · 7.1 kB CSS (0) — — · — · —
TextArea 66.9 kB (+57 B) · 9.4 kB CSS (0) — — · — · —
Slider 114.6 kB (+55 B) · 8.9 kB CSS (0) — — · — · —
DropdownMenuSubMenu 78.6 kB (+26 B) · 10.5 kB CSS (0) — — · — · —
CheckboxList 73.2 kB (+7 B) · 7.8 kB CSS (0) — — · — · —
CommandPalette 78.0 kB (+3 B) · 12.8 kB CSS (0) — — · — · —
ListItem 79.1 kB (+3 B) · 12.1 kB CSS (0) — — · — · —
RadioListItem 76.2 kB (+1 B) · 10.7 kB CSS (0) — — · — · —
CheckboxInput 69.1 kB (0) · 10.2 kB CSS (0) — — · — · —
CheckboxListItem 80.0 kB (0) · 12.1 kB CSS (0) — — · — · —
Field 59.5 kB (0) · 7.3 kB CSS (0) — — · — · —
ProgressBar 11.9 kB (0) · 6.4 kB CSS (0) — — · — · —
RadioList 60.8 kB (0) · 7.4 kB CSS (0) — — · — · —
StatusDot 33.9 kB (0) · 5.4 kB CSS (0) — — · — · —
ToggleButtonGroup 41.3 kB (0) · 3.7 kB CSS (0) — ✓ · ✓ · ✓
Tooltip · Storybook 32.2 kB (0) · 4.5 kB CSS (0) 901 (+23) ✓ · ✓ · ✓
lab/CommentPin 60.4 kB (0) · 1.2 kB CSS (0) — — · — · —
InputGroup 61.1 kB (−1 B) · 7.9 kB CSS (0) — — · — · —
lab/SelectableCardGroup 68.9 kB (−1 B) · 162 B CSS (0) — — · — · —
lab/TabBarMoreList 102.0 kB (−1 B) · 1.8 kB CSS (0) — — · — · —
CommandPaletteInput 32.9 kB (−2 B) · 7.6 kB CSS (0) — — · — · —

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

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec aa4eea9

@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. Showing a cut label in full is a good addition and FR18 is approved at this head, but the way the tooltip loads and replays the first interaction conflicts with the import-boundaries record, and it duplicates an existing module.

  • The tooltip layer starts loading only on the first hover or focus (internal/cutTextTooltip.tsx, lines 157–173), while architecture:component-import-boundaries INV2 and DEC-4 require tooltip code to load after first paint, so start the load then or show the cut label through Button's existing tooltip hook, which Button already loads.
  • A hover that leaves the Button before the layer loads still opens its tooltip and leaves it open (crossing two cut Buttons opens both), which INV4 forbids, because nothing drops the held hover on pointer leave or on a mouse press as useTruncationTooltipInterest does.
  • internal/cutTextTooltip.tsx copies the loader, interest handoff, handlers and context wrapper of Text/TruncationTooltip.tsx, and Button now runs a second tooltip beside its own, so extend the existing truncation tooltip or Button's tooltip hook instead of adding a parallel path.
  • packages/core/src/internal/cutTextTooltip.tsx is a new internal shared module (imported by Button/Button.tsx) that no current record names, so show its usage, why it is needed and why Text/TruncationTooltip.tsx is not enough, for an owner API decision.
  • packages/core/src/Tooltip/cutTextTooltipLayer.tsx is a new internal shared module (imported by internal/cutTextTooltip.tsx) that no current record names, so show its usage, why it is needed and why the Tooltip's anchorRef mode or Button's own tooltip hook is not enough, for an owner API decision.
  • Some text does not match the code: the cutTextTooltip.tsx header names TableHeaderCell as a user though nothing there imports it, the layer's header says deferring it keeps the tooltip hook out of up-front code though Button imports useTooltip statically, and the changeset's [fix] and the description's "One defect is restored" describe a new requirement (FR18) rather than a restored behavior.

Separately, showing this tooltip on desktop mouse hover still needs an owner decision before approval. A hover that stays, keyboard focus, fitting labels, icon-only Buttons and caller tooltips already behave as FR18 describes.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim (changeset): a cut label shows in full on hover and keyboard focus — verified (new tests; browser check).
  • Claim (changeset): labels that fit show no tooltip — verified (test; browser check).
  • Claim (changeset): screen readers hear the name once — verified at the attribute level (no aria-describedby); with a children override the tooltip text differs from the name.
  • Claim (changeset): this is a fix — false: FR18 is a new requirement.
  • Claim: FR5 cuts the label, and Text and Heading already show cut text in a tooltip — verified against the records.
  • Claim: Button shows the label in its existing tooltip — false: a second tooltip instance is mounted.
  • Claim: the maintainers decided to bring the tooltip to Button — not verified: no decision is cited.
  • Claim: the label is measured only on mouse or pen enter or keyboard focus, never at rest — verified (code; "measures nothing at rest" test).
  • Claim: the layer loads on demand, so Button's up-front code does not grow by it — verified as written, but it contradicts DEC-4, and the hook it defers is already eager in Button.
  • Claim: the tooltip answers that same hover or focus through the existing handoff — verified for a hover that stays; false for a hover that leaves before the load.
  • Claim: the measuring code is a shared internal module — verified; no record names it.
  • Claim: icon-only Buttons and Buttons with a caller tooltip are not measured — verified (code; tests).
  • Claim: no new prop, and the same element renders whether or not the tooltip shows — verified.
  • Claim: the regression test fails on main (3 of 7) and passes with the change — verified.
  • Claim: the listed test suites pass — verified for Button, Tooltip, IconButton and ButtonGroup; Popover and DropdownMenu not rerun.
  • Claim: knowledge records and templates are aligned — verified.
  • Claim: one defect is restored — false (see the fix label).
  • Claim: no new public API hides under the fix label — verified for API; a new default interaction ships under it.
  • Claim: public text holds no internal context — verified.
  • File .changeset/button-label-tooltip.md: fix label.
  • File docs/specs/components/Button/Button.spec.md: clear.
  • File packages/core/src/Button/Button.doc.mjs: the Chinese width text is not updated (non-blocking); the rest is formatting.
  • File packages/core/src/Button/Button.truncationTooltip.test.tsx: no case for an interaction before the layer loads.
  • File packages/core/src/Button/Button.tsx: second tooltip instance.
  • File packages/core/src/Tooltip/cutTextTooltipLayer.tsx: unnamed shared module; header claim.
  • File packages/core/src/internal/cutTextTooltip.tsx: load on intent; held hover not dropped; copy of the truncation tooltip; unnamed shared module; header claim.

Automated review (maintainer link)

Comment thread packages/core/src/Button/Button.tsx Resolved
Comment thread .changeset/button-label-tooltip.md Resolved
…n's eager tooltip hook for a cut label; ToggleButton paints its ellipsis
@josephfarina josephfarina changed the title fix(core): a Button shows its full label in a tooltip when the label is cut short feat(core): a Button shows its full label in a tooltip when the label is cut short Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 73343ed

@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 cut-label tooltip now reuses the shared truncation handoff and Button's own tooltip hook, which fixes every blocking point from the previous revision, and FR18 is approved at this head. Four points remain:

  • Showing this tooltip on a desktop mouse or pen hover (Button.tsx, the onPointerEnter handlers) is a desktop behavior change that needs an owner decision: gate the hover path to touch input, or cite the owner's decision.
  • Miss: a cut Button wrapped in a caller's <Tooltip> opens both tooltips at the same spot on hover and on keyboard focus, and the cut-label tooltip hides the caller's text, because canShowCutLabel (Button.tsx:983) checks only the tooltip prop.
  • After a cut label fits and is then cut again, as after a resize, the next hover or focus shows nothing, because the remounted tooltip finds the held interaction already read (Button.tsx:997-1001, Text/TruncationTooltip.tsx:107).
  • An unpressed ToggleButton whose label fits can still open the tooltip, because isLabelCut (Button.tsx:784-786) also measures the hidden bold width copy, so skip hidden and aria-hidden elements there as visibleLabelText does.

Each fix needs a test for its case; the second and third show only with real browser event order.

Claims and files checked

Review mode: incremental; reason: none

  • Changeset and description: a cut label shows in full on hover and keyboard focus — verified for the first hover or focus (new tests, browser check); false after the label is cut again.
  • Changeset: labels that fit look the same and show no tooltip — verified for Button; false for an unpressed ToggleButton in a narrow band.
  • Changeset and description: a cut ToggleButton label now shows an ellipsis — verified (browser check; the base clips it flat).
  • Changeset and description: screen readers hear the name once — verified at the attribute level (no description added); with a children override the tooltip text differs from the name.
  • Description: measured on interaction only, never at rest — verified (code, test).
  • Description: reuses the truncation tooltip's handoff, and a hover that leaves or a mouse press drops it — verified (code, test).
  • Description: shows through Button's eager tooltip hook, so nothing loads later, and the import-boundary check holds — verified (boundary check); Button's up-front code grows by about 0.5 KB gzip.
  • Description: icon-only Buttons and Buttons with a caller tooltip are not measured, and a caller's tooltip replaces this one — verified for the tooltip prop; false for a wrapping Tooltip.
  • Description: the new test fails on main and passes with the change — verified (3 of 8 fail on the base, 8 of 8 pass).
  • Description: the listed suites pass — verified for Button, ButtonGroup, IconButton, Text, Heading, ToggleButton and Tooltip; Popover and DropdownMenu not rerun.
  • Description: ToggleButton examples are unchanged at rest at 360 px and 1200 px — not rerun.
  • Description: the build replay shows no change — not checked.
  • Description: a new requirement with no new prop, and no internal context in public text — verified.
  • File .changeset/button-label-tooltip.md: clear.
  • File docs/specs/components/Button/Button.spec.md: clear.
  • File packages/core/src/Button/Button.doc.mjs: the Chinese width text does not mention the tooltip (non-blocking); the rest is formatting.
  • File packages/core/src/Button/Button.truncationTooltip.test.tsx: no case for a wrapping Tooltip or a label cut again.
  • File packages/core/src/Button/Button.tsx: desktop hover; wrapping Tooltip covered; re-cut hover lost; hidden copy measured.
  • File packages/core/src/Text/TruncationTooltip.tsx: clear.
  • File packages/core/src/ToggleButton/ToggleButton.tsx: clear; its hidden copy's false positive is fixed in Button's measure.

Automated review (maintainer link)

Comment thread packages/core/src/Button/Button.tsx Resolved
Comment thread packages/core/src/Button/Button.tsx Resolved
Comment thread packages/core/src/Button/Button.tsx Resolved
Comment thread packages/core/src/Button/Button.tsx Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 73343ed

Owner decision (engineering owner, covering this head): the cut-label tooltip opens on desktop too. A mouse or pen hover and keyboard focus open it after the usual tooltip delay, and only when the label is actually cut, never when it fits. Touch uses a long press. A caller's own Tooltip takes precedence, so a Button never shows two tooltips (this needs a test). The tooltip adds no duplicate description, since the accessible name is already the full label.

… cut again shows it again; hidden copies don't count as cut
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0d1e7db

Owner decision (engineering owner, covering this head): the cut-label tooltip opens on desktop too. A mouse or pen hover and keyboard focus open it after the usual tooltip delay, and only when the label is actually cut, never when it fits. Touch uses a long press. A caller's own Tooltip takes precedence, so a Button never shows two tooltips (this needs a test). The tooltip adds no duplicate description, since the accessible name is already the full label.

@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (josephfarina, engineering owner, 2026-11-16): a Button whose label is cut shows its full label in a tooltip on desktop. A mouse or pen hover opens it after the usual tooltip delay, and keyboard focus opens it at once, as a tooltip does; both happen only when the label is actually cut, never when it fits. This is not gated to touch input. On touch, a tap presses the Button and opens nothing. A caller's own tooltip (the tooltip prop or a wrapping Tooltip) takes precedence, and the tooltip adds no duplicate description because the accessible name is already the full label. The same holds for a cut table header cell.

…d a shared attach; ToggleButton's fitting labels paint as before
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 46bc455

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 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. Since the last review, Button's swizzle copy passes the swizzle proof again and fitting ToggleButton labels paint exactly as before, and the record change is approved at this head; two points remain:

  • Showing this tooltip on a desktop mouse or pen hover (the onPointerEnter handlers in Button.tsx, which skip only touch) is a desktop behavior change that needs an owner decision: gate the hover path to touch input, or cite the owner's decision.
  • The description says astryx swizzle Button copies only public imports, but Button's copy now carries six private modules by relative path (24 files become 30), so please reword that claim.
  • Miss (non-blocking): the Button record's "Contract at a glance" rows still say it records shipped behavior with no default change, which the new compatibility rows contradict; useUndescribedTrigger's comment also names a table heading caller that does not exist.
Claims and files checked

Review mode: full; reason: spec-record

  • Changeset: a cut Button label shows in full on hover and keyboard focus — verified (unit tests; Chromium hover and Tab).
  • Changeset: a cut ToggleButton label now ends in an ellipsis — verified (Chromium; the base clips it flat).
  • Changeset: labels that fit look the same and show no tooltip — verified (no tooltip; every fitting Button and ToggleButton frame is pixel-identical to the base).
  • Changeset: screen readers hear the name once — verified at the attribute level (no description is added).
  • Changeset: patch bump for a feature — verified against the 0.x changeset policy.
  • Description: nothing showed a cut label in full before — verified (base frames).
  • Description: this is a new Button requirement — verified.
  • Description: ToggleButton's wrapper now shrinks and its visible line ends in an ellipsis, and the clip margin keeps glyph edges on a fitting label — verified in Chromium.
  • Description: the owner decision is recorded on the pull request and named in the record — true as stated; it does not meet the desktop-behavior rule (see above).
  • Description: the label is measured only when a hover or focus arrives, never at rest, and each later interaction measures again — verified (code; at-rest and re-cut tests).
  • Description: the truncation handoff is reused, and a leaving hover or a mouse press drops the held interaction — verified (tests).
  • Description: the tooltip uses Button's public tooltip hook, loads nothing later, and the import-boundary check holds — verified.
  • Description: astryx swizzle Button copies only public imports — false (the copy carries six private modules).
  • Description: the attach hook re-attaches when Button renders a new element — verified (test).
  • Description: the tooltip text is the Button's name and adds no description — verified for label; with a children override it shows the visible children.
  • Description: icon-only Buttons and a caller tooltip are not measured, and a wrapping Tooltip shows alone — verified (code; tests; Chromium).
  • Description: hover opens after the delay, keyboard focus at once, a touch tap opens nothing, and a press with the hover drops it — verified (Chromium; code; test).
  • Description: a hidden copy inside the label does not count as cut — verified (test).
  • Description: the listed browser results — hover, focus, fitting, wrapped and ToggleButton cases verified in Chromium; resize and pointer crossing verified by unit tests.
  • Description: nothing changes at rest, ToggleButton examples are identical at narrow and wide widths, and Button renders the same element — verified (pixel-identical frames).
  • Description: the new test fails on main and passes with the change — verified (5 of 13 fail on the base; 13 of 13 pass).
  • Description: the listed suites, the boundary check and the swizzle test pass — verified (46 test files, 1,358 tests).
  • Description: the build replay shows no change — not checked.
  • Description: no new prop, and no internal context in public text — verified.
  • Description rubric R1 to R7 — verified.
  • File .changeset/button-label-tooltip.md: clear.
  • File docs/specs/components/Button/Button.spec.md: FR18 and the compatibility rows approved at this head; the "Contract at a glance" rows are stale (non-blocking).
  • File packages/core/src/Button/Button.doc.mjs: clear.
  • File packages/core/src/Button/Button.truncationTooltip.test.tsx: clear.
  • File packages/core/src/Button/Button.tsx: the desktop hover needs an owner decision.
  • File packages/core/src/Text/TruncationTooltip.tsx: comment wording (non-blocking).
  • File packages/core/src/ToggleButton/ToggleButton.tsx: clear.

Automated review (maintainer link)

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

Copy link
Copy Markdown
Contributor Author

/approve-spec c68c5ba

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 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 keyboard-only cut-label tooltip and the ToggleButton ellipsis behave as the Button record now states, and the record change is approved at this head. Two description fixes and one size report remain:

  • The description still describes a mouse or pen hover tooltip, a reused truncation-tooltip interest handoff, hover evidence, a "crossing two cut buttons" test and a desktop-hover owner decision that this head removed (the tooltip now opens only on keyboard focus through showCutLabel in Button.tsx, and the record's decider line says a hover opens nothing), so please rewrite those sections for the keyboard-only behavior.
  • The description says astryx swizzle Button copies only public imports, but because Button.tsx imports useUndescribedTrigger from the truncation tooltip module, Button's copy grows from 24 to 30 files with six private modules, so please reword the claim or move that hook into the Button folder, its only caller.
  • Miss: this pull request grows the shared Button.tsx and Text/TruncationTooltip.tsx modules, so please report the first-load gzip delta, base against head, for the four reference pages (docs, form, menu and table).

Non-blocking: a keyboard-opened cut-label tooltip stays open through a mouse click on the same Button, which a tooltip prop tooltip does not (the inline notes cover that and three wording fixes); separately, the pr-interaction (4/6) failure is one missed frame in AlertDialog's main-thread-block motion test, which this change does not reach, so a rerun should clear it.

Claims and files checked

Review mode: full; reason: spec-record

  • Changeset: a cut Button label shows in full when keyboard focus reaches it — verified (unit tests; Chromium Tab).
  • Changeset: a cut ToggleButton label now shows an ellipsis — verified (Chromium; the base clips it flat).
  • Changeset: labels that fit look the same and show no tooltip — verified (no tooltip on focus; the truncation and ToggleButton label stories are pixel-identical to the base).
  • Changeset: screen readers hear the name once — verified at the attribute level (no aria-describedby).
  • Changeset: a patch bump tagged as a feature — consistent with the other Core feature changesets.
  • Description: nothing showed a cut label in full before — verified (base frames).
  • Description: the Button shows its full label only when the label is cut, as Text and Heading do — true for keyboard focus; Text and Heading open on hover instead, so the comparison misleads.
  • Description: this is a new Button requirement — verified.
  • Description: ToggleButton's wrapper shrinks, its visible line ends in an ellipsis, and the clip margin keeps glyph edges on a fitting label — verified in Chromium.
  • Description: the linked owner decision covers desktop hover and the record names it — false (that decision opens the tooltip on hover; the record and the code open nothing on hover).
  • Description: fine-pointer behavior changes on purpose, with hover before and after results — false (a hover shows nothing on the head, as on the base).
  • Description: the label is measured when a mouse or pen enters or keyboard focus arrives, never at rest — false for mouse and pen; true for keyboard focus and at rest.
  • Description: the truncation tooltip's interest handoff is reused with a new measure option, and a leaving hover or a press drops the held interaction — false (Button does not use it, and the pull request does not change it).
  • Description: the tooltip uses Button's public tooltip hook, nothing loads later, and the import-boundary check holds — verified (boundary check passes).
  • Description: astryx swizzle Button copies only public imports — false (24 to 30 files, six private modules).
  • Description: the attach hook re-attaches when Button renders a new element — verified (test).
  • Description: the tooltip text is the Button's name and adds no description — verified for label; with a children override it shows the visible children.
  • Description: icon-only Buttons and a caller tooltip are not measured, and a wrapping Tooltip shows alone — verified (tests; Chromium).
  • Description: hover opens after the delay, keyboard focus at once, a touch tap opens nothing — false for hover; true for focus and touch (Chromium).
  • Description: each interaction measures again, so a re-cut label shows again — verified for focus (test).
  • Description: a hidden copy inside the label does not count as cut — verified (test).
  • Description: the listed real-browser results — the focus, fitting, wrapped and ToggleButton cases verified in Chromium; the hover and pointer-crossing results are false for this head.
  • Description: nothing changes at rest and Button renders the same element — verified for the stories captured (pixel-identical).
  • Description: the new test covers hover, focus and pointer crossing, and fails on main — hover and crossing cases are not in the file; it fails on the base (5 of 13) and passes on the head (13 of 13).
  • Description: the listed suites, the boundary check and the swizzle test pass — verified (40 test files, 1,209 tests; Popover not run).
  • Description: the build replay shows no change — not checked.
  • Description: no new prop, and no internal context in public text — verified.
  • Description: writing rubric R1 to R7 — verified.
  • File .changeset/button-label-tooltip.md: clear.
  • File docs/specs/components/Button/Button.spec.md: FR18 and its compatibility rows approved at this head; FR18's "tooltip text equals the label" wording (non-blocking).
  • File packages/core/src/Button/Button.doc.mjs: the dense width line leaves out "on keyboard focus" (non-blocking).
  • File packages/core/src/Button/Button.truncationTooltip.test.tsx: clear; header still says "on hover" (non-blocking).
  • File packages/core/src/Button/Button.tsx: the swizzle growth comes from its import of the truncation module; the tooltip survives a mouse press (non-blocking).
  • File packages/core/src/Text/TruncationTooltip.tsx: header and hook comment wording (non-blocking).
  • File packages/core/src/ToggleButton/ToggleButton.tsx: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Button/Button.tsx Resolved
Comment thread packages/core/src/Button/Button.tsx Resolved
| FR15 | Hover paints the shared interaction overlay on hover-capable pointers, and a press paints the shared pressed overlay through the press controller: at once under a mouse or a pen (`spec:AST-094` FR11's fine-pointer profile) and on FR11's control profile under a finger, fading out on release on the theme's exit motion tokens (`--duration-exit`, `--ease-exit`; `spec:AST-094` FR5). Under a coarse pointer, while a press is on or fading, Button paints the press on its own `::before`; a caller's `::before` styles apply on top of that layer and win where they overlap, so a decoration that must stay through a touch press belongs on a child element. Without a reduced-motion preference, a standalone Button also scales to 0.98 on a mouse press, or while the touch press reads on; under reduced motion it MUST NOT scale (`design:reduced-motion` DR1). While its own popup is open (`aria-haspopup` with `aria-expanded="true"`), a press MUST NOT scale it, and a scale it had ends at once, so the popup anchors to the Button at rest (`architecture:layer-runtime` INV22). All of this paint follows the element's exposed disabled state: a Button that is natively disabled or exposes `aria-disabled="true"` (busy-only, disabled with a tooltip, or a caller's own `aria-disabled`) shows no overlay and no press scale, even when it stays operable. Inside a ButtonGroup the press scale does not apply. Button's hover and press transitions are fast, and instant under reduced motion. | Current source and tests; `spec:AST-094` FR11 and DEC-21 for the mouse and pen press |
| FR16 | The ghost variant carries the edge-compensation marker so an enclosing container can align it flush with its edge; other variants do not. | Current source; edge-compensation tests |
| FR17 | `ref`, `className`, `style`, `xstyle`, and other DOM props reach the root element. A caller's own `aria-busy` and `aria-disabled` are kept beside Button's own (either one sets the attribute); a caller `aria-disabled` changes exposure and paint only and does not make the Button inert. The tooltip trigger shares the caller's `ref`, which stays attached across rerenders. | Current source and tests |
| FR18 | When the label is cut short (FR5) and no caller tooltip describes the Button (its `tooltip` prop or a wrapping `Tooltip`), keyboard focus on the Button shows the full label in a tooltip at once, and only then; a mouse or pen hover shows nothing, and a touch tap presses the Button and opens nothing. The label is measured when keyboard focus reaches the Button, never at rest, so a label cut again after a resize shows the tooltip again, and a hidden copy of the label does not count as cut text. The tooltip text equals the label, so it adds nothing to `aria-describedby` and the name is not read twice. Escape or moving focus away closes it. An icon-only Button measures nothing. | Owner decision; `architecture:interaction-modality`; `component:Text` |

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.

Non-blocking: with a children override, the tooltip shows the visible children text (visibleLabelText of the label span), not label, so "The tooltip text equals the label" does not hold there. Suggested: "The tooltip shows the visible label text in full; it adds nothing to aria-describedby, so the name is not read twice."

icon: 'icon element rendered before label text; unsized Astryx Icon defaults to sm for sm/md buttons and md for lg',
isIconOnly: 'when true, renders square icon-only button; label becomes aria-label',
width: "Width of button. Numbers=pixels, strings=as-is (e.g. '100%' for full-width). Default: content width, capped at the container; label truncates w/ ellipsis in a narrow row; icon-only stays square.",
width: "Width of button. Numbers=pixels, strings=as-is (e.g. '100%' for full-width). Default: content width, capped at the container; label truncates w/ ellipsis in a narrow row (full label in a tooltip); icon-only stays square.",

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.

Non-blocking: "(full label in a tooltip)" reads as if the tooltip always shows. Suggested: "(full label in a tooltip on keyboard focus)", as the English and Chinese entries say.

Comment on lines +199 to +204
/**
* Attaches a tooltip to its anchor without a description, for a tooltip whose
* content is the anchor's own name (a cut Button label), so
* a screen reader does not hear the name twice. `attach` is the tooltip hook's
* trigger ref.
*/

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.

Non-blocking (INV29): the hook only attaches the trigger ref to the anchor's current element. Leaving out describedBy is the caller's choice, so "without a description" describes Button, not this hook. The file header's @output and @position also do not list this export or Button. Suggested: "Attaches a tooltip hook's trigger to the anchor's current element, and moves it when the anchor renders a new element."

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8843b8c

@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 keyboard-only cut-label tooltip, its new close-on-press and the ToggleButton ellipsis behave as the approved Button record states, and the description now matches them. One fix remains:

  • Miss: useUndescribedTrigger is a new hook exported from Text/TruncationTooltip.tsx and imported by Button.tsx, and no current record defines it, so please move it into the Button/ folder (Button is its only caller and it needs only useIsomorphicLayoutEffect) or show its usage, why it is needed and why the existing tooltip hooks are not enough, for an owner API decision.

Non-blocking: the description's first-load table predates the last commit (at this head the form, menu and table pages grow by 489 B, 513 B and 458 B gzip), and the inline notes cover a stale test header and three earlier wording fixes.

Claims and files checked

Review mode: incremental; reason: none

  • Changeset: a cut Button label shows in full when keyboard focus reaches it — verified (unit test; Chromium Tab).
  • Changeset: a cut ToggleButton label now shows an ellipsis — verified (ToggleButton.tsx unchanged since the last Chromium check).
  • Changeset: labels that fit look the same and show no tooltip — verified (test; ToggleButton stories pixel-identical to the base).
  • Changeset: screen readers hear the name once — verified at the attribute level (no aria-describedby).
  • Description: before this change nothing showed the rest of a cut label — verified (base frame).
  • Description: keyboard focus on a cut label shows the full label, and only then — verified (tests; Chromium).
  • Description: this is a new Button requirement — verified.
  • Description: ToggleButton's wrapper shrinks, its line ends in an ellipsis, and the clip margin keeps glyph edges — verified (code; fitting labels pixel-identical).
  • Description: this pull request ships the keyboard part of the linked owner decision, hover stays as on main, and the record names the decision — true; the record's decider line states the keyboard-only behavior this head ships.
  • Description: only :focus-visible focus measures; a press, blur or Escape closes the tooltip; a hover, a mouse-press focus and a tap show nothing — verified (code; tests; Chromium for hover, click, press and Escape).
  • Description: nothing is measured at rest, and each focus measures again — verified (tests).
  • Description: the tooltip uses Button's own tooltip hook, nothing loads later, and the boundary check holds — verified (check passes).
  • Description: a small shared hook in the truncation module attaches the tooltip and re-attaches on a new element — true; that placement is the blocking finding.
  • Description: the tooltip text is the Button's name — true for label; with a children override it shows the visible children (non-blocking).
  • Description: icon-only Buttons and caller tooltips are not measured, and a wrapping Tooltip shows alone — verified (tests).
  • Description: a hidden copy inside the label does not count as cut — verified (test).
  • Description: Button's swizzle copy grows from 24 to 30 files and every import resolves — verified (swizzle run; swizzle test).
  • Description: the real-browser results — verified in Chromium for Tab, hover, click, press and Escape; the ToggleButton focus and wrapping-Tooltip cases were not re-captured at this head.
  • Description: nothing changes at rest — verified for the ToggleButton stories captured.
  • Description: the new test file covers the listed cases — verified (14 of 14 pass).
  • Description: the Button, Text, Tooltip, Popover, ToggleButton, ButtonGroup, IconButton, DropdownMenu and Link suites, the boundary check and the swizzle tests pass — verified.
  • Description: first-load deltas on the four reference pages — reported; at this head 489 B, 513 B and 458 B gzip where the table says 474 B, 511 B and 444 B (non-blocking).
  • Description: the build replay shows no change — not checked.
  • Description: no new prop, and public text has no internal context — verified.
  • Description: writing rubric results — verified.
  • File .changeset/button-label-tooltip.md: clear.
  • File docs/specs/components/Button/Button.spec.md: approved at this head; FR18's wording with children (non-blocking).
  • File packages/core/src/Button/Button.doc.mjs: the dense width line omits "on keyboard focus" (non-blocking).
  • File packages/core/src/Button/Button.truncationTooltip.test.tsx: the header still says "on hover" (non-blocking).
  • File packages/core/src/Button/Button.tsx: imports the new shared hook (blocking finding).
  • File packages/core/src/Text/TruncationTooltip.tsx: exports the new hook (blocking finding); its comment describes Button rather than the hook (non-blocking).
  • File packages/core/src/ToggleButton/ToggleButton.tsx: clear.

Automated review (maintainer link)

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

Copy link
Copy Markdown
Contributor Author

/approve-spec c900a6d

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

Approved. Keyboard focus on a Button whose label is cut short now shows the full label, a cut ToggleButton label gets its ellipsis, and mouse, pen and touch behave as before. The new internal hook is now named in the approved Text record, which clears the last review's blocker, and CI is green at this head.

Optional cleanups remain: two comments name a table header caller that does not exist, the loader Effect is written twice in the truncation module, and FR18 could also say that a press closes the tooltip.

Claims and files checked

Review mode: full; reason: spec-record

Claims (from the description and the changeset):

  • A cut label used to show nothing more, and now shows in full on keyboard focus, and only then: verified (base and head browser captures; Button.truncationTooltip.test.tsx).
  • This is a new requirement, Button FR18: verified (Button.spec.md:151).
  • A cut ToggleButton label now ends in an ellipsis, and the clip margin keeps glyph edges on labels that fit: verified (ToggleButton.tsx:76-96; head capture shows "…"; the fitting With Label story is pixel-identical).
  • The linked owner decision covers more than this ships; only the keyboard-focus part ships, and desktop hover stays as on main: verified (no pointer-enter path; hover capture shows nothing; the record's decider line says the same).
  • One internal hook owns the behavior, is not exported, and a test locks that: verified (Text/TruncationTooltip.tsx:287; cutTextOnKeyboardFocus.exports.test.ts passes).
  • It measures only on :focus-visible focus after keyboard input, then holds the label until focus leaves, Escape or a press: verified (TruncationTooltip.tsx:326-354; captures for Escape and a press).
  • Hover, a pointer-focused field and a touch tap show nothing: verified from the code path and the hover and click captures.
  • The Text record names the hook: verified (Text.spec.md:90-93).
  • Nothing is read at rest and no observers are held, and each focus measures again: verified (tests "measures nothing at rest" and "shows again when a label that came to fit is cut again").
  • The tooltip is a small component in the Tooltip module, loaded after the first render and not exported by the Tooltip entry: verified (Tooltip.tsx:384; Tooltip/index.ts; API comparison has 0 rows).
  • It adds no description, so the name is heard once: verified (no aria-describedby; the accessibility tree gives the focused Button no description).
  • It re-attaches when Button renders a new element: verified (per-render attach in Tooltip.tsx; the link-to-disabled test).
  • Icon-only Buttons and Buttons with a tooltip are not measured, and a wrapping Tooltip shows alone: verified (Button.tsx:938-948; tests; capture shows only the caller's tooltip).
  • A hidden copy or a visually hidden label does not count as cut text: verified (TruncationTooltip.tsx:224-239; hidden-copy test).
  • The swizzled Button copy brings the truncation module and its imports, and every import resolves: verified (the copy grows from 24 to 42 source files; the swizzle test passes).
  • Browser results (hover, click, Tab, Escape, caller Tooltip, ToggleButton): verified by this review's own captures.
  • At rest nothing changes in Chromium: verified for the fitting ToggleButton and Button stories and CI's visual report (8 of 8 shots unchanged).
  • The listed component suites, the import-boundary check and the swizzle tests pass: verified (1,468 tests across those suites; boundary check holds).
  • First-load sizes on the four reference pages: verified (minified deltas identical; gzip within 5 bytes).
  • The build command's results do not change: verified for eight sample queries (identical output on base and head).
  • No new prop, and no internal context in public text: verified (0 API rows; no match).
  • Changeset: a cut Button label shows in full on keyboard focus, a cut ToggleButton label shows an ellipsis, fitting labels look the same, and the name is heard once: verified as above.

Files:

  • .changeset/button-label-tooltip.md: clear.
  • docs/specs/components/Button/Button.spec.md: clear (FR18 wording notes are optional).
  • docs/specs/components/Text/Text.spec.md: clear.
  • packages/core/src/Button/Button.doc.mjs: clear (dense wording note is optional).
  • packages/core/src/Button/Button.truncationTooltip.test.tsx: clear.
  • packages/core/src/Button/Button.tsx: clear.
  • packages/core/src/Text/TruncationTooltip.tsx: clear (comment and duplicate-loader notes are optional).
  • packages/core/src/Text/cutTextOnKeyboardFocus.exports.test.ts: clear.
  • packages/core/src/ToggleButton/ToggleButton.tsx: clear.
  • packages/core/src/Tooltip/Tooltip.tsx: clear (comment note is optional).

Automated review (maintainer link)

Comment on lines +279 to +280
* Shows a component's cut text in an undescribed tooltip on keyboard focus:
* a Button's cut label, a table header cell's cut heading. When keyboard focus

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.

Non-blocking (INV29): no table header cell calls this hook, so the comment names a caller that does not exist. The file header's @output and @position (lines 8-14) also do not list this export or Button. Suggested: "Shows an anchor's cut text in a tooltip on keyboard focus. The tooltip adds no description, because its text is the anchor's name."

Comment on lines +306 to +324
// Syncs with the module loader: the tooltip loads after the first render,
// so keyboard focus shows it at once.
useEffect(() => {
if (!isEnabled || Tooltip != null) {
return;
}
let isCurrent = true;
tooltipModule.load().then(
loaded => {
if (isCurrent) {
setTooltip(() => loaded.UndescribedTooltip);
}
},
() => {},
);
return () => {
isCurrent = false;
};
}, [isEnabled, Tooltip]);

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.

Non-blocking: this repeats the loader Effect of useTruncationTooltipInterest (lines 77-95), changing only the export it picks. One small helper in this module, for example useTooltipModuleExport(isEnabled, pick), would keep the two loads in step.

Comment on lines +377 to +378
* A tooltip whose content is its anchor's own name (a cut Button label or
* table heading), so it adds no description. It is open while it is mounted;

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.

Non-blocking: no table heading uses this, and no record names UndescribedTooltip (the Text line says only "an undescribed tooltip"). Suggested: "A tooltip whose content is its anchor's own name, so it adds no description." A line in the Tooltip or Text record that names the export would also help. The header @output (line 7) does not list it either.

This branch was successfully deployed

1 active deployment
Preview — c900a6d3 Deployed Nov 17, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant