Repository navigation
experimental theme: a text color on a row whose label is its own component's part reaches the tokens that l... - #12765
josephfarina wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
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 markdownnow turns inlinecode(Core'sCode, not a Markdown part) to the Markdown color, andcolor … --on tablereaches appText/Linkwithcolor="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]?.drawnAsclause never matches because no part record carriesdrawnAs, soitem(the option's label) is never kept andcolor … --on selector-option-rowwrites only--color-text-primary, leaving an option's description and secondary icon gray on the new fill; recorddrawnAsin 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 hovergives 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.
…onent's part reaches the tokens that label reads
9bc7c0b to
e4b1717
Compare
fbc19bb to
7ecab92
Compare
There was a problem hiding this comment.
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.mjsand 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.
| '@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. |
There was a problem hiding this comment.
"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/); |
There was a problem hiding this comment.
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.
|
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). |
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, socolor #fff --on option-rows --state hoverbeside 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
setorhowcommands, with its own test, and touches nothing outsidepackages/cli/api/theme-edit.Smallest restoration
Evidence
Tests on this layer (CI=1, applied on its base in order):
packages/cli/api/theme-edit/theme-row-label-color.test.mjsThe whole
packages/cli/api/theme-editsuite 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)