Skip to content

spec(theme): surface-specific status color roles - #8116

Merged
cixzhang merged 14 commits into
mainfrom
spec/status-color-roles
Oct 24, 2026
Merged

cixzhang merged 14 commits into
mainfrom
spec/status-color-roles

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

People reading status in Astryx (Badges, Banners, field validation, status icons) get colours chosen for the surface they sit on: readable status text and icons on the page, a strong fill with matching content, and a pale fill with matching content. Apps that already use --color-success, --color-warning, --color-error, or text-success/bg-success/border-success see no change.

Builds on the colour token grammar (theme-tokens INV10, merged in #8103). It records the status-role contract from #7657 by @rubyycheung, with one adjustment: released tokens keep their meaning.

Exact decision needed

Which tokens Astryx components use for status colour on each surface, and what happens to the released base status tokens.

Existing authority searched

  • architecture:theme-tokens (INV1–INV9, plus INV10 grammar from spec(theme-tokens): name colour tokens by one grammar #8103), architecture:theme-compilation INV1–INV15, component:Banner FR1–FR8, theme:neutral, theme:matcha.
  • Every consumer of --color-success/warning/error on main uses the base for fills (Badge, StatusDot, ProgressBar, Stepper, Button destructive), text and icons (Icon, Stepper glyphs, Chat, DropdownMenu destructive, TextArea counter), and borders (input status borders, FileInput). So base-as-fill would change the meaning of the text, icon, and border uses.
  • The v0.0.8 rename codemod retired --color-info (mapping it to --color-icon-purple), so this record adds no bare --color-info.

Decision

architecture:theme-tokens INV11: each status (info, success, warning, error) has three surface roles:

Surface Fill Content
Default page or card (none) --color-text-<status> for text, 4.5:1 or more; --color-icon-<status> and --color-border-<status> (default: the text colour), 3:1 or more
Strong fill --color-<status>-emphasized --color-on-<status>, 4.5:1 or more
Pale fill --color-<status>-muted --color-on-<status>-muted, 4.5:1 or more on the default surface
  • --color-success, --color-warning, --color-error and their Tailwind utilities keep their values and meaning in every theme. Astryx components use the surface roles instead.
  • Every status fill and text colour is chromatic, and the contrast floors hold, for Core, first-party themes, and derived values; a third-party theme's own values are its own.
  • Core's own defaults meet the floors in light and dark: Core's dark strong Info and Error fills are deeper than its accent and base error colours.
  • In forced-colors mode, status renders in system colours, each status keeps a non-colour cue, and status fills keep a visible border.
  • The generated token docs describe each status role in one line.
  • architecture:theme-compilation INV16: derived roles are emitted inside the scope where their source applies.
  • architecture:theme-compilation INV17: the web compiler derives every status role a theme does not set, at runtime and in the theme build, and non-CSS resolution applies the same derivation. A role inherited through extends counts as set. Icon and border alias text; text is the status hue at 4.5:1 on the page and card; strong fills meet their content floor; the new pale Info fill uses Core's 20%/25% strength; on-muted reaches 4.5:1. The released --color-success/warning/error-muted are never derived. Info uses the accent when it's chromatic, otherwise the theme's blue. Set values always win. INV16 and INV17 are listed as accepted but not yet shipped until the implementation lands.
  • component:Banner FR9 (accepted target): the status surface fills with --color-<status>-muted and its built-in content uses --color-on-<status>-muted.
  • architecture:theme-tokens DEC-2: the Info roles reuse the retired --color-info-muted name; the v0.0.8 codemod only runs for projects upgrading from before v0.0.8. Bare --color-info stays unused.
  • Theme records (Neutral, Matcha) change with the implementation (feat(theme): add surface-specific status color roles #7657), where their values ship.

Icon and border tokens

Status icons and status borders get their own names (as @rubyycheung's token comparison also proposed), --color-icon-<status> and --color-border-<status>. They sit beside the per-hue --color-icon-red and --color-border-red families, and each defaults to --color-text-<status>. A theme that sets its own keeps 3:1 or more against the default surfaces. In a names-only agent test, status icons used the readable status colour in 16 of 16 tries with icon tokens and 0 of 16 without; borders went from 0 of 8 to 8 of 8.

Rejected alternatives

  • Redefining base --color-success/warning/error as strong fills: about 47 text, icon, and border uses on main, plus every app's text-success, would change meaning.
  • --color-background-<status> for the strong fill: --color-background-<hue> tokens are pale tints, so the name reads as pale. -emphasized is the grammar's strong form, the counterpart of -muted.
  • --color-status-foreground-<status>: it breaks the grammar (a group segment and a second property word); --color-text-<status> replaces it.

Claim scope and non-goals

Names, surfaces, contrast floors, and compiler derivation. Exact per-theme values belong to the implementation (#7657) and the theme records. Lab components and chart palettes are out of scope.

Evidence and implementation relationship

#7657 implements this contract: tokens in all seven first-party themes, compiler derivation, Badge/Banner/Icon/StatusDot/ProgressBar/Stepper/input internals, Tailwind keys, docs, a Changeset, and contrast and role tests.

Writing rubric results

  • R1 narration: none. INV11 states roles in the present tense, and the Neutral DEC-4 sentence that said "under the status-role contract … now mean" was rewritten as a present-tense mapping.
  • R2 research in the record: none; the consumer inventory and the agent naming test stay in this description.
  • R3 evidence naming a change: none; verification rows cite tests.
  • R4 rejected alternatives over one line or outside a decision: none in the records.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none.

Scope

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

Validation

  • pnpm check:knowledge
  • Prettier
  • git diff --check

Co-authored-by: @rubyycheung (the status-role contract and the Banner, Neutral, and Matcha records)

@vercel

vercel Bot commented Oct 24, 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 Oct 24, 2026 4:56pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 24, 2026, 5:28 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

Banner (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 419 -
Complexity N/A Very High (43) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

46 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
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
RichTextEditor Markdown parity: side by side probe dark 94,866
RichTextEditor Markdown parity: side by side probe light 89,762
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
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
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

and 26 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can't be approved yet: it adds new requirements to five current records (theme-tokens INV11, theme-compilation INV16, Banner FR9, and the Neutral and Matcha theme records), and no owner has approved this exact head. An engineering owner (or a design owner, for the Banner, Neutral and Matcha records) 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; the decision should also settle option A or B for status icons and borders. Whatever the decision, a few record facts need fixing first:

  • The Neutral local-token values, the Matcha contrast exceptions and Banner FR9's "Current behavior" state describe the implementation PR's values, not what the packages ship at this head, so land them with the implementation or keep today's facts here.
  • Neutral's DEC-1 decider date and approved_at record an adoption that no exact-head approval supports.
  • INV11 promises chromatic status colours in every theme, but INV16 derives Info from any theme's accent, including a grey or near-black one.
  • Neutral's compatibility paragraph drops the migration-or-alias rule from AST-006 FR10, and the INV11 verification row cites tests that don't exist yet.

[Automated review]

Comment thread packages/themes/neutral/neutral.spec.md Outdated
Comment on lines +60 to +62
| `--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]]` |

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.

These values don't match what Neutral ships at this head: neutralTheme.ts sets the success, warning and error fills to ['#198100', '#64af4c'], '#ffce2f' and ['#c9303a', '#ff705d'], and green.dark[65], yellow.dark[85] and red.light[50] aren't in the selected-stop module. Since this record makes the exact value a compatibility contract, these rows should land with the source change that ships them.

Comment thread packages/themes/neutral/neutral.spec.md Outdated
**Reference:** `theme:neutral/DEC-1`
**System-boundary decider:** `cixzhang`, `2026-08-31`
**Final Neutral adoption decider:** `rubyycheung`, after OQ1 passes and exact-head review
**Final Neutral adoption decider:** `rubyycheung`, `2026-10-17`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This records the adoption decision as made on 2026-10-17, but no approval of this head exists, and the current DEC-1 waits for OQ1 and an exact-head review. Leave this date, and approved_at on line 8, for the approving owner to set.

Comment thread packages/themes/neutral/neutral.spec.md Outdated
Comment on lines +104 to +105
A Neutral-local name, enrolled theme name, exact value, or semantic meaning may
change only through an owner-approved compatibility update recorded here.

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.

AST-006 FR10 requires a rename or meaning change to use an explicit reviewed migration or alias that preserves the prior contract, and the current paragraph says so. This sentence drops that rule; restore it or link FR10.

Comment thread packages/themes/matcha/matcha.spec.md Outdated
Comment on lines +91 to +95
- light success, warning, and error Banner descriptions and FieldStatus text are
4.58:1, 5.01:1, and 4.73:1 when their translucent fills are composited over
white. Over the light body `#f0f0e0`, the same pairs are 4.03:1, 4.42:1, and
4.14:1. The status icon, title, and written description identify each state
independently of color;

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.

At this head Matcha still ships the pairs this replaces: Banner descriptions are 3.83, 4.11 and 3.54:1 over white, warning FieldStatus text is 2.52:1, the success Badge is 3.58:1 (light), and the error Badge and destructive Button are 4.06:1 (light) and 3.23:1 (dark). The new ratios hold only after the implementation's Matcha changes.

Comment thread packages/core/src/Banner/Banner.spec.md Outdated
| FR6 | The Banner frame exposes `banner-frame` and reflects `container` and `elevation`. The existing `banner` target remains on the Status surface rather than moving to the outermost DOM element. | Owner decision; current source and tests | Current behavior |
| FR7 | `banner-frame` is additive. The existing `banner`, `banner-icon`, `banner-description`, and `banner-content` targets and their current axes remain unchanged. | Current target inventory; compatibility policy | Current behavior |
| FR8 | `status` controls visual meaning only and MUST NOT derive `role`, `aria-live`, or an announcement. Standard DOM props MAY provide an explicit persistent role, except on a Banner added inside a mounted live container (`spec:AST-086` FR4). Async outcomes MUST announce from the transition handler through `useAnnounce`, except inside a mounted live container, where `spec:AST-086` FR4 applies; `role="alert"` is reserved for genuinely urgent interruptive content. | Accessibility Checklist §Announcements; owner decision | Current behavior |
| FR9 | The status surface paints its built-in title, description, icon, collapse, and dismiss content with the matching `--color-on-*-muted` role. Banner supplies that semantic foreground context to each built-in Button element without changing Button-owned geometry or interaction layers; a sibling tooltip keeps Button's ordinary theme color. Consumer-provided `endContent` remains untouched. | Status-role architecture; Banner and Button source/tests | Current behavior |

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.

FR9 is marked "Current behavior", but at this head Banner still paints its title and description with --color-text-primary and --color-text-secondary, and no --color-on-*-muted token exists. Mark it as a target, or land it with the implementation.

Comment thread docs/architecture/theme-tokens.md Outdated
Comment on lines +155 to +156
Every status fill and status text colour is chromatic in every theme: no
theme paints one in a neutral grey, near-black, or near-white. The floors hold

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.

INV16 derives --color-info-emphasized from an authored accent pair, so a theme whose accent is grey or near-black gets a grey or near-black Info fill, which this sentence says no theme paints. Scope the guarantee to Core defaults and first-party themes, or say that derivation doesn't apply when its source would break it.

Comment thread docs/architecture/theme-tokens.md Outdated
| INV8 | `defineTheme.test.ts`, template checks, and token-doc generation | A local name enters portable helpers/docs or can conflict with a portable declaration |
| INV9 | `tokens.test.ts` (core defaults), `SpacingRootFontSize.a11y.chromium.spec.ts` (real-Chromium root font size), each overriding theme's `*Theme.spacing.test.ts`, `check-cli-theme-bundle.test.mjs` (bundled copies byte-equal to the packages), `theme-concentricity.test.ts` (playground ramp read in rem) | A spacing step in `px` that no theme documents as its exception: a core default, a theme override, a bundled copy, or a generated ramp step |
| INV10 | `tokens.test.ts` name check over `colorDefaults` and `domainTokenDefaults` | A colour token name fits none of the five shapes |
| INV11 | `scripts/check-muted-status-contrast.test.mjs` (resolves global and Banner pale-surface role pairs), `scripts/check-badge-contrast.test.mjs` (resolves Core Badge defaults plus theme overrides), `scripts/check-status-text-contrast.test.mjs` (resolves `--color-text-<status>` against the surface and card tokens and checks that each status fill and text colour is chromatic in every first-party theme), `neutralTheme.test.ts` (pins reviewed role values and pairings), `tailwind-theme.test.ts` (pins the status utilities, including the released base ones), forced-colors assertions in the Badge, StatusDot, and Banner tests, and theme alias-generation tests | A status role is missing, mispaired, grey, routed to the wrong public utility, or falls below its contrast threshold in light or dark mode, a status fill loses its border in forced-colors mode, or a released base status token or utility changes value |

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.

scripts/check-muted-status-contrast.test.mjs and scripts/check-status-text-contrast.test.mjs don't exist at this head (the second isn't in the implementation PR either), and no Badge, StatusDot or Banner test asserts forced colors yet. Cite existing tests or mark this evidence as planned.

@cixzhang
cixzhang force-pushed the spec/status-color-roles branch from 3a4609f to 31907e5 Compare October 24, 2026 12:15
@cixzhang
cixzhang changed the base branch from spec/color-token-grammar to main October 24, 2026 12:17
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 2026
rubyycheung and others added 7 commits October 24, 2026 05:37
Records the status-role contract from the status color roles
implementation: theme-tokens status roles, the compiler's generated
compatibility roles, Banner's status foreground (FR9), and the Neutral
and Matcha mappings. Invariants are renumbered to follow the colour
token grammar (theme-tokens INV11) and the built-icon invariant
(theme-compilation INV16).
Adjusts the status-role contract so released tokens keep their meaning:
--color-success/warning/error and their Tailwind utilities are
unchanged in every theme. The strong fill is --color-<status>-emphasized
with --color-on-<status>; status text, icons, and borders use
--color-text-<status> (4.5:1 on the default surfaces); pale fills keep
--color-<status>-muted with --color-on-<status>-muted. Every role keeps
its status hue in every theme.

Co-authored-by: rubyycheung <[email protected]>
--color-icon-<status> and --color-border-<status> follow the per-hue
icon and border families and default to --color-text-<status>.
…INV17)

A theme that sets only its base status colours compiles to a complete,
contrast-valid, chromatic status set. Icon and border alias text; set
values always win; runtime and build derive the same values.

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

This can't be approved yet: it adds new requirements to five current records (theme-tokens INV11, theme-compilation INV16 and INV17, Banner FR9, and the Neutral and Matcha theme records), and no owner has approved this exact head. An engineering owner (or a design owner, for the Neutral and Matcha records) records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Whatever the decision, a few record facts need fixing first:

  • The Neutral status-fill values, the Matcha contrast exceptions and Banner FR9's "Current behavior" state describe what the implementation would ship, not what the packages ship today.
  • INV16 and INV17 are missing from theme-compilation's list of accepted-but-unshipped invariants, and INV11's verification row cites tests that don't exist yet.
  • Neutral's approved_at and DEC-1 decider date record an adoption that no exact-head approval supports, and its compatibility paragraph drops AST-006 FR10's migration-or-alias rule.
  • INV17's muted derivation yields a full-strength fill when a theme's --color-accent-muted is opaque, as Neutral's is, and INV11's every-theme chromatic and 3:1 rules can't be checked for themes Astryx doesn't ship.

[Automated review]

Comment thread packages/themes/neutral/neutral.spec.md Outdated
Comment on lines +60 to +62
| `--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]]` |

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.

These values aren't what Neutral ships at this head: neutralTheme.ts:37-39 sets ['#198100', '#64af4c'], '#ffce2f' and ['#c9303a', '#ff705d'], and green.dark[65], yellow.dark[85] and red.light[50] aren't in neutralPaletteRefs.generated.ts. Since the compatibility paragraph makes the exact value a contract, these rows should land with the source change that ships them.

Comment thread packages/themes/neutral/neutral.spec.md Outdated
Portable semantic token names remain stable across themes. Neutral-local status
roles remain emitted for Neutral extensions, but Core does not depend on them.
A Neutral-local name, enrolled theme name, exact value, or semantic meaning may
change only through an owner-approved compatibility update recorded here.

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.

AST-006 FR10 requires a rename or meaning change to use an explicit reviewed migration or alias that preserves the prior contract, and the current paragraph says so. This sentence drops that rule; restore it or link FR10.

Comment thread packages/themes/neutral/neutral.spec.md Outdated
**Reference:** `theme:neutral/DEC-1`
**System-boundary decider:** `cixzhang`, `2026-08-31`
**Final Neutral adoption decider:** `rubyycheung`, after OQ1 passes and exact-head review
**Final Neutral adoption decider:** `rubyycheung`, `2026-10-17`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This records the adoption as decided on 2026-10-17, but no approval of this head exists, and the current DEC-1 waits for OQ1 and a ratification of the exact record head. Leave this date, and approved_at on line 8, for the approving owner to set, and keep OQ1 until its evidence is cited.

Comment thread packages/themes/matcha/matcha.spec.md Outdated
Comment on lines +91 to +95
- light success, warning, and error Banner descriptions and FieldStatus text are
4.58:1, 5.01:1, and 4.73:1 when their translucent fills are composited over
white. Over the light body `#f0f0e0`, the same pairs are 4.03:1, 4.42:1, and
4.14:1. The status icon, title, and written description identify each state
independently of color;

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.

At this head Matcha still ships the pairs this replaces: info, success, warning and error Banner descriptions are 3.88, 3.83, 4.11 and 3.54:1 over white, warning FieldStatus text is 2.52:1, the success Badge is 3.58:1 light and 4.25:1 dark, and the error Badge and destructive Button are 4.06:1 light and 3.23:1 dark. The new ratios hold only after the implementation's changes.

Comment thread packages/core/src/Banner/Banner.spec.md Outdated
| FR6 | The Banner frame exposes `banner-frame` and reflects `container` and `elevation`. The existing `banner` target remains on the Status surface rather than moving to the outermost DOM element. | Owner decision; current source and tests | Current behavior |
| FR7 | `banner-frame` is additive. The existing `banner`, `banner-icon`, `banner-description`, and `banner-content` targets and their current axes remain unchanged. | Current target inventory; compatibility policy | Current behavior |
| FR8 | `status` controls visual meaning only and MUST NOT derive `role`, `aria-live`, or an announcement. Standard DOM props MAY provide an explicit persistent role, except on a Banner added inside a mounted live container (`spec:AST-086` FR4). Async outcomes MUST announce from the transition handler through `useAnnounce`, except inside a mounted live container, where `spec:AST-086` FR4 applies; `role="alert"` is reserved for genuinely urgent interruptive content. | Accessibility Checklist §Announcements; owner decision | Current behavior |
| FR9 | The status surface paints its built-in title, description, icon, collapse, and dismiss content with the matching `--color-on-*-muted` role. Banner supplies that semantic foreground context to each built-in Button element without changing Button-owned geometry or interaction layers; a sibling tooltip keeps Button's ordinary theme color. Consumer-provided `endContent` remains untouched. | Status-role architecture; Banner and Button source/tests | Current behavior |

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.

FR9 is marked "Current behavior", but at this head Banner paints its title and description with --color-text-primary and --color-text-secondary (Banner.tsx:283, :295), and no --color-on-*-muted token exists. Mark it as a target, or land it with the implementation.

Comment thread docs/architecture/theme-compilation.md Outdated
Comment on lines +215 to +217
- `--color-<status>-muted` is the status hue at the opacity of the theme's
`--color-accent-muted` (Core: 20% light, 25% dark), and `--color-on-<status>-muted` is the status hue at the
lightness that reaches 4.5:1 on that fill over the default surface.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When a theme's --color-accent-muted is opaque, as Neutral's is (#f1f1f1 / #262626), "the opacity of the theme's --color-accent-muted" is 100%, so the derived muted fill is the full status hue rather than INV11's pale fill. Define the pale level without relying on that alpha (for example Core's 20% / 25%), and add an opaque case to the INV17 verification row.

Authored destination roles, source order, `!important`, `inherit`, concrete
values, and cycles retain their normal CSS meaning. Runtime and static output
use the same derivation.
- **INV17 — Theme generation establishes every status role.** For each

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.

Nothing derives status roles at this head, but the gaps section below lists only INV13-INV14 and the INV11 prefix clause as accepted but unshipped, then calls the remaining invariants the current contract. List INV16 and INV17 there until the implementation lands.

Comment thread docs/architecture/theme-tokens.md Outdated
| INV8 | `defineTheme.test.ts`, template checks, and token-doc generation | A local name enters portable helpers/docs or can conflict with a portable declaration |
| INV9 | `tokens.test.ts` (core defaults), `SpacingRootFontSize.a11y.chromium.spec.ts` (real-Chromium root font size), each overriding theme's `*Theme.spacing.test.ts`, `check-cli-theme-bundle.test.mjs` (bundled copies byte-equal to the packages), `theme-concentricity.test.ts` (playground ramp read in rem) | A spacing step in `px` that no theme documents as its exception: a core default, a theme override, a bundled copy, or a generated ramp step |
| INV10 | `tokens.test.ts` name check over Astryx's own `colorDefaults` and `domainTokenDefaults` only | A colour token Astryx defines fits none of the five shapes |
| INV11 | `scripts/check-muted-status-contrast.test.mjs` (resolves global and Banner pale-surface role pairs), `scripts/check-badge-contrast.test.mjs` (resolves Core Badge defaults plus theme overrides), `scripts/check-status-text-contrast.test.mjs` (resolves `--color-text-<status>`, `--color-icon-<status>`, and `--color-border-<status>` against the surface and card tokens and checks that each status fill and text colour is chromatic in every first-party theme), `neutralTheme.test.ts` (pins reviewed role values and pairings), `tailwind-theme.test.ts` (pins the status utilities, including the released base ones), forced-colors assertions in the Badge, StatusDot, and Banner tests, and theme alias-generation tests | A status role is missing, mispaired, grey, routed to the wrong public utility, or falls below its contrast threshold in light or dark mode, a status fill loses its border in forced-colors mode, or a released base status token or utility changes value |

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.

scripts/check-muted-status-contrast.test.mjs, scripts/check-status-text-contrast.test.mjs and tailwind-theme.test.ts don't exist at this head, and no Badge, StatusDot or Banner test asserts forced colors. Cite existing tests, or mark this evidence as implementation acceptance as the theme-compilation record does for INV13-INV14.

Comment thread docs/architecture/theme-tokens.md Outdated
Comment on lines +162 to +163
Every status fill and status text colour is chromatic in every theme: no
theme paints one in a neutral grey, near-black, or near-white. The floors hold

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.

INV17 lets a value a theme sets always win, and the verification checks first-party themes only, so a third-party theme can set a grey status text colour and nothing fails. Scope this rule (and the 3:1 rule for a theme's own icon and border colours) to Astryx's own themes as INV10 does, or state it as a requirement on theme authors.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 485f4df

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 2026
Banner FR9 and theme-compilation INV16-INV17 are accepted targets until
the implementation lands; INV11's evidence is implementation acceptance.
The contrast and chromatic rules bind Core, first-party themes, and
derived values. Derived pale fills use Core's 20%/25% strength. Neutral
keeps its shipped values, dates, and AST-006 FR10 compatibility rule;
Matcha's measured exceptions stay as shipped. Theme values move with the
implementation.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 2026
INV17 derives only the new pale Info fill; --color-success/warning/error-muted
are released and keep their values.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 9a43a85

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 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: an engineering owner has approved the status-role direction for this head, and four record fixes remain. Please amend the records as below, then ask an engineering owner to comment /approve-spec <full head SHA> on the new head, since a new commit resets the approval.

  • INV17 makes defineTheme derive status roles, but architecture:theme-authoring-contract's precedence order has no step for them and does not say whether a role inherited through extends counts as set, so amend that record (or keep INV17 to compiler output) and add an extends case to INV17's verification.
  • --color-info-muted shipped until v0.0.8 with a purple meaning and the v0.0.8 codemod still rewrites it to --color-background-purple, so record the reuse as a compatibility decision or pick a name that never shipped.
  • theme:neutral no longer describes the status-fill and tint mappings Neutral ships while OQ2 still refers to that list, and DEC-4's new sentence sits under its 2026-09-04 decider line.
  • Banner FR9 should name the status surface's fill, because Info is painted on --color-accent-muted, which no floor pairs with --color-on-info-muted.

[Automated review]

Comment thread docs/architecture/theme-compilation.md Outdated
use the same derivation.
- **INV17 — Theme generation establishes every status role.** For each
`architecture:theme-tokens` INV11 status role a theme does not set,
`defineTheme` and the theme build derive one, so a theme that sets only its

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This makes defineTheme derive status roles, but architecture:theme-authoring-contract owns normalization and its one precedence order (resolved base, generated values, explicit tokens) has no step for derived roles; that record is not amended here, and this record says it does not own authoring precedence or inheritance (line 232). Since extends carries forward resolved tokens, please say whether a role inherited from the parent counts as set, place the step in the authoring contract, and add an extends case to the INV17 verification row.

mode.
- `--color-<status>-emphasized` is the status hue, adjusted only as far as
needed for the theme's `--color-on-<status>` to reach 4.5:1 on it.
- `--color-info-muted` is the Info hue at Core's pale-fill strength, 20%

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.

--color-info-muted is a released name: v0.0.6 renamed --color-educational-deemphasized to it, v0.0.8 removed it, and the v0.0.8 transform still rewrites it to --color-background-purple (packages/cli/assets/codemods/transforms/v0.0.8/migrate-token-renames.mjs:57), so astryx upgrade --from any earlier version would turn the new pale Info fill purple. Please record the reuse as a compatibility decision or pick a name that never shipped.

Comment thread packages/themes/neutral/neutral.spec.md Outdated
AvatarStatusDot, Stepper indicators, and ProgressBar wherever the existing state
already has the same semantic meaning. Banner uses the proposed tint-content and
interaction roles. Every mapping remains subject to exact-head theme review and
Core components choose semantic roles by surface (`architecture:theme-tokens`

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.

Neutral still ships the mappings the replaced paragraph described (local status fills on Badge, StatusDot, AvatarStatusDot, Stepper indicators and ProgressBar, and the tint roles on Banner, in neutralTheme.ts), and no INV11 role yet, while this record says it documents shipped output and OQ2 still asks about every listed component mapping. Keep the shipped mappings here and add the INV11 roles as the target.

Comment thread packages/core/src/Banner/Banner.spec.md Outdated
| FR6 | The Banner frame exposes `banner-frame` and reflects `container` and `elevation`. The existing `banner` target remains on the Status surface rather than moving to the outermost DOM element. | Owner decision; current source and tests | Current behavior |
| FR7 | `banner-frame` is additive. The existing `banner`, `banner-icon`, `banner-description`, and `banner-content` targets and their current axes remain unchanged. | Current target inventory; compatibility policy | Current behavior |
| FR8 | `status` controls visual meaning only and MUST NOT derive `role`, `aria-live`, or an announcement. Standard DOM props MAY provide an explicit persistent role, except on a Banner added inside a mounted live container (`spec:AST-086` FR4). Async outcomes MUST announce from the transition handler through `useAnnounce`, except inside a mounted live container, where `spec:AST-086` FR4 applies; `role="alert"` is reserved for genuinely urgent interruptive content. | Accessibility Checklist §Announcements; owner decision | Current behavior |
| FR9 | The status surface paints its built-in title, description, icon, collapse, and dismiss content with the matching `--color-on-*-muted` role. Banner supplies that semantic foreground context to each built-in Button element without changing Button-owned geometry or interaction layers; a sibling tooltip keeps Button's ordinary theme color. Consumer-provided `endContent` remains untouched. | Status-role architecture; Banner and Button source/tests | Accepted target |

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.

INV11 sets the 4.5:1 floor for --color-on-<status>-muted on --color-<status>-muted, but Banner's info surface is painted with --color-accent-muted (Banner.tsx:352). Please say which fill the status surface uses, for example --color-info-muted for Info, so the content pair has a floor.

…Banner fill

INV17 is compiler output with matching non-CSS resolution, and states how
extends counts inherited roles. theme-tokens DEC-2 records the reuse of the
retired Info names. Banner FR9 names the status surface fill. Neutral's
record moves with the implementation.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 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.

This can’t be approved yet: it adds new requirements to three current records (theme-tokens INV11 and DEC-2, theme-compilation INV16 and INV17, and Banner FR9), and no owner has approved this exact head, since the earlier /approve-spec comments name previous heads. 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. Whatever the decision, two record fixes remain:

  • INV17 says every unset status role is derived but gives no rule for --color-on-<status>, which its -emphasized rule depends on, so --color-on-info is undefined; its chromatic promise also needs a fallback for a grey base status colour, and its verification row a non-CSS resolution case.
  • Banner’s ownership bullet, action/dismiss design row and anatomy paragraph describe FR9’s accepted target as shipped behaviour.

[Automated review]

Comment on lines +218 to +219
- `--color-<status>-emphasized` is the status hue, adjusted only as far as
needed for the theme's `--color-on-<status>` to reach 4.5:1 on it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This rule is computed from --color-on-<status>, but INV17’s list never says how an unset --color-on-<status> is obtained, and Info has no released --color-on-info. Please add a bullet, for example: the released --color-on-success, --color-on-warning and --color-on-error are never derived, and --color-on-info takes --color-on-accent (the pair INV16 already treats as Info’s).

Comment thread packages/core/src/Banner/Banner.spec.md Outdated
Comment on lines +87 to +90
- The semantic foreground context for Banner-authored title, description, icon,
collapse, and dismiss content on the status surface. Built-in controls receive
that context on their Button element only, so their tooltip remains an ordinary
Button surface.

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.

FR9 is an accepted target, but this bullet (and the action/dismiss design row and the anatomy paragraph) states it as shipped: at this head the built-in collapse and dismiss controls are ghost Buttons whose icons inherit the Button colour. Please mark these statements as FR9’s target.

…R9 target

INV17 states how --color-on-<status> is obtained, falls back to Core's hue for
a grey base status colour, keeps the alias for a non-concrete source, and
verifies non-CSS resolution. Banner's ownership, design and anatomy text mark
FR9 as the accepted target.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 54d075d

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 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 status-role direction is approved for this head, and one record fix remains. INV17's new fallback for a status source that is not a concrete colour (“keeps the INV16 alias”) names no value for the roles INV17 computes and contradicts INV11's promise that derived values meet the contrast floors and stay chromatic, so please name what each role holds in that case, say whether it sits outside those guarantees or must meet them, and add that case to the INV17 verification row. Banner's requirement-table intro also still says every row is current behaviour or the frame target, while FR9 is an accepted target. After the fix, an engineering owner needs to comment /approve-spec <full head SHA> on the new head, since a new commit resets the approval.

[Automated review]

Comment thread docs/architecture/theme-compilation.md Outdated
Comment on lines +234 to +235
fill and text colour is chromatic. A source that is not a concrete colour,
such as an unresolved reference, keeps the INV16 alias instead. A value the theme sets always wins over a derived one. A

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.

INV16 says where a derived alias is emitted but never which token each role aliases, and INV17 computes text, strong fill, the pale Info fill and pale-fill content rather than aliasing them, so this alias has no stated value for those roles. Whatever it is, it forwards a colour the compiler cannot measure, while architecture:theme-tokens INV11 says derived values meet the contrast floors and stay chromatic. Please name what each role holds for a non-concrete source, say whether that alias sits outside INV11's guarantees or must meet them, and add a non-concrete source to the INV17 fixtures.

Comment thread packages/core/src/Banner/Banner.spec.md Outdated
Comment on lines 110 to 111
The requirements below describe the current implementation and its additive
frame target contract.

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.

FR9 below is an accepted status-colour target, neither current behaviour nor the frame target. Suggest: “describe the current implementation, its additive frame target contract, and FR9's accepted status-colour target.”

INV17 lists what each role holds when its source cannot be measured, places
those aliases outside the derived-value floors for third-party themes, and
adds an unresolved-reference fixture. Banner's requirement intro names FR9's
accepted target.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 4abfa10

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 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 status-role direction is approved for this head, and two record fixes remain. INV17's new fallback covers a status colour that isn't a concrete colour, but not the page and card surfaces, pale fill or --color-on-<status> its computations measure against, so a theme that sets one of those to an unresolved reference gets no defined value while INV11 says derived values meet the contrast floors; please extend the fallback to those inputs, say what each role holds then, and add that case to the INV17 verification row. Banner's compatibility section also still says its visual output is unchanged, although FR9 changes the Info fill and every built-in content colour. After the fixes, an engineering owner needs to comment /approve-spec <full head SHA> on the new head, since a new commit resets the approval.

[Automated review]

Comment thread docs/architecture/theme-compilation.md Outdated
Comment on lines +234 to +242
fill and text colour is chromatic. A source that is not a concrete colour,
such as an unresolved reference, cannot be measured, so for that status each
role aliases its INV16 source instead: the strong fill aliases the base
status colour (the accent for Info), `--color-info-muted` aliases
`--color-accent-muted`, and the text and pale-fill content roles alias the
theme's matching hue text token (`--color-text-blue`, `-green`, `-yellow`,
or `-red`). Those aliases carry the theme's own values: they are not derived
values, so INV11's floors bind them only in Core and first-party themes,
which use concrete sources. A value the theme sets always wins over a derived

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This fallback covers a status colour that isn't a concrete colour, but the computed roles above also measure the theme's page and card surfaces, the pale fill and --color-on-<status>. When one of those is an unresolved reference (say --color-background-card: var(--host-card)), INV17 gives no value, while theme-tokens INV11 says derived values meet the contrast floors. Suggest extending the clause to any colour a computation measures, naming what each role holds then (the same aliases would do), and adding an unresolved-surface fixture to the INV17 verification row.

| FR6 | The Banner frame exposes `banner-frame` and reflects `container` and `elevation`. The existing `banner` target remains on the Status surface rather than moving to the outermost DOM element. | Owner decision; current source and tests | Current behavior |
| FR7 | `banner-frame` is additive. The existing `banner`, `banner-icon`, `banner-description`, and `banner-content` targets and their current axes remain unchanged. | Current target inventory; compatibility policy | Current behavior |
| FR8 | `status` controls visual meaning only and MUST NOT derive `role`, `aria-live`, or an announcement. Standard DOM props MAY provide an explicit persistent role, except on a Banner added inside a mounted live container (`spec:AST-086` FR4). Async outcomes MUST announce from the transition handler through `useAnnounce`, except inside a mounted live container, where `spec:AST-086` FR4 applies; `role="alert"` is reserved for genuinely urgent interruptive content. | Accessibility Checklist §Announcements; owner decision | Current behavior |
| FR9 | The status surface fills with the matching `--color-<status>-muted` role (`--color-info-muted` for Info) and paints its built-in title, description, icon, collapse, and dismiss content with the matching `--color-on-<status>-muted` role. Banner supplies that semantic foreground context to each built-in Button element without changing Button-owned geometry or interaction layers; a sibling tooltip keeps Button's ordinary theme color. Consumer-provided `endContent` remains untouched. | Status-role architecture; Banner and Button source/tests | Accepted target |

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.

FR9 changes Banner's look (the Info fill and every built-in content colour), but the Compatibility and migration section (line 43) still says "visual output … unchanged". Please add FR9's visual change there, or scope that sentence to DEP-0007.

INV17's alias fallback covers the page and card surfaces, the pale fill and
--color-on-<status> as well as the status source, with an unresolved-surface
fixture. Banner's compatibility section scopes the unchanged-visuals claim to
DEP-0007 and names FR9's visual change.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 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.

This can't be approved yet because no engineering owner has approved this exact head: the earlier /approve-spec comments name previous heads, and this commit changes INV17's fallback and Banner's compatibility line. The two record fixes requested on the previous head are made, and nothing else needs to change. An engineering owner records the decision on theme-tokens INV11 and DEC-2, theme-compilation INV16 and INV17, and Banner FR9 by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0d37594

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 2026
@cixzhang
cixzhang merged commit 4d9de87 into main Oct 24, 2026
70 checks passed
@github-actions
github-actions Bot deleted the spec/status-color-roles branch October 25, 2026 06:20

This branch was successfully deployed

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants