Skip to content

experimental theme: a text color on a row whose label is its own component's part reaches the tokens that l... - #12765

Closed
josephfarina wants to merge 1 commit into
mainfrom
josephfarina/editor-row-label-color
Closed

josephfarina wants to merge 1 commit into
mainfrom
josephfarina/editor-row-label-color

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

Stacked on the layer below it (base josephfarina/editor-how-mode-page-color); review only its own commit.

User impact

astryx experimental theme editor set … color <value> --on <part>: a text color on a part that draws no text itself, whose label is its own component's part drawn inside it (a select's option row, whose label is an item drawn as the select's option), now reaches the text tokens that label reads, so color #fff --on option-rows --state hover beside a dark fill gives every option row readable text. Content an app puts inside a part (a card's heading) keeps its own color.

Problem and solution fit

The theme editor is experimental. Each change is one behaviour of its set or how commands, with its own test, and touches nothing outside packages/cli/api/theme-edit.

Smallest restoration

  • .changeset/experimental-theme-row-label-color.md | 7 +++
  • packages/cli/api/theme-edit/_settings.mjs | 77 +++++++++++++++++++++++++++++----
  • packages/cli/api/theme-edit/theme-row-label-color.test.mjs | 78 ++++++++++++++++++++++++++++++++++

Evidence

Tests on this layer (CI=1, applied on its base in order):

  • packages/cli/api/theme-edit/theme-row-label-color.test.mjs

The whole packages/cli/api/theme-edit suite on the top of this stack fails only what its base fails in the same environment (app-copy and compile-check fixtures); eslint and prettier are clean on the changed files.

Scope

Components: theme editor (CLI, experimental)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

@vercel

vercel Bot commented Nov 19, 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 6:02am UTC

Request Review

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

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 21, 2026, 6:10 AM UTC

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

Approval waits on an engineering owner's decision, and two fixes are needed whatever that decision is.

No current spec record defines how astryx experimental theme editor set turns a color on a part into text tokens. An engineering owner needs to decide whether a text color on a part that draws no text itself (Selector's option row) should also write the text tokens its own component's parts read, a rule that as written also reaches Table and Markdown. They record the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

  • The reached token is written on the part's own rule, so everything inside inherits it: color … --on markdown now turns inline code (Core's Code, not a Markdown part) to the Markdown color, and color … --on table reaches app Text/Link with color="secondary" in cells, which contradicts the changeset's "Content an app puts inside a part … keeps its own color"; write the token only on the kept anatomy parts (or limit the branch to the option rows) and add Table and Markdown cases to the test.
  • The keep predicate's C.MAP[q]?.drawnAs clause never matches because no part record carries drawnAs, so item (the option's label) is never kept and color … --on selector-option-row writes only --color-text-primary, leaving an option's description and secondary icon gray on the new fill; record drawnAs in the census or keep the parts drawn on a kept part's element, and add an option-with-description case.
Claims and files checked

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

  • Claim: a text color on a part that draws no text itself now reaches the text tokens its label reads. Partly true: only the primary token is reached, so option descriptions are not.
  • Claim: color #fff --on option-rows --state hover gives every option row readable text. Verified for the option rows the editor draws: the new test fails before the change and passes after it, and no new contrast problem appears.
  • Claim: content an app puts inside a part keeps its own color. True for Card, false for Table and Markdown.
  • Claim: the change touches nothing outside the theme editor. Verified.
  • Claim: the new test covers this layer. Verified: it fails on the base and passes on the head.
  • Claim: the theme-edit suite fails only what its base fails. Checked on this head for the 43 affected test files, which show the same three failures on both sides. The stack top was not checked.
  • Claim: ESLint and Prettier are clean on the changed files. Verified.
  • Claim: no new public API. Verified.
  • File .changeset/experimental-theme-row-label-color.md: see the claims above.
  • File packages/cli/api/theme-edit/_settings.mjs: the two findings above.
  • File packages/cli/api/theme-edit/theme-row-label-color.test.mjs: covers only the Selector option row.

Automated review (maintainer link)

…onent's part reaches the tokens that label reads
@josephfarina
josephfarina force-pushed the josephfarina/editor-how-mode-page-color branch from 9bc7c0b to e4b1717 Compare November 21, 2026 05:44
@josephfarina
josephfarina force-pushed the josephfarina/editor-row-label-color branch from fbc19bb to 7ecab92 Compare November 21, 2026 05:44
@josephfarina
josephfarina changed the base branch from josephfarina/editor-how-mode-page-color to main November 21, 2026 05:44

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

