Repository navigation
experimental theme how: a clashing fill's text color goes in that fill's choice - #13375
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 about the new answer rule, and one fix is needed either way.
No current spec record defines what astryx experimental theme editor how answers, so an engineering owner needs to approve this rule or name the record that governs it: when two fills said for one part clash and the first fill leaves the part's text under 4.5:1, its readable text color becomes part of that fill's choice and no separate "readable text on that fill" line is offered. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.
Blocking finding:
- The changeset (
.changeset/experimental-theme-how-clash-fill-text.md:5) and the title say a clashing fill's readable text color is now part of that fill's choice, but only the first fill said is measured (_how-question.mjs:32194), sopressed checkboxes: a #eeeeee fill and a #0069d6 fillgives the #0069d6 choice no#fffffftext while the #eeeeee choice gets#000000; measure each fill and add a row for the reversed ask, or say "the first fill said" in the changeset, title and description.
Also worth a look (non-blocking): the choice still says "pick one" but now prints three command lines for two choices, and only the prose ties the color line to the first fill; printing a choice's option as one && line, as a sequence is printed, would keep one line per choice.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Changeset: the readable text color for a clashing fill is now part of that fill's choice. True for the first fill said; false for a fill said second (blocking finding).
- Changeset: no separate line writes text for a fill the person has not picked. Verified (base and head answers for the description's ask).
- Changeset: a patch bump with an experimental note. Verified (the changeset check passes).
- Title: a clashing fill's text color goes in that fill's choice. Same as the first changeset claim.
- Description: before, the choice was followed by separate white-text lines for checked indeterminate in dark mode and checked in light mode. Verified on the base.
- Description: after, the first option writes the fill and the white text together, with no separate text line. Verified.
- Description: the measured text color is the same; only where it is offered changes. Verified (same colors on base and head for six asks).
- Description: outside a choice, the separate line stays. Verified (a primary button fill asked alone).
- Description: one branch in the readable-text step; no setting, command or flag changes. Verified.
- Description: the new row fails on the base and passes here. Verified.
- Description: the four how test files pass, 904 of 904. Verified; every other theme-how and theme-readers test file also passes.
- Description: every line of a how answer writes something the ask asked for, as the authority. No current record states this; it waits on the owner decision above.
- File
.changeset/experimental-theme-how-clash-fill-text.md: blocking finding (its claim is broader than the change). - File
packages/cli/api/theme-edit/_how-question.mjs: correct for the first fill; the blocking finding (a fill said second is not measured) and the non-blocking "pick one" note. - File
packages/cli/api/theme-edit/theme-how-long-ask-binding.test.mjs: clear; it covers the first-fill order only.
1d16fb5 to
1203316
Compare
|
/approve-spec 1203316 |
…l's choice [skip ci]
1203316 to
53aae88
Compare
|
/approve-spec 53aae88 |
There was a problem hiding this comment.
Changes requested: the rule itself is approved for this head, but the release note promises it for more asks than the code covers.
- The changeset (
.changeset/experimental-theme-how-clash-fill-text.md:5) says each clashing fill's text color goes in that fill's own choice, butsaidText(packages/cli/api/theme-edit/_how-question.mjs:32162-32167) turns that off whenever the ask colors the part's text in any look, soprimary buttons #0000ff, primary buttons #ffff00, secondary buttons white textstill prints a free-standingcolor '#ffffff'line and gives the #ffff00 choice no text color: narrow the note and title to asks that give that part no text color, or compare said text with the fill's own look and add a row for such an ask.
A plain clash now works in either order, one line per choice, and the two earlier inline points are fixed.
Claims and files checked
Review mode: full; reason: history
- Changeset: a clash measures each fill in either order, puts its text in its own choice and prints one line per choice — false for asks that also color that part's text in any look (the base answer comes back); true otherwise (answers compared on the base and the head).
- Before, the choice is followed by a separate white-text line for the blue fill in each checked state — verified on the base.
- After, each fill's line joins its text with
&&, the light-gray indeterminate line gets black text, no separate line is left, and the reversed ask gives the same pairs — verified on the head. - The rule applies only to a clash whose fills differ and whose ask does not color that part's text — verified (
_how-question.mjs:32199-32204). - Any other answer (a fill on each variant, a fill outside a choice) is measured as before — verified: identical answers on the base and the head.
- No new reading; the measured text color is the same, only where it is offered changes — verified: the measurement code is unchanged apart from indentation.
- Every line of a how answer writes something the ask asked for — false for the asks above.
- One branch in the readable-text step, with no setting, command or flag change — verified, plus one printing branch in
_how.mjs:1115-1120. - The new test file and binding row fail on the base and pass here — verified (3 fail on the base).
- The four how test files plus the new file pass, 906 of 906 — verified.
- Scope checklist: one defect, no tagalong, no new public API, no internal context — verified.
.changeset/experimental-theme-how-clash-fill-text.md: finding (line 5).packages/cli/api/theme-edit/_how-question.mjs: finding (saidTextkeyed by part only); the rest clear.packages/cli/api/theme-edit/_how.mjs: clear.packages/cli/api/theme-edit/theme-how-clash-fill-text.test.mjs: clear; no case for an ask that also colors the part's text.packages/cli/api/theme-edit/theme-how-long-ask-binding.test.mjs: clear.
| '@astryxdesign/cli': patch | ||
| --- | ||
|
|
||
| [experimental] `astryx experimental theme editor how`: when two fills said for one part clash ("pressed checkboxes: a #0069d6 fill and a #eeeeee fill"), each fill is measured, in either order, and the text color that keeps it readable goes in that fill's own choice. Each choice prints as one command line holding the fill and its text, so no line writes text for a fill the person has not picked. |
There was a problem hiding this comment.
This holds only while the ask colors none of that part's text: saidText keeps the part alone, so primary buttons #0000ff, primary buttons #ffff00, secondary buttons white text (or the checkbox ask plus disabled checkboxes: gray text) gets the base answer, a free-standing color '#ffffff' line for the first fill and no text for the second. Say "when the ask gives that part no text color" here and in the title, or narrow the check below.
| const saidText = new Set( | ||
| result | ||
| .flatMap(x => x.options.flat()) | ||
| .filter(y => y.thing === 'color' && y.on) | ||
| .map(y => String(y.on)), | ||
| ); |
There was a problem hiding this comment.
Keyed by part only, so a text color said for another look (secondary buttons white text, disabled checkboxes: gray text) turns the clash rule off for the clashing look too. Comparing with the fill's own look (same on, and the same state/when, or a said text with neither) keeps an unrelated clause from changing the choice; a row for such an ask would hold it.
- #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
|
Landed on main in #13470. |
Size: one finding, not split. Most of the 389 changed lines are indentation: the measuring block now runs once per fill of a clash. Ignoring whitespace (
git diff -w), it is 139 added and 3 removed lines, and 79 of the added lines are the new test file.User impact
In
astryx experimental theme editor how, two fills said for one part ("pressed checkboxes: a #0069d6 fill and a #eeeeee fill") are offered as a choice. Beside the choice, a separate "readable text on that fill" line wrote white text for the #0069d6 fill. Running that line on its own (for checked indeterminate,color '#ffffff' … --mode dark --only) wrote text for a fill the person had not picked, which pairs with nothing.Problem and solution fit
The text line belongs to the fill it reads on. In a choice between fills, each fill is now measured, whichever is said first, and its text color joins that fill's option. Each option prints as one command line (
set … background-color … && set … color …), so a line is one whole choice: picking #0069d6 runs the fill and its text together, and nothing writes text for a fill not picked. This applies only to a clash: the choice's fills differ and the ask does not color that part's text itself ("disabled buttons: gray text, …" keeps its own text). Any other answer, a fill on each variant ("make the badges green") or a fill outside a choice, is measured as before.Decision
No new reading. The measured text color is the same; only where it is offered changes.
Expected behavior and authority
Every line of a how answer writes something the ask asked for. The clash choice rows in
theme-how-long-ask-binding.test.mjscover it.Smallest restoration
One branch in the readable-text step for a choice between fills. No setting, command or flag changes.
Evidence
color '#ffffff' --on checkbox-indicator --when checked:indeterminate --mode dark --only, and the same for checked in light mode.background-color '#0069d6' … && … color '#ffffff' …. For checked indeterminate, the #eeeeee line also gets its#000000text. No separate text line is left. The reversed ask ("a #eeeeee fill and a #0069d6 fill") gives the same pairs.theme-how-clash-fill-text.test.mjschecks the commands for both orders, and the binding row checks the text. Both fail on the base and pass here.Scope
Testing
CI=1 vitest run --project nodeon the four how test files (binding, every-clause, how, non-asks): 906/906 pass (with the new test file).replay: worse 0 at 53aae88
preflight: pass 53aae88 (CI half pass; review findings are the paired fix's: #13411)