Skip to content

fix(theme-neutral): map tokens to reviewed palette - #6034

Merged
rubyycheung merged 8 commits into
mainfrom
codex/neutral-palette-token-mapping
Sep 6, 2026
Merged

fix(theme-neutral): map tokens to reviewed palette#6034
rubyycheung merged 8 commits into
mainfrom
codex/neutral-palette-token-mapping

Conversation

@rubyycheung

@rubyycheung rubyycheung commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Maps Neutral's existing color roles to the approved palette from feat(theme-neutral): adopt approved palette #5987.
  • Uses named palette-stop references in the maintained theme source and CLI template instead of duplicating generated hex values.
  • Preserves alpha variants through one small helper and keeps intentional non-palette local values explicit.
  • Covers core neutrals, semantic statuses, categorical families, syntax colors, and color-bearing inset effects.
  • Keeps ordinary dark surfaces near-black; exact black remains an explicit choice.

Review boundary

This PR defines which approved palette value each existing Neutral color role uses. It preserves token names and does not change component structure, typography, spacing, motion, or radius.

The selected mappings include the adjustments made during visual review. Further component-level design changes remain separate from this palette-to-token mapping.

#5628 contained the original mapping work but merged into an intermediate stack branch rather than main. This PR carries the mapping forward against the final generated palette.

Stack

#5985 -> #5992 -> #5987 -> this PR -> #5649

Verification

  • Neutral palette and mapping tests: 7 passed
  • Neutral production build passes
  • Theme source and CLI template are byte-for-byte synchronized
  • Formatting, linting, knowledge, changeset, and repository checks pass

Changeset

Included for @astryxdesign/theme-neutral and @astryxdesign/cli.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 4, 2026
@vercel

vercel Bot commented Sep 4, 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 Sep 5, 2026 2:55pm UTC

Request Review

@rubyycheung
rubyycheung force-pushed the codex/neutral-palette-adoption branch from 0b0a1fb to 22b0389 Compare September 4, 2026 17:35
@rubyycheung
rubyycheung force-pushed the codex/neutral-palette-token-mapping branch from 6d1919c to 3442190 Compare September 4, 2026 17:35
@rubyycheung rubyycheung changed the title fix(theme-neutral): map tokens to reviewed palette fix(theme-neutral): apply baseline palette remap Sep 4, 2026
@rubyycheung
rubyycheung force-pushed the codex/neutral-palette-adoption branch from 22b0389 to 8cca7f9 Compare September 4, 2026 18:15
@rubyycheung
rubyycheung force-pushed the codex/neutral-palette-token-mapping branch from 3442190 to 18ef6fa Compare September 4, 2026 18:15
@rubyycheung
rubyycheung force-pushed the codex/neutral-palette-token-mapping branch from 18ef6fa to e227c9d Compare September 4, 2026 18:26
@rubyycheung rubyycheung changed the title fix(theme-neutral): apply baseline palette remap fix(theme-neutral): map tokens to reviewed palette Sep 4, 2026
@rubyycheung
rubyycheung force-pushed the codex/neutral-palette-token-mapping branch from e227c9d to 4d13a5d Compare September 4, 2026 18:33
@rubyycheung
rubyycheung force-pushed the codex/neutral-palette-adoption branch from 8cca7f9 to 4370442 Compare September 4, 2026 18:36
@rubyycheung
rubyycheung force-pushed the codex/neutral-palette-token-mapping branch from 4d13a5d to f085b15 Compare September 4, 2026 18:36

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

Light-mode CodeBlock comments and operators now render at 4.478:1 against the Neutral syntax background, down from 4.543:1 at the parent, so this 14px text falls below AA. Please keep both roles at or above 4.5:1 in the rendered light theme and cover that pairing with a focused regression test.

[Reviewed by Robohands]

@rubyycheung

Copy link
Copy Markdown
Contributor Author

