Skip to content

Share theme palette reference generation - #7678

Merged
rubyycheung merged 2 commits into
mainfrom
ruby/palette-ref-generator
Oct 22, 2026
Merged

rubyycheung merged 2 commits into
mainfrom
ruby/palette-ref-generator

Conversation

@rubyycheung

@rubyycheung rubyycheung commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • extract the selected-palette reference parser and renderer used by Neutral into shared maintenance infrastructure
  • keep Neutral's generated output byte-identical through its existing wrapper
  • add a cross-platform receipt assertion that compares stable provenance exactly and diagnostic floats within insignificant tolerance
  • record the generator implementation and candidate format in palette generation receipts, with a patch Changeset for @astryxdesign/cli

Test plan

  • pnpm vitest run scripts/generate-neutral-palette-refs.test.mjs scripts/palette-receipt-test-utils.test.mjs packages/cli/api/theme/palette/generate/generate.test.mjs packages/cli/foundation/response/response-types.doc.test.mjs
  • node scripts/generate-neutral-palette-refs.mjs --check
  • pnpm -F @astryxdesign/cli readme:check
  • pnpm -F @astryxdesign/cli typecheck:json-api
  • pnpm check:repo

This maintenance prerequisite contains no theme color or token changes.

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

vercel Bot commented Oct 18, 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 22, 2026 4:51pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Oct 22, 2026, 4:54 PM UTC

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

46 of 494 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.

No blocking issues found; this review recommends approval. The shared generator is a mechanical extraction: Neutral's selected palette references regenerate byte-for-byte identically, with the same check behavior and error messages. The new receipt assertion keeps every non-diagnostic receipt field exact and tolerates only negligible floating-point drift in diagnostic measurements, consistent with the palette-recipe contract. Nothing further is needed from you.

[Automated review]

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

No blocking issues found; this review recommends approval. The shared generator reproduces Neutral's selected palette references, check results and error messages exactly, and the new generatorVersion and candidateFormatVersion receipt fields leave candidate bytes and digests unchanged while supplying the implementation and format versions the palette-generation spec asks receipts to name. Before merging, please update the description to mention those receipt fields and the @astryxdesign/cli changeset that arrived with #7679, since it currently describes only the script extraction and the receipt assertion.

[Automated review]

rubyycheung and others added 2 commits October 22, 2026 11:33
Summary: Palette generation receipts now name the generator implementation (`generatorVersion: palette-generator-v1`) and the format of the candidate bytes they hash (`candidateFormatVersion`: `palette-typescript-v1` for a TypeScript output, `palette-json-v1` for a JSON output or a printed candidate), as AST-008 FR6 requires. The serializer returns the format together with the exact bytes it produced, so the recorded format always matches the hashed output. `candidateSha256` and every existing receipt field keep their values and order. The version constants are module exports beside `PALETTE_PREVIEW_VERSION`; the public API barrel is unchanged.

Test Plan: pnpm exec vitest run packages/cli/api/theme/palette/generate scripts/palette-receipt-test-utils.test.mjs scripts/generate-neutral-palette-refs.test.mjs scripts/check-theme-template.test.mjs; tsc --project packages/cli/tsconfig.strict.json; eslint and prettier --check on changed files; pnpm check:changesets.

Reviewers:

Subscribers:

Tasks:

Tags:
@rubyycheung
rubyycheung force-pushed the ruby/palette-ref-generator branch from 19d98bf to 2b5f108 Compare October 22, 2026 16:37
@rubyycheung
rubyycheung merged commit 813c1d5 into main Oct 22, 2026
65 checks passed
@github-actions
github-actions Bot deleted the ruby/palette-ref-generator branch October 23, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — 2b5f108f Deployed Oct 22, 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.

1 participant