Skip to content

feat(cli): a light neutral also fills the page, surface and card backgrounds in light mode - #13442

Merged
josephfarina merged 3 commits into
feature/theme-editorfrom
theme-how-light-neutral-surfaces
Nov 21, 2026
Merged

josephfarina merged 3 commits into
feature/theme-editorfrom
theme-how-light-neutral-surfaces

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Someone theming with astryx experimental theme editor how who asks for "silver #c0c0c0 everywhere" (a Windows 98 look) gets neutral '#c0c0c0': the editor grows its grays from silver, but the page, surfaces and cards sit at that ramp's near-white shades, so the app stays white.

Change

A light neutral color the ask states (one dark text reads on better than white) is the surface color too: the answer also sets --color-background-body, --color-background-surface and --color-background-card to it in light mode, in one sequence with the neutral line. Dark mode keeps the dark shades the editor makes from it, as the ask names no dark surface. The page text check measures the theme's text on the new page color and offers its own line where it would not read. The answer no longer offers the neutral token alone as a second choice. A darker neutral ("slate grays", "warm neutrals"), and a lighter or darker neutral worked out from the saved one, still only grow the grays, as before.

Expected behavior and authority

The reading was decided for this change: a neutral said with a light color as the surface color fills page, surface and card in light mode; dark keeps the ramp's dark shades; text is contrast-checked; a hue-only neutral stays a ramp re-seed. No current record governs how how reads neutral colors; this PR adds no record text.

Evidence

  • theme-how-roles-and-sides.test.mjs "fills the page, surfaces and cards in light mode; a darker one only grows the grays": "silver #c0c0c0 everywhere" writes the neutral and the three light-mode backgrounds; "slate grays" writes the neutral only; "lighter neutral" on a theme with a saved slate neutral writes no backgrounds; "a warmer neutral #f5f5dc" (a stated color with a comparative word) still fills them.

Changed answers

Every answer that changes across the full ask set (no errors; every other answer is the same), each the light-neutral reading, with the neutral-token-only alternative gone:

  • "luxury fashion brand: black and ivory, gold accent": page, surface and card take #fffff0 in light mode.
  • "elegant, airy boutique hotel theme: deep green and sand": page, surface and card take #d6c6a5 in light mode.

Scope

Components: CLI experimental theme editor (how neutral reading)

  • No new public API.
  • Public text and artifacts contain no internal Meta context.

Testing

vitest run --project node packages/cli/api/theme-edit (full directory).

replay: worse 0 at c96395d

preflight: pass c96395d (review deferred to batch: subagent cap)

@vercel

vercel Bot commented Nov 21, 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 Nov 21, 2026 8:10pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 21, 2026
@astracat-bot

astracat-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 8:17 PM UTC

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 40ff528

@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 light-neutral reading works for the typed colors in the changeset, but two answers it now gives are wrong.

  • After "slate grays" (which saves neutral '#64748b'), "lighter neutral" now offers no neutral line at all, because the new surface reading in _how-question.mjs also runs on the color the lighter/darker step computes and the editor then refuses the darker page; apply it only to a color the ask states, and add that case to the test.
  • The new inline note in _how-question.mjs checks the theme's text a second time and can tell the person to set --color-text-primary to #111827 while the next line, from the existing page-text check, sets it to #000000; drop the note and let the existing check own text readability.