Addressed the requested contrast fix.

  • Light-mode --color-syntax-comment and --color-syntax-operator now use Neutral T45 (#6a6a6a) instead of T50 (#777777), raising contrast against the syntax background from 4.478:1 to 5.409:1.
  • Dark-mode values and the general secondary text color are unchanged.
  • Added focused regression coverage for both emitted syntax tokens.
  • Fixed the package-boundary issue found by the first deployment; the theme package build now passes.

The latest Vercel deployment and all current checks are green. Please re-review.

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

Thanks—the rendered contrast is fixed at 5.409:1 light and 7.048:1 dark. The earlier ask also required a regression guard, but the latest commit removed the only ≥4.5 assertion; the remaining test still passes when T45 is changed back to failing #777777. Please keep a package-local threshold assertion for both roles.

[Reviewed by Robohands]

@github-actions
github-actions Bot deleted the branch main September 5, 2026 06:19
@rubyycheung

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main, including the merged dark-palette-edge update from #6069. The selected-stop runtime module was regenerated from the current palette, and the Neutral source/template remain synchronized.

The palette-edge merge changes dark-mode colors, so please review the refreshed visual preview/screenshots again. Focused Neutral tests pass (18/18), and the Neutral production build passes. The built runtime source now minifies to ~13.0 kB / ~3.4 kB gzip, without bundling the complete authoring palette.

@rubyycheung
rubyycheung changed the base branch from codex/neutral-palette-adoption to main September 5, 2026 07:28
@github-actions
github-actions Bot requested a review from cixzhang September 5, 2026 07:29
@rubyycheung

Copy link
Copy Markdown
Contributor Author

The selected-stop runtime fix is now pushed on top of current main (including #6069). Neutral source/template synchronization, the complete token-mapping test suite, and the Neutral production build pass. The remaining review item—the full-palette bundle regression—is addressed by importing only the generated stops used by neutralTheme; the complete palette remains authoring/test data. Please re-review the refreshed visual preview and rerun the package-size check on this head.

github-actions Bot added a commit that referenced this pull request Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

2 of 348 shot(s) changed. View the report

A repository maintainer can accept these exact frames: /accept-visual 33973084709/1 <why every changed frame is correct>

A change here is a question, not a failure: check whether the after is the
picture you intended. If it is, say so in the PR — the release gate's baseline
is updated deliberately, and this check never rewrites it.

component story theme mode pixels
ComplexSelector Fruit ripeness selector neutral light 3,992
ComplexSelector Fruit ripeness selector neutral dark 3,825
ComplexSelector — Fruit ripeness selector — neutral light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
ComplexSelector — Fruit ripeness selector — neutral dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

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

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

Builders using astryx theme add neutral still get an uncompilable theme: the scaffolded neutralTheme.ts imports ./neutralPaletteRefs.generated, but packages/cli/assets/templates/themes/manifest.json omits that file, so themeAdd() never copies it. I reproduced the generated directory with the import present and file absent; the current add test passes because it only checks files already listed in the stale manifest. Please regenerate the manifest and make the test resolve or compile every scaffolded relative import.

Also update the current Neutral spec: its intro, compatibility, and build sections still say token remapping is outside this release, while this PR and DEC-4 ship it.

The source-bundle fix and CodeBlock guard now pass (13.0 kB minified / 3.38 kB gzip; 5.409:1 light, 7.048:1 dark).

[Reviewed by Robohands]

@rubyycheung

Copy link
Copy Markdown
Contributor Author

Fixed in 6730e30.

  • Regenerated the CLI theme manifest so neutralPaletteRefs.generated.ts is copied by theme add neutral.
  • Added a regression test that resolves every relative import in scaffolded theme files.
  • Updated the Neutral spec intro, compatibility/migration, and build/artifact sections to reflect the token mappings shipped by DEC-4.

Focused add/template tests pass (21/21), and repository checks pass locally.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The CLI manifest/import test now closes the scaffold break, and the prior CodeBlock contrast and source-bundle regressions remain fixed. One release-blocking contradiction remains in the current Neutral spec: the decision-log preface still says approval covers only the palette and token mappings remain for a later release, while the intro and DEC-4 say this PR approves and ships them. Please make lines 183–186 agree with DEC-4 and this release.

[Reviewed by Robohands]

@rubyycheung

Copy link
Copy Markdown
Contributor Author

Addressed the remaining spec contradiction in 2d596b0. The Decision Log preface now states that DEC-2 approves the palette and DEC-4 approves the reviewed token mappings shipped in this release, while local-token and rendered-evidence gates remain governed by their specific decisions. Knowledge checks and focused template/add tests pass.

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

Thanks—the exact head now preserves the reviewed Neutral mapping across package and CLI source builds, keeps CodeBlock contrast guarded, and aligns the DEC-4 release record.

[Reviewed by Robohands]

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Sep 5, 2026
@rubyycheung
rubyycheung merged commit cde73c7 into main Sep 6, 2026
29 of 30 checks passed
@github-actions
github-actions Bot deleted the codex/neutral-palette-token-mapping branch September 6, 2026 06:19
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