Repository navigation
feat(theme): add surface-specific status color roles - #7657
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
756b815 to
de32514
Compare
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsBadge (@astryxdesign/core) · View in Storybook
Banner (@astryxdesign/core) · View in Storybook
Button (@astryxdesign/core) · View in Storybook
FieldStatus (@astryxdesign/core) · View in Storybook
FileInput (@astryxdesign/core) · View in Storybook
Icon (@astryxdesign/core) · View in Storybook
Item (@astryxdesign/core) · View in Storybook
ProgressBar (@astryxdesign/core) · View in Storybook
StatusDot (@astryxdesign/core) · View in Storybook
TextArea (@astryxdesign/core) · View in Storybook
CircularProgress (@astryxdesign/lab) · View in Storybook
LogStream (@astryxdesign/lab) · View in Storybook
SVGIcon (@astryxdesign/lab) · View in Storybook
Stat (@astryxdesign/lab) · View in Storybook
RichTextEditor (@astryxdesign/richtext) · View in Storybook
Component Size
Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.
|
| Component | JavaScript | CSS |
|---|---|---|
| core/LayerProvider | +5.8KB |
+242B |
| core/Markdown | +5.7KB |
+280B |
| core/Overlay | +5.3KB |
+134B |
| core/Toast | +5.7KB |
+227B |
Bundle Size Summary
Gzip figures measure each package's entry file, not the code an import pulls in.
| Package | Entry (ESM) | Entry gzip before | Entry gzip after | Delta |
|---|---|---|---|---|
| @astryxdesign/core | 4.9KB | 1.2KB | 1.2KB | 0B |
| @astryxdesign/lab | 4.6KB | 1.9KB | 1.9KB | 0B |
| @astryxdesign/richtext | 1.4KB | 746B | 746B | 0B |
| Package stylesheet | Gzip before | Gzip after | Delta |
|---|---|---|---|
| @astryxdesign/core | 33.8KB | 34.1KB | +352B |
| @astryxdesign/lab | 11.1KB | 11.1KB | -20B |
| @astryxdesign/richtext | 3.0KB | 3.0KB | -2B |
Accessibility Audit
Status: 7 accessibility violation(s) found — 7 serious.
ChatComposer - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 1/19 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
ChatComposerInput - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 1/18 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
FileInput - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 3/15 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
LogStream - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 2/3 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
ProgressBar - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 2/18 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
Progressbar - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 1/1 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
Stepper - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 1/31 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
Visual Regression
55 of 502 shot(s) changed.
A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.
| component | story | theme | mode | pixels |
|---|---|---|---|---|
| Selector | Indicator Space Bottom Sheet Narrow End RTL | neutral | light | 753,933 |
| Selector | Indicator Space Bottom Sheet Wide Start | neutral | light | 740,072 |
| RichTextEditor | Markdown parity: side by side | probe | dark | 558,840 |
| RichTextEditor | Markdown parity: side by side | probe | light | 540,756 |
| Chat | Full AI Chat | probe | light | 230,823 |
| Chat | Full AI Chat | probe | dark | 229,805 |
| AppShell | With Mobile Nav | probe | light | 217,010 |
| AppShell | With Mobile Nav | probe | dark | 216,960 |
| Collapsible | Dividers | probe | dark | 66,445 |
| Collapsible | Dividers | probe | light | 66,445 |
| AppShell | Playground | neutral | dark | 65,198 |
| AppShell | Playground | neutral | light | 63,788 |
| Chat | Default | neutral | dark | 36,304 |
| Chat | Default | neutral | light | 35,767 |
| Chat | Empty State | probe | light | 23,531 |
| Chat | Empty State | probe | dark | 22,622 |
| ChatAutoScroll | Scroll Behavior Comparison | neutral | dark | 15,378 |
| ChatAutoScroll | Scroll Behavior Comparison | neutral | light | 14,107 |
| Chat | With Attachments | probe | light | 13,406 |
| Chat | With Attachments | probe | dark | 11,232 |
and 35 more.
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report
There was a problem hiding this comment.
This change can't be approved yet because it adds a new invariant (INV10) to the current theme-token architecture record and introduces 11 public status color tokens plus an Icon info color, and a theme-token maintainer first needs to approve or reject that role model on main. Whatever that decision, please fix the following:
- Butter's and Stone's Banner overrides no longer apply, so Butter dark-mode Warning, Success and Error banner text becomes unreadable (about 1.1–2:1) and the Info banner surfaces change in both themes.
scripts/check-badge-contrast.test.mjsnow fails because Neutral no longer defines its badge status blocks, andscripts/generate-neutral-palette-refs.test.mjsstill expects 95 Neutral palette stops instead of 99.- The changeset also needs to name
@astryxdesign/cli, which the required lint check reports. - The approved Neutral filled-accent value and mappings in
packages/themes/neutral/neutral.spec.mdno longer match the theme, so either keep them or have that record updated.
[Automated review]
| isRenderable(endContent) && styles.headerContentWithEndContent, | ||
| )}> | ||
| <div {...stylex.props(styles.title)}>{title}</div> | ||
| <div {...stylex.props(styles.title, styles.statusForeground)}> |
There was a problem hiding this comment.
statusForeground (color: inherit) is applied for every status. An augmented BannerStatus has no statusStyles entry, so its title (and the description on line 646) now inherit the surrounding color instead of the base --color-text-primary and --color-text-secondary that the comment at lines 197-201 promises. Consider applying it only when hasStatusStyle(status) is true.
| '--color-on-warning': ['#ffeec3', '#3b2200'], | ||
|
|
||
| '--color-info': 'var(--color-accent)', | ||
| '--color-info-muted': 'var(--color-accent-muted)', |
There was a problem hiding this comment.
--color-info-muted resolves var(--color-accent-muted) where the theme declares it, so the banner block's 'status:info': {'--color-accent-muted': '#4883fd'} override (lines 389-395) no longer reaches the Banner. That block's --color-text-primary and --color-text-secondary overrides no longer reach the title or description either, because they now inherit --color-on-*-muted. In dark mode this renders Warning text #f7be00 on #ffc502 (1.07:1), Success #99d94b on #91D143 (1.09:1) and Error #ffb4a6 on #fc473b (2.02:1). The banner block needs to set --color-info-muted and --color-on-*-muted instead.
| '--color-on-warning': ['#524622', '#f4e1b7'], // Yellow T30 / T90 | ||
|
|
||
| '--color-info': 'var(--color-accent)', | ||
| '--color-info-muted': 'var(--color-accent-muted)', |
There was a problem hiding this comment.
Stone's banner block sets '--color-accent-muted': 'var(--color-background-blue)' for Info (line 366). Because Banner now paints --color-info-muted, which is resolved here at theme scope, the Info banner renders the grey accent tint instead of its blue surface in both modes. Set --color-info-muted in that block instead.
| @@ -0,0 +1,14 @@ | |||
| --- | |||
| '@astryxdesign/core': patch | |||
There was a problem hiding this comment.
The required lint job fails changeset coverage. The PR changes shipped CLI docs (tokens-color.doc.mjs, tokens.doc.mjs) and the CLI theme templates, so this changeset also needs '@astryxdesign/cli': patch.
| '--astryx-theme-neutral-color-status-fill-error': ['#c9303a', '#ff705d'], | ||
| '--astryx-theme-neutral-color-status-fill-accent': [ | ||
| blue.light[50], | ||
| blue.dark[70], |
There was a problem hiding this comment.
packages/themes/neutral/neutral.spec.md approves this role as ['#0074e2', '#6d9cfe'] (line 61) and calls its name and meaning a public Neutral-family compatibility contract. blue.dark[70] emits #6eaeff, and the role is no longer applied to the mappings the record describes (line 118). Keep the approved value, or update that record on main.
| }, | ||
|
|
||
| badge: { | ||
| 'variant:info': { |
There was a problem hiding this comment.
Removing Neutral's badge status blocks breaks scripts/check-badge-contrast.test.mjs, the Neutral record's verified_by guard. It resolves pairs only from components.badge, so 8 Neutral pairs are now missing and "holds the neutral error badge above AA" fails. The guard passes at the base.
| '--color-warning': [yellow.light[25], yellow.light[85]], | ||
| '--color-success': [green.light[45], green.dark[65]], | ||
| '--color-error': [red.light[50], red.dark[65]], | ||
| '--color-warning': [yellow.light[85], yellow.dark[85]], |
There was a problem hiding this comment.
In light mode this turns Neutral's --color-warning from #4b3900 into the pale fill #f8d36a. Code that still uses it as a foreground, for example the warning color in packages/lab/src/SVGIcon/SVGIcon.tsx:123, drops to about 1.45:1 on white.
| green: { | ||
| light: {25: '#00490b', 30: '#0b5615', 45: '#2f7d33', 65: '#6ab26b', 75: '#90ca90', 80: '#a4d6a3'}, | ||
| dark: {25: '#2b422b', 80: '#aad4a9', 85: '#bce0bb'}, | ||
| dark: {25: '#2b422b', 65: '#74af75', 80: '#aad4a9', 85: '#bce0bb'}, |
There was a problem hiding this comment.
The regenerated refs now hold 99 stops, but scripts/generate-neutral-palette-refs.test.mjs ("projects exactly the 95 stops used by Neutral into both committed copies") still expects 95, so it fails in test-node. Please update the expected count.
de32514 to
5b3c5d4
Compare
Summary: Add public info, on-muted, and status foreground tokens; route strong, pale, and plain semantic surfaces through their matching roles across Core and first-party themes. Test Plan: pnpm check:repo; pnpm lint; pnpm -F @astryxdesign/core build; build all seven first-party themes; 609 focused status tests; 359 field-family tests. Reviewers: Subscribers: Tasks: Tags:
5b3c5d4 to
e7121b5
Compare
There was a problem hiding this comment.
This change can't be approved yet: it adds an invariant (INV10), 11 public status color tokens, Tailwind utilities and an Icon info color that no current spec establishes, and it rewrites the current Neutral theme record (its approved accent value, compatibility rule and open questions), so a theme-token maintainer needs to approve or reject that role model and the Neutral record update on main. Whatever that decision, please address these points:
- Neutral's
progress-barvariant:warningoverride paints the whole ProgressBar container, so the dark-mode label drops to about 1.45:1; drop it or move it toprogress-bar-fill. - Neutral's light info and error status foregrounds measure 4.05:1 and 4.37:1 on Neutral's page background (
#f1f1f1), below 4.5:1 for small text, and the new test only checks white. check-muted-status-contrastmerges Banner overrides before measuring, so it never checks the global pairs ChatComposer renders (Stone dark stays at 1.32:1).- Banner forces
color: inheriton its built-in expand and dismiss Buttons for every status, although the Banner spec says they keep their own Button painting. - The changeset should name the old and new appearance and how custom themes keep the old look.
[Automated review]
| }, | ||
| 'variant:error': { | ||
| '--color-error': statusFill.error, | ||
| backgroundColor: yellow.light[85], |
There was a problem hiding this comment.
progress-bar is the ProgressBar's outer container (label row plus track), not the fill, so this paints the whole warning bar #f8d36a in both modes. In dark mode the white label sits at about 1.45:1, and in light mode the fill disappears into the container. Core's fill already reads Neutral's --color-warning (yellow 85 per mode), so this override can go, or move to progress-bar-fill.
| '--color-status-foreground-info': [blue.light[50], blue.dark[80]], | ||
| '--color-status-foreground-success': [green.light[45], green.light[75]], | ||
| '--color-status-foreground-warning': [yellow.light[45], yellow.light[80]], | ||
| '--color-status-foreground-error': [red.light[50], red.dark[80]], |
There was a problem hiding this comment.
On Neutral's page background (--color-background-body, #f1f1f1) the light-mode info (#0074e2) and error (#cf3738) foregrounds measure 4.05:1 and 4.37:1, below 4.5:1 for small text such as the TextArea over-limit counter, which used red 25 (10.47:1) before. The new test only measures white.
| const override = theme.components?.banner?.[`status:${variant}`] ?? {}; | ||
| const tokens = { | ||
| ...theme.tokens, | ||
| ...Object.fromEntries( | ||
| Object.entries(override).filter(([key]) => key.startsWith('--')), | ||
| ), | ||
| }; | ||
| const effectiveTheme = {...theme, tokens}; |
There was a problem hiding this comment.
Merging the Banner overrides into the global tokens means FieldStatus and ChatComposer pairs are never measured for themes with Banner overrides. With the global tokens, Stone dark ChatComposer error and warning measure 1.32:1 and Butter dark error 4.46:1, yet this guard passes. Measure the global pairs as their own rows.
| /> | ||
| } | ||
| onClick={handleToggleExpand} | ||
| xstyle={styles.statusForeground} |
There was a problem hiding this comment.
This color: inherit (here and on the dismiss button below) applies for every status, unlike the title and description, which use it only when hasStatusStyle(status) is true. For an augmented status the controls then inherit the surrounding color instead of the ghost Button's own color. On built-in statuses the Status surface already redefines --color-text-primary, so the xstyle may not be needed at all.
There was a problem hiding this comment.
This change can't be approved yet: it adds an invariant (INV10), 11 public status color tokens, Tailwind utilities and an Icon info color that no current spec establishes, and it rewrites the current Neutral theme record (its approved accent value, darker-foreground mapping, compatibility rule and open questions), so a theme-token maintainer needs to approve or reject that role model and the Neutral record update on main. Whatever they decide, please address these points:
test-nodefails on the merge withmain: thedeclare module './index'block inBanner.test.tsxaddsneutraltoBannerStatusMap, whichcore-prop-docs.test.mjsthen reports as Banner prop drift; a type assertion local to the test avoids it.- The proposed Neutral record drops the on-tint local roles the theme still emits; keep them listed.
- Neutral's on-tint overlays move from
#fafafa/#0a0a0ato pure white and black, which the Neutral record's DEC-4 rules out; restore them or split that change out. - The changeset should name the first-party appearance it ships (for example Butter's Info and Error Banner text and Neutral's light status text), and the comment at
Banner.tsx:298-300and the Stepper "Semantic Colors Reference" story still describe the old token wiring.
[Automated review]
| declare module './index' { | ||
| interface BannerStatusMap { | ||
| neutral: true; | ||
| } | ||
| } |
There was a problem hiding this comment.
This augmentation widens BannerStatus for the whole Core type program, not only this test. On main, packages/cli/test/core-prop-docs.test.mjs then reports Banner.status as drift (documented as 'info' | 'warning' | 'error' | 'success', declared with 'neutral'), which is why test-node fails on the merge. A type assertion local to the test keeps the augmented-status case without the module augmentation.
| '--astryx-theme-neutral-color-on-tint-neutral': [ | ||
| withAlpha(neutral.light[100], '4D'), | ||
| withAlpha(neutral.dark[0], '4D'), | ||
| ], | ||
| '--astryx-theme-neutral-color-on-tint-overlay-hover': [ | ||
| '#fafafa1A', | ||
| '#0a0a0a1A', | ||
| withAlpha(neutral.light[100], '1A'), | ||
| withAlpha(neutral.dark[0], '1A'), | ||
| ], | ||
| '--astryx-theme-neutral-color-on-tint-overlay-pressed': [ | ||
| '#fafafa33', | ||
| '#0a0a0a33', | ||
| withAlpha(neutral.light[100], '33'), | ||
| withAlpha(neutral.dark[0], '33'), | ||
| ], |
There was a problem hiding this comment.
These on-tint overlays change value: #fafafa/#0a0a0a become #ffffff/#000000 at the same alphas. The Neutral record's DEC-4 keeps intentional values without an exact palette match as explicit local values and says backgrounds do not become true black automatically, and the PR description does not mention this change. Restore the explicit values (and the test expectations) or split it into its own Neutral change.
| | Exact name | Neutral-only meaning | Value | | ||
| | -------------------------------------------------- | --------------------- | ------------------------------------- | | ||
| | `--astryx-theme-neutral-color-status-fill-accent` | Filled accent status | `[blue.light[50], blue.dark[70]]` | | ||
| | `--astryx-theme-neutral-color-status-fill-success` | Filled success status | `[green.light[45], green.dark[65]]` | | ||
| | `--astryx-theme-neutral-color-status-fill-warning` | Filled warning status | `[yellow.light[85], yellow.dark[85]]` | | ||
| | `--astryx-theme-neutral-color-status-fill-error` | Filled error status | `[red.light[50], red.dark[65]]` | |
There was a problem hiding this comment.
The table now lists four local roles, but neutralTheme.ts still emits ten, and banner.base still consumes the three on-tint roles the current record lists. Keep those rows so the record's value inventory matches the source; listing the status-muted and destructive overlay roles too would close it.
| // Status title, description, icon, and built-in controls share the header's | ||
| // on-muted color. The same style is passed last to ghost Buttons so their | ||
| // variant color cannot override the semantic content pairing. |
There was a problem hiding this comment.
At this head no Button receives statusForeground; the built-in controls follow the Status surface's --color-text-primary instead. Update the comment so it describes that.
| '@astryxdesign/theme-y2k': patch | ||
| --- | ||
|
|
||
| [feature] Status colors previously reused `--color-accent` and `--color-info/success/warning/error` across strong fills, plain-surface text/icons/borders, and pale surfaces. These jobs now have separate public roles: strong fills use the base semantic colors with `--color-on-*`, pale surfaces use `--color-*-muted` with `--color-on-*-muted`, and plain surfaces use `--color-status-foreground-*`. Custom themes can preserve their previous appearance by assigning the old values to the corresponding new roles; Banner overrides that previously set `--color-accent-muted` or `--color-text-*` should set the matching muted/on-muted roles instead. |
There was a problem hiding this comment.
AST-017 FR3 asks the changeset to name the old and new appearance. Please add the first-party changes it ships, for example Butter's Info and Error Banner text turning from white to #1d1c11, Neutral's light status text, borders and fills moving to new stops, and Core-default Banner titles taking the status color.
There was a problem hiding this comment.
This can't be approved yet: the status roles, theme generation and component changes follow the direction in the 2026-10-25 decisions comment, but the rewritten theme-token, theme-compilation, Badge, StatusDot, Neutral, Matcha and Swift Icon records have no spec-owner approval on this head. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner; a design owner may also approve the Neutral and Matcha theme records. Whatever the decision, please fix these:
- The Changeset says Butter's Info Badges move to the new blue, but Butter's own badge override keeps them unchanged, so drop Butter from that line or remove the override.
- At about 5,500 authored lines, the owner decision should also confirm that this lands as one unit, and the unrelated TreeList story recolour should be dropped or split.
[Automated review]
| - Chocolate and Matcha's `--color-on-success` and `--color-on-error` are now a dark ink instead of white, and Stone's `--color-on-success`, `--color-on-warning` and `--color-on-error` are white in light mode and near-black in dark mode instead of the status hue, so content on those fills reaches 4.5:1. | ||
| - Neutral's `--color-success`, `--color-warning`, and `--color-error` are now its status fills, the colours its Badges already showed: success `#00490B` to `#198100` (dark `#A4D6A3` to `#64AF4C`), warning `#4B3900` to `#FFCE2F` (dark `#F8D36A` to `#FFCE2F`), and error `#76000C` to `#C9303A` (dark `#FFC4BE` to `#FF705D`); `--color-info` is `#0074E2` (dark `#6D9CFE`). Its Badges, StatusDots, progress fills, and Stepper badges look the same. Apps that use `text-success`, `text-warning`, or `text-error` with Neutral get the fill colour; use `text-status-<status>` for readable text. | ||
| - Neutral drops its own status overrides and uses the standard roles: the accent variants of ProgressBar, StatusDot, and Stepper now paint Neutral's accent instead of blue, and Banner and the pale destructive Button use the standard overlays. Neutral no longer defines its proposed and undocumented local tokens; use the standard roles instead: `--astryx-theme-neutral-color-status-fill-success`, `-status-fill-warning`, and `-status-fill-error` → `--color-success`, `--color-warning`, `--color-error`; `-status-muted-accent` → `--color-info-muted`; `-on-tint-neutral` → `--color-neutral`; `-on-tint-overlay-hover`, `-on-tint-overlay-pressed`, `-destructive-overlay-hover`, and `-destructive-overlay-pressed` → `--color-overlay-hover` and `--color-overlay-pressed`. `--astryx-theme-neutral-color-status-fill-accent` keeps its value for Neutral extensions but is deprecated and no longer used by Neutral. | ||
| - Every first-party theme sets a blue `--color-info`; Butter, Chocolate, and Matcha Info Badges move from the accent to that blue. |
There was a problem hiding this comment.
Butter keeps its own badge variant:info override (packages/themes/butter/src/butterTheme.ts:423-426, fill accent.light[55]), so Butter's Info Badge does not change; a Chromium capture of the Butter Badge variants is pixel-identical to the base. Drop Butter from this line, or remove the override if moving Butter to --color-info was intended (spec:AST-017 FR3 asks the Changeset to name the old and new appearance).
| 'tree-list-chevron': { | ||
| base: { | ||
| color: 'var(--color-accent)', | ||
| color: 'var(--color-text-info)', |
There was a problem hiding this comment.
This recolours the themed chevron from --color-accent to --color-text-info, but the accent is untouched by this change, so the story edit is unrelated to the status roles. Please drop it or move it to its own pull request.
…fo Badges that move
There was a problem hiding this comment.
This can't be approved yet: the status roles, theme generation and component changes follow the direction in the 2026-10-25 decisions comment, but the rewritten theme-token, theme-compilation, Badge, StatusDot, Neutral, Matcha and Swift Icon records have no spec-owner approval on this head. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner; a design owner may also approve the Neutral and Matcha theme records, and the decision should confirm that about 5,500 authored lines land as one unit. Whatever the decision, please fix these:
- A status fill set on an
onDarkoronLightmedia surface gets no--color-on-<status>, so its content keeps Core's white (1.54:1 on#7EE787); derive it there or correct the theme-compilation known-gap sentence. - The adaptation test "lets explicit values beat generated values within one rule" now writes
--color-text-blue, which the colour expansion never generates; restore--color-accentso it checks precedence again. - Neutral DEC-4 still says "Token names and meanings remain unchanged" while this head turns Neutral's base status colours into fills; record that change under DEC-6 instead.
[Automated review]
| value: { | ||
| color: {accent: '#00AA00'}, | ||
| tokens: {'--color-accent': '#FF0000'}, | ||
| tokens: {'--color-text-blue': '#FF0000'}, |
There was a problem hiding this comment.
This writes --color-text-blue, which color: {accent} never generates (on this head the rule's colour expansion writes --color-accent, --color-accent-muted, --color-on-accent, --color-text-accent and --color-icon-accent), so the assertion below holds whatever the precedence. Restoring --color-accent here and in the assertion makes the test check explicit-over-generated precedence again; that version still passes on this head.
| Object.fromEntries(rootAliases), | ||
| rootLocalTokens, | ||
| ).values; | ||
| // A media surface sits on content the compiler cannot measure, so a status |
There was a problem hiding this comment.
No --color-on-<status> is derived or aliased on a media surface, so onDark: {tokens: {'--color-success': '#7EE787'}} emits only the fill and its Badge content keeps Core's white (1.54:1). The content role needs only the fill and --color-on-dark/--color-on-light, not the backdrop, so it could be derived here like at the root (13.67:1 with black).
| accepted but not yet shipped. Their verification rows describe implementation | ||
| acceptance, not existing enforcement. | ||
| Inside an `onDark`/`onLight` media surface, which sits on content the compiler | ||
| cannot measure, a status colour the theme sets reaches its roles as an INV16 |
There was a problem hiding this comment.
For a fill set on a media surface this isn't what happens: no INV16 alias reaches --color-on-<status> there, so the content keeps the root's or Core's value. Either derive the content role on media surfaces or say here that a fill set there reaches no content role.
| named palette-stop references when an approved match exists. Token names and | ||
| meanings remain unchanged. Alpha variants derive from the referenced stop | ||
| rather than duplicating its hex value. | ||
| meanings remain unchanged. The status fills keep the explicit values Neutral's |
There was a problem hiding this comment.
"Token names and meanings remain unchanged" no longer holds on this head: Neutral's --color-success, --color-warning and --color-error move from the dark page-text stops to fill colours (#4B3900 to #FFCE2F for light warning). Dropping the sentence and recording the meaning change under DEC-6 keeps the record consistent.
…d adaptation tests A status fill an onDark or onLight surface sets gets its derived --color-on-<status> there, since content on a fill does not depend on the surface beneath it; the known-gap sentence now covers only text and pale-fill content. Pre-existing adaptation, media, and Theme tests keep their original tokens. Neutral DEC-6 records the change to its base status values; DEC-4 no longer claims them.
There was a problem hiding this comment.
This can't be approved yet: the status roles, theme generation and component changes follow the 2026-10-25 decisions comment, but the rewritten theme-token, theme-compilation, Badge, StatusDot, Neutral, Matcha and Swift Icon records have no spec-owner approval on this head. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner; a design owner may also approve the Neutral and Matcha theme records. The decision needs to settle INV10's new wording for the text-status-<status> keys, removing nine released Neutral local tokens without an alias, shipping the base-colour meaning change as a patch, and whether about 5,500 authored lines land as one unit; without that one-unit decision, please move the separable parts (the text-status-* keys, the draft Swift Icon edit, the Lab, sandbox and template migrations) to follow-ups. The media-surface content, the adaptation precedence test and the Neutral DEC-4 wording from the last round are fixed.
[Automated review]
… and border roles bg-<status> stays the strong fill; text-<status> and border-<status> resolve through --text-color-* and --border-color-* to --color-text-<status> and --color-border-<status>, so status text from Tailwind is readable on the page in every theme. text-status-<status> stays as an alias.
There was a problem hiding this comment.
This can't be approved yet: the status roles, theme generation and component changes follow the 2026-10-25 decisions comment, but the rewritten theme-token, theme-compilation, Badge, StatusDot, Neutral, Matcha and Swift Icon records, including the new INV11 paragraph that moves the released Tailwind text-<status> and border-<status> utilities to the text and border roles, have no spec-owner approval on this head. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner; a design owner may also approve the Neutral and Matcha theme records. Whatever the owners decide, please also address these:
- About 5,500 authored lines still need a one-unit decision that names this head, or the separable parts (the Tailwind changes, the draft Swift Icon edit, the Lab, sandbox and template migrations) moved to follow-ups.
text-status-<status>now compiles to the same declaration astext-<status>, so drop its--color-status-*keys or keep them deliberately.ring-,outline-,decoration-andplaceholder-<status>still paint the strong fill (a warning ring is 1.98:1 on white), so project them to the border and text roles too, or say which utilities keep the fill.
[Automated review]
| --color-status-info: var(--color-text-info); | ||
| --color-status-success: var(--color-text-success); | ||
| --color-status-warning: var(--color-text-warning); | ||
| --color-status-error: var(--color-text-error); |
There was a problem hiding this comment.
Since text-<status> now reads --color-text-<status> (lines 101-104), text-status-<status> compiles to the same color: var(--color-text-<status>). These keys also generate bg-status-*, ring-status-* and border-status-*, and border-status-warning paints the text role rather than --color-border-warning. Consider dropping them, with INV10's added wording, unless the owners keep them on purpose.
| --text-color-info: var(--color-text-info); | ||
| --text-color-success: var(--color-text-success); | ||
| --text-color-warning: var(--color-text-warning); | ||
| --text-color-error: var(--color-text-error); | ||
| --border-color-info: var(--color-border-info); | ||
| --border-color-success: var(--color-border-success); | ||
| --border-color-warning: var(--color-border-warning); | ||
| --border-color-error: var(--color-border-error); |
There was a problem hiding this comment.
Only text-, border- (with border-t/x-) and divide-<status> read these keys; ring-, outline-, decoration-, placeholder-, fill-, stroke-, caret-, accent- and shadow-<status> still resolve to --color-<status>, so border-warning ring-warning gives a #753F07 border with a #E9AF08 ring (1.98:1 on white). Tailwind 4.3.2 also reads --ring-color-*, --outline-color-*, --text-decoration-color-* and --placeholder-color-* before --color-*; projecting those, or stating in INV11 which utilities keep the fill, would complete the paint-property rule.
Text-like utilities (text-, decoration-, placeholder-, caret-) read the status text role, line-like utilities (border-, divide-, outline-, ring-) the status border role, and fill-like utilities keep the strong fill.
There was a problem hiding this comment.
This can't be approved yet: the status roles, theme generation, component and Tailwind changes follow the 2026-10-25 decisions comment, but the rewritten theme-token, theme-compilation, Badge, StatusDot, Neutral, Matcha and Swift Icon records, including the widened INV11 paragraph that moves eight released Tailwind status utility families to the text and border roles, have no spec-owner approval on this head. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner; a design owner may also approve the Neutral and Matcha theme records. Whatever the owners decide, please also address these:
- About 5,600 authored lines still need a one-unit decision that names this head, or the separable parts (the Tailwind projection and
text-status-*keys, the draft Swift Icon edit, the Lab, sandbox and template migrations) moved to follow-ups. - The
--color-status-<status>keys also generatebg-status-*,border-status-*andring-status-*utilities that paint the text role; spelling them--text-color-status-<status>keepstext-status-<status>and drops the rest.
[Automated review]
| --color-status-info: var(--color-text-info); | ||
| --color-status-success: var(--color-text-success); | ||
| --color-status-warning: var(--color-text-warning); | ||
| --color-status-error: var(--color-text-error); |
There was a problem hiding this comment.
These --color-status-<status> keys make Tailwind generate every colour utility for them: bg-status-warning compiles to background-color: var(--color-text-warning), and border-status-* and ring-status-* paint the text role instead of --color-border-<status>. Spelling them --text-color-status-<status> keeps text-status-<status> and generates nothing else.
The keys are --text-color-status-<status>, so they generate text-status-* alone and no bg-, border-, or ring-status utilities.
There was a problem hiding this comment.
This can't be approved yet: the status roles, theme generation and component changes follow Cindy's 2026-10-25 decisions, but the rewritten theme-token, theme-compilation, Badge, StatusDot, Neutral, Matcha and Swift Icon records have no spec-owner approval on this head, including the Tailwind change to released text-, border- and related <status> utilities, the nine Neutral local names removed without an alias, and the patch release class. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner; a design owner may also approve the Neutral and Matcha theme records. Whatever the owners decide, please also address these:
- At about 5,600 authored lines, have that decision also record why the change lands as one unit at this head, or move the separable parts (the Tailwind projection and
text-status-*keys, the Neutral and Matcha record changes, the draft Swift Icon edit, the consumer migrations) to follow-ups. AvatarStatusDotnow paints the error minus bar with--color-on-error, but its current spec still says the bar uses the surface colour; amend FR2 and its gap note here, or keep the surface colour.
[Automated review]
| error: { | ||
| backgroundColor: colorVars['--color-error'], | ||
| color: colorVars['--color-background-surface'], | ||
| color: colorVars['--color-on-error'], |
There was a problem hiding this comment.
This paints the error minus bar with --color-on-error, but current component:AvatarStatusDot FR2 says the bar uses "the surface color", and the record is not updated here. In Chocolate light the bar turns from #FFFCF7 to #141010. Could FR2 (and its gap note about base status tokens) be amended in this PR, or the surface colour kept?
There was a problem hiding this comment.
This can't be approved yet: the status roles, theme generation and component changes follow the 2026-10-25 decisions, but the rewritten theme-token, theme-compilation, Badge, StatusDot, AvatarStatusDot, Neutral, Matcha and Swift Icon records have no spec-owner approval on this head, including the Tailwind change to released text-, border- and related <status> utilities, the nine Neutral local names removed without an alias, and the patch release class. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner; a design owner may also approve the Neutral and Matcha theme records. Whatever the owners decide, at about 5,600 authored lines that decision should also record why the change lands as one unit at this head, or the separable parts (the Tailwind projection and text-status-* keys, the Neutral and Matcha record changes, the draft Swift Icon edit, the consumer migrations) should move to follow-ups.
[Automated review]
|
/approve-spec 92b5be3 |
|
Posted by Cindy's agent on her behalf. Outcome: approve at This head implements the decisions in #7657 (comment) and confirms the four points the review asked the owner to settle:
|
User need
People reading status in Astryx need status text and icons they can read on the page, and Badges, StatusDots and Banners whose content stays legible on the fill. Today the same base colour is used as a fill and as text, so light-mode warning text sits near 2:1, Core's dark Info and Error Badge labels are below 4.5:1, and Info borrows the accent, so themes with a grey accent paint Info grey.
Problem and solution fit
This ships surface-specific status roles, refining the roles approved in #8103 and #8116, on top of @rubyycheung's status-colour work:
--color-<status>, whose content--color-on-<status>is guaranteed 4.5:1 or more; a pale fill--color-<status>-mutedwith--color-on-<status>-muted; and--color-text-<status>for text on the page (4.5:1), with--color-icon-<status>and--color-border-<status>defaulting to it.Current specification
architecture:theme-tokensINV10 (name grammar) and INV11 (status roles).architecture:theme-compilationINV16 (scoped aliases) and INV17 (derived roles).component:BannerFR9.Public delta and caller burden
bg-info,bg-info-muted,text-on-<status>,text-on-<status>-mutedandtext-status-<status>.--color-success/warning/errorand their utilities keep their meaning as the strong fill. Core's dark--color-on-errorbecomes dark ink, and Chocolate, Matcha and Stone retune their on-colours, so content on every fill reaches 4.5:1. Neutral's base status values become its Badge fill colours (named in the Changeset); status text on the page should usetext-status-<status>.Records in this PR
The implementation makes these records describe shipped behaviour:
architecture:theme-tokens: INV10's content-on-fill shape and INV11 make--color-<status>the strong fill with guaranteed content, add Info as an independent status, and name the Tailwind projections; INV11's verification row is current.architecture:theme-compilation: INV16 and INV17 derive content and text roles and never fills; derivation inside combined adaptation rules andonDark/onLightsurfaces stays a named gap.component:Banner: FR9 is current behaviour.component:Badge: FR5 names the strong status fills (--color-<status>) and their forced-colours outline.component:StatusDot: FR2's status plates follow INV11; the accent and neutral dots stay an open question (OQ1).theme:neutral: Neutral sets the standard status fills directly and adds no component overrides for them; its one remaining local token is deprecated (DEC-1); the open questions as @rubyycheung ratified them.theme:matcha: the measured exceptions that remain with the shipped values.Writing rubric results
Evidence
scripts/check-status-text-contrast.test.mjs(new, red-armed): every first-party theme and Core, light and dark, meets every INV11 floor (text and icons 4.5:1 on surface and card, content on strong and pale fills 4.5:1, chromatic fills and text); component-scoped icon and border overrides keep 3:1; Core's released fills are pinned; minimal, light-fill, grey-fill, unresolved-fill, unresolved-surface, surface-only, rule-only andextendsthemes derive as INV17 says. Mutating Stone's Info fill to grey or Butter's success rim to its old value fails it.scripts/check-badge-contrast.test.mjsandcheck-muted-status-contrast.test.mjsread the emitted theme CSS.tokens.test.ts: JavaScript resolution matches the derived CSS; INV10 name check covers the new tokens.Why this lands as one PR
The new roles, the components that read them, the theme values that satisfy their floors, and the derivation that fills them for custom themes are one contract: landing the tokens without the components leaves Astryx painting text with fill colours; landing the components without the theme values or derivation drops first-party and custom themes below the INV11 floors. The Neutral and Matcha record updates describe the values this PR ships, and the Tailwind projections were approved for this change. Most of the line count is regenerated output (Swift themes, CLI theme bundle, token docs) and tests.
Row by row:
--color-<status>after this PR, so Neutral sets those to its Badge fill colours here; without its record update the record would describe local tokens Neutral no longer ships.bg-info,text-on-<status>-mutedandtext-status-<status>read tokens that exist only after this PR; the spec owner chose to keep them with it.Scope
Testing
vitest --project nodefor the status, badge, muted, CLI theme bundle, theme template, palette-ref and changeset scripts, and every theme package.vitest --project uiforpackages/core/src(theme, Badge, Banner, StatusDot, Icon, Tailwind bridge, and the full core suite).tscfor core;pnpm check:knowledge; token docs and CLI theme bundle regenerated.Original proposal by @rubyycheung
User impact
Semantic status colors now have clear public pairings based on the surface they appear on:
--color-info/success/warning/errorwith--color-on-*content.--color-*-mutedwith--color-on-*-mutedcontent.--color-status-foreground-*.This keeps filled statuses vibrant, preserves the existing darker Banner and FieldStatus treatment, and gives plain-surface content reliable readable colors.
--color-accentremains reserved for general interaction and brand emphasis rather than informational status.Visual authority
DDrow reused or amended.Design decisionstable by a team design owner.docs/design/.The proposed shared role model, scoped compiler-alias rule, Banner built-in-control foreground rule, Neutral mapping updates, and first-party mappings are recorded on this PR and remain pending exact-head owner approval. Existing records govern the prior state; their current authority does not pre-approve these proposed deltas.
Before and after
Matched real-Chromium captures at 1920px:
The screenshots show the recommended public-token proposal on real Astryx components in light and dark mode.
First-party theme previews
Each full-page preview shows the complete public-token proposal in light and dark mode: color routing, input statuses, Banners, Badges, semantic icons and dots, progress, Stepper states, destructive actions, and inline status content.
Neutral
Butter
Chocolate
Gothic
Matcha
Stone
Y2K
State matrix
--color-accent.#f8d36alight /#efd284dark); warning foreground on white uses yellow 45 (#836700, 5.38:1).Decomposition
The candidate atomic landing unit is:
This candidate is approximately 3,800 authored lines. Exact-head theme-token, compiler, Banner, Neutral, and first-party theme owners must review the complete scope against the contracts they approve; the decomposition below does not authorize the bundle or replace that scope review.
Claim map:
architecture:theme-tokens/INV10owns the new role model and remains pending exact-head theme-token maintainer approval;architecture:theme-compilation/INV15owns generated role locality and cascade semantics; currentarchitecture:theme-application/INV1supplies the nearest-provider requirement. The record addition and exact compiler implementation both remain approval dependencies;spec:AST-002/FR12–FR13require the exact public before → after, canonical owner, and authority result, which this claim map makes explicit;architecture:theme-tokensReleased token compatibility claim plusspec:AST-017/FR3,FR25, andDEC-17keep all released token names working and require the feature changeset to describe the semantic/visual change and supported replacement guidance. Whether redefining the base status tokens as fill roles is patch-compatible remains an exact-head maintainer decision;component:Banner/FR9owns applying the status surface's on-muted foreground to Banner-authored title, description, icon, collapse, and dismiss content while preserving Button-owned interaction layers, tooltip color, and consumerendContent; it remains pending exact-head Banner-owner approval;Separable work stays out: the Candlestick data-visualization correction remains on its independent local branch. The separable Neutral dark filled-accent and on-tint endpoint retunes were removed from this PR; the released
#0074e2/#6d9cfeaccent pair and near-endpoint Banner on-tint literals remain unchanged. Neutral owner review is still required for the new role mappings and record changes.Scope
Testing
pnpm check:repopnpm -F @astryxdesign/core typecheckpnpm exec eslint packages/core/src/theme/generateThemeRules.ts packages/cli/api/theme/build/build.mjs --max-warnings=0pnpm exec vitest run packages/cli/clients/cli/commands/build-theme.adaptations.test.mjs …plus compiler, contrast, Butter, Matcha, and Y2K suites (394 tests)pnpm -F @astryxdesign/core buildWriting rubric results
R1 narration: The architecture additions, Banner contract, and theme records describe the proposed resulting system in present tense; approval dependencies stay in this PR description.
R2 research: Naming trials, comparisons, and rendered evidence remain outside the standing records.
R3 evidence: Verification names concrete component tests, theme builds, palette checks, and contrast guards rather than pull requests.
R4 rejected alternatives: none added.
R5 change references: none added to standing content.
R6 open questions: the existing cross-theme contrast-methodology question remains unchanged.