Two smaller points. The new test case does not run its lines, although the file's header says every offered line is run. The changeset could also say that a light neutral no longer gets the token-only second line, and that mid-tone seeds such as #94a3b8 count as light.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Changeset: a light neutral such as silver or a near-white also fills the page, surface and card colors in light mode: verified by the new test and by runs of both example asks.
  • Changeset: dark mode keeps the generated dark shades: verified; after running the lines, dark body, surface and card stay #1b1b1b, #262626 and #1b1b1b.
  • Changeset: a darker neutral such as slate grays or warm neutrals still only grows the grays: verified; both answers match the base.
  • Description: at the base the silver ask leaves the app white: verified; the base answer only re-seeds, and the surface stays at shade 100 (#ffffff).
  • Description: the three backgrounds are set in light mode, in one sequence with the neutral line: verified (_how-question.mjs:28637-28650).
  • Description: the theme's text is measured on the new color, and a darker text color is named where it would not read: partly false; the existing page-text check does this, and the new note can name a different color (finding above).
  • Description: no current record governs this reading, and no record text is added: verified by a search of current records; an engineering owner approved this head.
  • Description: no new public API: verified; no command, option, export or command doc changes.
  • Description: no internal context in public text: verified.
  • Description: the new test covers the silver and slate-gray asks: verified; it passes at the head, and the same asks give the old answer at the base.
  • .changeset/experimental-theme-how-light-neutral-surfaces.md: clear ([experimental] patch); see the smaller point on what it leaves out.
  • packages/cli/api/theme-edit/_how-question.mjs: the two findings above.
  • packages/cli/api/theme-edit/theme-how-roles-and-sides.test.mjs: passes; it does not run its lines and has no lighter/darker case.

Automated review (maintainer link)

…e text check alone measures the text

[skip ci]
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec f87f1bc

@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 light-neutral reading is right for the asks the changeset names, and both findings from the last review are fixed, but one group of asks still contradicts its stated-color rule.

  • warmer neutral #f5f5dc, cooler neutral #f1f5f9, a softer neutral #f5f5f4 and make the neutral lighter: #f5f5f4 keep the old two-line answer, because the new gate in _how-question.mjs skips the surface reading for any clause with a comparative word instead of for a color worked out from the saved neutral, so warm neutral #f5f5dc fills the page while warmer neutral #f5f5dc does not; gate on the color's origin (color === given) and cover one of these asks in the new test, or say in the changeset that an ask with a comparative word keeps the old answer.

One smaller point: the test file's header says every line offered is run, but the new case only compares the command text — the four silver lines do run with exit 0, so await follow(silver.commands) would make the header true.

Claims and files checked

Review mode: incremental; reason: none

  • Changeset: a light neutral the ask states, one dark text reads on better than white, also fills the page, surface and card backgrounds in light mode — partly false: true for silver #c0c0c0 everywhere, neutral #f5f5f4, warm neutral #f5f5dc, cream #fffdd0 everywhere and the two example asks in the description, false for a stated color in a clause with a comparative word (finding above).
  • Changeset: dark mode keeps the dark shades the editor makes — verified; after running the silver lines, dark body, surface and card stay #1b1b1b, #262626 and #1b1b1b.
  • Changeset: that answer no longer offers the neutral token alone as a second choice — verified; the token-only line is gone from the filling answer and kept everywhere else.
  • Changeset: a darker neutral still only grows the grays — verified; slate grays and warm neutrals answer exactly as on the base.
  • Changeset: a lighter or darker neutral worked out from the saved one still only grows the grays — verified on saved #64748b and #d6c6a5, in both directions.
  • Description: at the base the silver ask leaves the app white — verified; the base answer only re-seeds the ramp.
  • Description: the three backgrounds are set in light mode, in one sequence with the neutral line — verified.
  • Description: the page text check measures the theme's text on the new page color and offers its own line — verified; on a theme with light text #374151, neutral #a0a0a0 gives one text line for primary and secondary.
  • Description: no current record governs how how reads neutral colors, and the pull request adds no record text — verified against the current records that mention the theme editor; an engineering owner approved this exact head.
  • Description: no new public API, and no internal context in public text — verified.
  • Description's changed answers (ivory #fffff0, sand #d6c6a5) — verified; both now fill the three light backgrounds.
  • .changeset/experimental-theme-how-light-neutral-surfaces.md: clear, except the stated-color wording above.
  • packages/cli/api/theme-edit/_how-question.mjs: the finding above.
  • packages/cli/api/theme-edit/theme-how-roles-and-sides.test.mjs: passes (14 of 14); the smaller point above, and no case covers a stated color with a comparative word.

Automated review (maintainer link)


describe('a light neutral', () => {
it('fills the page, surfaces and cards in light mode; a darker one only grows the grays', async () => {
const silver = (await how('q0', 'silver #c0c0c0 everywhere'))[0];

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 file's header says every line offered is run, but this case only compares the command text. The four silver lines do run with exit 0, so await follow(silver.commands) keeps the header true.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec c96395d

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

Approved: a stated light neutral now fills the light page, surfaces and cards whatever words come with it, and the finding from the last review is fixed.

One smaller point: the test file's header says every line offered is run, but the new case only compares the command text; the four silver lines do run with exit 0, so await follow(silver.commands) would make the header true.

The repository's build and test workflow does not run for pull requests into this branch.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Changeset: a stated light neutral that dark text reads on better than white also fills the page, surface and card backgrounds in light mode — verified for silver, neutral #f5f5f4, warm, warmer, cooler and softer neutrals with a stated color, cream, and both example asks in the description.
  • Changeset: dark mode keeps the dark shades the editor makes — verified; after running the silver lines, dark page, surface and card stay #1b1b1b, #262626 and #1b1b1b.
  • Changeset: that answer no longer offers the neutral token alone as a second choice — verified.
  • Changeset: a darker neutral, and a lighter or darker neutral worked out from the saved one, still only grow the grays — verified; slate grays, warm neutrals and lighter or darker steps from saved #64748b and #d6c6a5 answer exactly as before.
  • Description: before this change the silver ask leaves the app white — verified; the old answer only re-seeds the ramp and the light page stays #f0f0f0.
  • Description: the three backgrounds are set in light mode, in one sequence with the neutral line — verified.
  • Description: the page text check measures the theme's text on the new page color and offers its own line — verified with neutral #a0a0a0 on a theme with text #374151.
  • Description: no current record governs how how reads neutral colors, and no record text is added — verified; an engineering owner approved this exact head.
  • Description: the test covers silver, slate grays, a lighter neutral from a saved slate neutral and a warmer neutral with a stated color — verified; the last case fails without this change.
  • Description: the changed answers for ivory and sand — verified; the rest of that ask set is not in the repository, and the related tests' answers are unchanged.
  • Description: no new public API, and no internal context in public text — verified.
  • Description: tests pass across the theme-edit directory — the changed file and 12 related files pass; the full directory was not rerun.
  • .changeset/experimental-theme-how-light-neutral-surfaces.md: clear.
  • packages/cli/api/theme-edit/_how-question.mjs: clear.
  • packages/cli/api/theme-edit/theme-how-roles-and-sides.test.mjs: clear, apart from the header point above.

Automated review (maintainer link)

@josephfarina
josephfarina merged commit f383f7f into feature/theme-editor Nov 21, 2026
9 checks passed
josephfarina added a commit that referenced this pull request Nov 21, 2026
- #12787 experimental theme: a pressed or hovered part's flat tint is measured as the fill it is
- #13252 experimental theme: a one-color layer is a fill only where it covers the whole box
- #13300 experimental theme: a fill and its on-color set inside a part are measured as that part draws them
- #13321 experimental theme: a part's fill pair is measured though its on-color is set for the whole theme
- #13360 experimental theme: an on-color set on a part holding the readers leaves the fill pair out
- #12768 feat(cli): experimental theme editor show <theme> --on <part> gives what one part of a theme shows
- #13057 experimental theme pictures: sheet cells are never narrower than what they hold, and a panel over the page is drawn at its cell's full width
- #13200 experimental theme pictures: a change removes the pictures cut from a tall one
- #13199 experimental theme pictures: the pages section draws the sample app whole, cut between pages and named
- #13320 fix(cli): corners said before their edge run after it, so the whole answer does both
- #13375 experimental theme how: a clashing fill's text color goes in that fill's choice
- #13411 experimental theme how: a clash with a see-through fill joins its text too; another look's text leaves it joined
- #13420 fix(cli): experimental theme editor - glossy writes no sample gradient
- #13452 test(cli): the said-order test reads a named corner as that corner
- #13262 fix(cli): experimental theme editor - an ask that starts with clear the and names only removable looks takes them away
- #13450 fix(cli): experimental theme editor - a bar's text token is checked in the menus its items open
- #13442 feat(cli): a light neutral also fills the page, surface and card backgrounds in light mode
- #13477 docs(changeset): the clear reading takes looks away for one part
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed on main in #13470.

This branch was successfully deployed

1 active deployment
Preview — c96395d8 Deployed Nov 21, 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