Repository navigation
fix(core): Tooltip paints the theme's inverted surface, as Toast does - #11788
Conversation
Tooltip painted its surface with the primary text color while Toast paints the inverted surface token. architecture:theme-tokens INV10 names inverted as a surface role, and component:Toast FR13 reads --color-background-inverted as the theme's inverted surface; Tooltip now reads it too, keeping the page surface color as its text, so a theme that sets its inverted surface styles tooltips and toasts alike. The Tooltip record's surface row names the tokens.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec cdb2a0d |
There was a problem hiding this comment.
Changes requested for one release-note fix. The Tooltip change itself matches the Tooltip record an engineering owner approved for this head, and every shipped theme keeps tooltip text above 9.7:1.
.changeset/tooltip-inverted-surface.mdchanges how tooltips look but does not say how to keep the old look, which the release rules require for a visual-only change when a theme can restore it; add, for example, "To keep the previous look, a theme can set thetooltiptarget'sbackgroundColortovar(--color-text-primary)."
Non-blocking: the new comment above the container style restates the two declarations below it, so keeping only the Toast coupling is enough (see the inline note).
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: Tooltip painted its surface with a text color while Toast paints the inverted surface. Verified: the base tooltip style reads the primary text token; Toast reads the inverted surface token.
- Claim: the color-token grammar names inverted as a surface role, and Toast's record reads that token. Verified in both records.
- Claim: changing a theme's text color repainted tooltips. Verified on the base.
- Claim: Tooltip now paints the inverted surface and keeps the page surface color as its text. Verified in
useTooltip.tsx. - Claim: the Tooltip record's surface row names both tokens. Verified in
Tooltip.spec.md. - Claim: Neutral light goes from 21.00 to 18.78 and Butter dark from 13.83 to 14.93, the other shipped themes are unchanged, and every case stays at or above 9.7:1. Verified with a browser probe of the open tooltip (lowest 9.77:1); Core's own dark tokens also change, 12.64 to 16.44.
- Claim: a terminal-like theme goes from 13.88 to 16.65. Not checked: that theme is not in the repository.
- Claim: Tooltip, InfoTip and theme tests pass, 1,961 of 1,961. Verified: 36 files, 1,961 tests.
- Claim: the knowledge check is aligned and the changesets are valid. Verified.
- Changeset: a patch fix that paints the inverted surface instead of the primary text color, so a theme's inverted surface styles tooltips and toasts alike, with the text left on the page surface color. Verified, but it omits how to keep the old look (finding above).
- File
.changeset/tooltip-inverted-surface.md: finding, the release note omits the escape. - File
docs/specs/components/Tooltip/Tooltip.spec.md: clear. - File
packages/core/src/Tooltip/useTooltip.tsx: clear, with one non-blocking comment suggestion.
…comment keeps only the Toast coupling
|
/approve-spec 931008a |
There was a problem hiding this comment.
Approved pending a CI rerun. The release note now says how to keep the old tooltip look, which resolves the one change requested earlier, and the Tooltip change matches the Tooltip record an engineering owner approved for this head.
test-node (4/5)stopped when its shard reached the job's time limit, with no failing test; it needs a rerun before merge, and the rest of the CI workflow passed.
Claims and files checked
Review mode: incremental; reason: none
- Changeset: a patch fix in which Tooltip paints the theme's inverted surface, the one Toast paints, instead of the primary text color. Verified in
useTooltip.tsx:65andToast.tsx:112. - Changeset: a theme that sets its inverted surface styles tooltips and toasts alike. Verified for the surface: both read the same token.
- Changeset: the tooltip text stays the page surface color. Verified in
useTooltip.tsx:66. - Changeset: a theme keeps the previous look by setting the
tooltiptarget'sbackgroundColortovar(--color-text-primary). Verified with a test theme: the Neutral light tooltip matches the base frame exactly, and Core dark gets the base colors back. - Claim: Tooltip painted its surface with a text color while Toast paints the inverted surface. Verified on the base.
- Claim: the color-token grammar names inverted as a surface role, and Toast's record reads that token. Verified in both records.
- Claim: changing a theme's text color repainted tooltips. Verified on the base, where the fill read the text token.
- Claim: a terminal-like theme goes from 13.88 to 16.65. Not checked: that theme is not in the repository.
- Claim: Neutral light goes from 21.00 to 18.78 and Butter dark from 13.83 to 14.93, with their other modes unchanged. Verified with a browser probe of the open tooltip.
- Claim: Chocolate, Gothic, Matcha, Stone and Y2K are identical because their inverted surface equals their primary text color. Verified: identical frames, equal tokens.
- Claim: every case stays at or above 9.7:1. Verified: lowest 9.77:1; Core's own dark tokens also change, 12.64 to 16.44.
- Claim: the Tooltip record's surface row names both tokens, in present tense with no narration. Verified in
Tooltip.spec.md. - Claim: Tooltip, InfoTip and theme tests pass, 1,961 of 1,961. Verified: 36 files, 1,961 tests.
- Claim: the knowledge check is aligned and the changesets are valid. Verified.
- File
.changeset/tooltip-inverted-surface.md: clear. - File
docs/specs/components/Tooltip/Tooltip.spec.md: clear. - File
packages/core/src/Tooltip/useTooltip.tsx: clear.
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Table | 138.5 kB (+1 B) · 19.4 kB CSS (+20 B) | — | — · — · — |
| ContextMenu | 120.3 kB (+2 B) · 18.4 kB CSS (+15 B) | — | — · — · — |
| Markdown | 201.9 kB (−2 B) · 21.7 kB CSS (+18 B) | — | — · — · — |
109 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| MoreMenu | 107.1 kB (+1 B) · 18.6 kB CSS (+15 B) | — | — · — · — |
| TableCell | 121.6 kB (+2 B) · 18.9 kB CSS (+14 B) | — | — · — · — |
| TableHeaderCell | 121.3 kB (0) · 18.7 kB CSS (+15 B) | — | — · — · — |
| CheckboxListItem | 79.6 kB (+1 B) · 11.9 kB CSS (+13 B) | — | — · — · — |
| PowerSearch | 306.1 kB (+2 B) · 25.5 kB CSS (+12 B) | — | — · — · — |
| ProgressBar | 11.9 kB (0) · 6.4 kB CSS (+14 B) | — | — · — · — |
| ListItem | 78.8 kB (0) · 11.9 kB CSS (+13 B) | — | — · — · — |
| DropdownMenu | 106.8 kB (−4 B) · 18.6 kB CSS (+15 B) | — | — · — · — |
| DateInput | 199.8 kB (−1 B) · 17.9 kB CSS (+11 B) | — | — · — · — |
| AvatarGroupOverflow | 51.8 kB (+2 B) · 5.7 kB CSS (+5 B) | — | — · — · — |
| DateTimeInput | 223.3 kB (−1 B) · 19.7 kB CSS (+7 B) | — | — · — · — |
| Slider | 114.3 kB (0) · 8.9 kB CSS (+6 B) | — | — · — · — |
| TableSelectionToolbar | 75.1 kB (+1 B) · 14.0 kB CSS (+5 B) | — | — · — · — |
| AlertDialog | 128.5 kB (+1 B) · 15.4 kB CSS (+4 B) | — | — · — · — |
| CheckboxList | 73.0 kB (0) · 7.8 kB CSS (+5 B) | — | — · — · — |
| Spinner | 27.2 kB (0) · 6.3 kB CSS (+5 B) | — | — · — · — |
| TextArea | 66.7 kB (+3 B) · 9.4 kB CSS (+2 B) | — | — · — · — |
| Avatar | 45.8 kB (−1 B) · 5.7 kB CSS (+5 B) | — | — · — · — |
| AvatarGroup | 48.6 kB (−1 B) · 5.8 kB CSS (+5 B) | — | — · — · — |
| ChatLayout | 88.2 kB (+2 B) · 11.3 kB CSS (+2 B) | — | — · — · — |
| Field | 59.3 kB (+1 B) · 7.3 kB CSS (+3 B) | — | — · — · — |
| FieldLabel | 55.2 kB (+1 B) · 5.8 kB CSS (+3 B) | — | — · — · — |
| Popover | 98.4 kB (+1 B) · 15.1 kB CSS (+3 B) | — | — · — · — |
| RadioList | 60.7 kB (0) · 7.3 kB CSS (+4 B) | — | — · — · — |
| TimeInput | 174.6 kB (−2 B) · 16.9 kB CSS (+6 B) | — | — · — · — |
| TopNav | 77.9 kB (+1 B) · 11.7 kB CSS (+3 B) | — | — · — · — |
| lab/DialogHeroHeader | 88.4 kB (+4 B) · 372 B CSS (0) | — | — · — · — |
| Calendar | 76.0 kB (+2 B) · 11.4 kB CSS (+1 B) | — | — · — · — |
| Heading | 14.8 kB (0) · 5.5 kB CSS (+3 B) | — | — · — · — |
| InfoTip | 50.2 kB (0) · 5.4 kB CSS (+3 B) | — | — · — · — |
| InputGroup | 60.9 kB (−1 B) · 7.9 kB CSS (+4 B) | — | — · — · — |
| SegmentedControl | 102.0 kB (−1 B) · 6.9 kB CSS (+4 B) | — | — · — · — |
| Text | 14.2 kB (0) · 5.5 kB CSS (+3 B) | — | — · — · — |
| TextInput | 72.6 kB (+1 B) · 12.0 kB CSS (+2 B) | — | — · — · — |
| Tokenizer | 103.5 kB (0) · 20.1 kB CSS (+3 B) | — | — · — · — |
| TopNavHeading | 82.0 kB (0) · 12.0 kB CSS (+3 B) | — | — · — · — |
| TopNavMegaMenu | 75.9 kB (0) · 12.6 kB CSS (+3 B) | — | — · — · — |
| lab/Comments | 369.5 kB (+3 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 362.2 kB (+3 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/TourStep | 93.0 kB (+3 B) · 691 B CSS (0) | — | — · — · — |
| AppShell | 97.4 kB (0) · 14.3 kB CSS (+2 B) | — | — · — · — |
| Banner | 66.9 kB (+1 B) · 11.3 kB CSS (+1 B) | — | — · — · — |
| BaseTypeahead | 78.2 kB (+1 B) · 11.7 kB CSS (+1 B) | — | — · — · — |
| Carousel | 74.5 kB (+2 B) · 11.7 kB CSS (0) | — | — · — · — |
| ChatComposer | 84.4 kB (−1 B) · 12.9 kB CSS (+3 B) | — | — · — · — |
| ChatLayoutScrollButton | 65.4 kB (0) · 11.0 kB CSS (+2 B) | — | — · — · — |
| ChatToolCalls | 34.9 kB (+1 B) · 8.4 kB CSS (+1 B) | — | — · — · — |
| CodeBlock | 79.9 kB (0) · 12.1 kB CSS (+2 B) | — | — · — · — |
| CommandPaletteInput | 34.3 kB (0) · 7.6 kB CSS (+2 B) | — | — · — · — |
| ComplexSelector | 77.4 kB (+1 B) · 12.6 kB CSS (+1 B) | — | — · — · — |
| DateRangeInput | 99.2 kB (0) · 13.3 kB CSS (+2 B) | — | — · — · — |
| FileInput | 74.0 kB (+1 B) · 11.7 kB CSS (+1 B) | — | — · — · — |
| IconButton | 64.9 kB (+3 B) · 10.8 kB CSS (−1 B) | — | — · — · — |
| Link | 56.2 kB (0) · 7.1 kB CSS (+2 B) | — | — · — · — |
| MobileNav | 76.1 kB (+1 B) · 11.4 kB CSS (+1 B) | — | — · — · — |
| MobileNavToggle | 65.2 kB (+3 B) · 10.8 kB CSS (−1 B) | — | — · — · — |
| NumberInput | 77.4 kB (0) · 12.2 kB CSS (+2 B) | — | — · — · — |
| Selector | 112.6 kB (0) · 18.5 kB CSS (+2 B) | — | — · — · — |
| SideNav | 121.1 kB (0) · 12.2 kB CSS (+2 B) | — | — · — · — |
| SideNavItem | 76.8 kB (0) · 11.9 kB CSS (+2 B) | — | — · — · — |
| TopNavMenu | 81.4 kB (0) · 12.0 kB CSS (+2 B) | — | — · — · — |
| Typeahead | 87.5 kB (−1 B) · 13.3 kB CSS (+3 B) | — | — · — · — |
| lab/CommentComposer | 162.5 kB (+2 B) · 1.9 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 92.8 kB (+2 B) · 2.1 kB CSS (0) | — | — · — · — |
| lab/ListInput | 93.4 kB (+2 B) · 922 B CSS (0) | — | — · — · — |
| BreadcrumbItem | 96.3 kB (+1 B) · 13.1 kB CSS (0) | — | — · — · — |
| Button | 64.9 kB (+2 B) · 10.8 kB CSS (−1 B) | — | — · — · — |
| ChatComposerInput | 82.0 kB (−1 B) · 12.1 kB CSS (+2 B) | — | — · — · — |
| ChatComposerTokenElement | 82.0 kB (−1 B) · 12.1 kB CSS (+2 B) | — | — · — · — |
| ChatDictationButton | 65.4 kB (+1 B) · 10.8 kB CSS (0) | — | — · — · — |
| ChatMessageList | 30.6 kB (−1 B) · 7.1 kB CSS (+2 B) | — | — · — · — |
| ChatSendButton | 65.3 kB (+2 B) · 10.8 kB CSS (−1 B) | — | — · — · — |
| DialogHeader | 67.7 kB (+1 B) · 12.3 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 79.1 kB (+1 B) · 10.3 kB CSS (0) | — | — · — · — |
| Lightbox | 145.8 kB (−1 B) · 11.9 kB CSS (+2 B) | — | — · — · — |
| MultiSelector | 101.3 kB (−1 B) · 17.7 kB CSS (+2 B) | — | — · — · — |
| RadioListItem | 75.8 kB (+1 B) · 10.5 kB CSS (0) | — | — · — · — |
| SideNavCollapseButton | 65.7 kB (0) · 10.8 kB CSS (+1 B) | — | — · — · — |
| SideNavHeading | 82.3 kB (−1 B) · 12.1 kB CSS (+2 B) | — | — · — · — |
| Stepper | 66.6 kB (0) · 10.9 kB CSS (+1 B) | — | — · — · — |
| Switch | 108.8 kB (0) · 10.0 kB CSS (+1 B) | — | — · — · — |
| Timer | 16.4 kB (0) · 6.1 kB CSS (+1 B) | — | — · — · — |
| Timestamp | 35.8 kB (0) · 11.0 kB CSS (+1 B) | — | — · — · — |
| lab/ChatEmojiPicker | 113.3 kB (+1 B) · 773 B CSS (0) | — | — · — · — |
| lab/CommentPin | 60.2 kB (+1 B) · 1.2 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 92.3 kB (+1 B) · 751 B CSS (0) | — | — · — · — |
| lab/LineClamp | 16.4 kB (+1 B) · 168 B CSS (0) | — | — · — · — |
| lab/SelectableCardGroup | 68.6 kB (+1 B) · 162 B CSS (0) | — | — · — · — |
| lab/TransferList | 111.8 kB (+1 B) · 1.2 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditor | 305.3 kB (+1 B) · 2.6 kB CSS (0) | — | — · — · — |
| CheckboxInput | 68.8 kB (0) · 10.1 kB CSS (0) | — | — · — · — |
| Pagination | 123.6 kB (0) · 18.9 kB CSS (0) | — | — · — · — |
| TabMenu | 78.7 kB (0) · 11.9 kB CSS (0) | — | — · — · — |
| lab/Schedule | 114.5 kB (0) · 3.9 kB CSS (0) | — | — · — · — |
| lab/TabBarMoreList | 101.6 kB (0) · 1.8 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 120.6 kB (0) · 1.4 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 299.3 kB (0) · 454 B CSS (0) | — | — · — · — |
| richtext/RichTextView | 281.9 kB (0) · 2.3 kB CSS (0) | — | — · — · — |
| charts/ChartLegend | 56.6 kB (−1 B) · 224 B CSS (0) | — | — · — · — |
| charts/ChartTooltip | 214.6 kB (−1 B) · 451 B CSS (0) | — | — · — · — |
| CommandPalette | 79.1 kB (0) · 12.7 kB CSS (−1 B) | — | — · — · — |
| Thumbnail | 69.2 kB (−1 B) · 12.3 kB CSS (0) | — | — · — · — |
| ToggleButton | 91.9 kB (0) · 10.9 kB CSS (−1 B) | — | — · — · — |
| lab/ChatReactionBar | 114.5 kB (−1 B) · 1.1 kB CSS (0) | — | — · — · — |
| charts/Chart | 237.4 kB (−2 B) · 516 B CSS (0) | — | — · — · — |
| StatusDot | 33.7 kB (−1 B) · 5.4 kB CSS (−1 B) | — | — · — · — |
| Tooltip · Storybook | 32.0 kB (−1 B) · 4.5 kB CSS (−2 B) | 878 (0) | ✓ · ✓ · ✓ |
| DrawerHeader | 67.9 kB (−1 B) · 13.7 kB CSS (−3 B) | — | — · — · — |
| Toast | 103.5 kB (+1 B) · 11.1 kB CSS (−14 B) | — | — · — · — |
Package size: @astryxdesign/core 7.59 MB packed (+1 B); no new dependencies.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Current run: CI concluded failure; parts of this report may be missing.
Generated by PR Enrichment workflow | View full report
Summary
Tooltip painted its surface with
--color-text-primary, a text token, while Toast paints the theme's inverted surface,--color-background-inverted(architecture:theme-tokensINV10 namesinvertedas a surface role;component:ToastFR13 reads it). So a theme that sets its inverted surface (a terminal look, butter's dark mode) got a tooltip in one color and a toast in another, and a theme change to its text color repainted tooltips. Found by a blind coherence test: in a terminal theme, the tooltip went neon green while the toast stayed white on black.Tooltip's container now reads
--color-background-inverted; its text stays--color-background-surface. The Tooltip spec's surface row names both tokens.Evidence
Chromium, a real open Tooltip, bg/fg contrast before → after:
Every case stays at or above 9.7:1.
Tests
Core Tooltip, InfoTip and theme tests 1,961/1,961; check:knowledge aligned; changesets valid.
Writing rubric results
One record edit:
component:Tooltip's surface row names the inverted surface and its text token.@josephfarina