Approval waits on an engineering owner's decision, and one fix is needed whatever that decision is.

No current spec record defines how astryx experimental theme editor set turns a color on a part into text tokens, so an engineering owner needs to decide whether a color on Selector's option row should also write --color-text-primary and --color-text-secondary on that row, which then reaches the option's label, its description and any renderOption content. They record the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

  • The description and the release note misstate this head: the description names a stacked base the pull request no longer has and a three-file list that leaves out packages/cli/api/theme-edit/_parts.mjs, and the changeset (like the comments in _parts.mjs, _settings.mjs and the new test) says the option row is drawn as an Item, when the Item is drawn as the option inside the row.

Both earlier findings are fixed (Table and Markdown keep their output, and option descriptions now follow the color); separately, the Table/Markdown test should assert that neither text token is written there, not only the secondary one.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: a text color on a listed row whose label is its own component's part now reaches the tokens that label reads. Verified: the option-row test fails before the change and passes after it.
  • Claim: the option's label and description are the Item the row is drawn as. False: the Item is drawn as the option inside the row.
  • Claim: a dark hover fill on the option rows now gets readable text, descriptions included. Verified: with the pointer on a row's padding the label is black before the change and white after it, and the row's rule sets both text tokens.
  • Claim: a table, card or markdown block keeps the color on itself. Verified: across every part the editor knows, only the Selector option row changes.
  • Claim: an experimental patch release note. Verified.
  • Claim: the pull request is stacked on another branch and only its own commit is reviewed. False: it targets main.
  • Claim: only the theme editor changes, with its own test. Verified.
  • Claim: the changed files are a release note, the settings module and the test. False: four files change, including the census module.
  • Claim: the new test file covers this change. Verified.
  • Claim: the theme-edit suite fails only what its base fails. Not checkable as stated, since no stack exists; the 29 affected test files give the same results before and after the change.
  • Claim: ESLint and Prettier are clean on the changed files. Verified.
  • Claim: one defect is restored, with no hidden public API. No public API is added; no current spec defines the behavior restored, which is the owner decision above.
  • Claim: no internal context in public text. Verified.
  • File .changeset/experimental-theme-row-label-color.md: the Item wording above.
  • File packages/cli/api/theme-edit/_parts.mjs: records the parts drawn on one element correctly; its comment repeats the Item wording.
  • File packages/cli/api/theme-edit/_settings.mjs: the owner decision above; its comment repeats the Item wording.
  • File packages/cli/api/theme-edit/theme-row-label-color.test.mjs: covers the option row and the Table/Markdown case; the guard checks one token.

Automated review (maintainer link)

'@astryxdesign/cli': patch
---

[experimental] `astryx experimental theme editor set … color <value> --on <part>`: a text color on a row drawn more than once inside another part that draws no text itself, whose label is its own component's part drawn inside it (a select's option row, whose label and description are the Item the row is drawn as), now reaches the text tokens that label reads, so `color #fff --on option-rows --state hover` beside a dark fill gives every option row readable text, its description included. A part that is no such row (a table, a card, a markdown block) keeps the color on itself, so content an app puts inside it keeps its own 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.

"whose label and description are the Item the row is drawn as": the row is not drawn as an Item. SelectorOption renders the Item with the selector-option class inside the row's content span (SelectorOption.tsx:130-142), and the census records selector-option as drawn as item while selector-option-row has no drawnAs. Suggest "whose label and description are the Item its option is drawn as", and the same fix in the _parts.mjs drawnAs JSDoc, the colorTokensReached comment and the test's comment.

css.match(new RegExp(`\\.astryx-${p}\\b[^{]*\\{[^}]*\\}`, 'g')) ?? []
).join('\n'),
p,
).not.toMatch(/--color-text-secondary: #123456/);

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.

Non-blocking: this guard checks only --color-text-secondary, but the earlier version of this rule leaked --color-text-primary onto Markdown, so the test would still pass if that came back. Asserting that neither text token is written on table or markdown (for example /--color-text-(primary|secondary): #123456/) covers both.

@josephfarina

Copy link
Copy Markdown
Contributor Author

Replaced by a new pull request off main with this one's review findings fixed (one function each, so no trimmed part to land on its own).

This branch was successfully deployed

1 active deployment
Preview — 7ecab929 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