Repository navigation
experimental theme: a fill and its on-color set inside a part are measured as that part draws them - #13300
Conversation
… region as drawn Text in a region (a top nav item in the top bar) was measured on the region's color taken as solid, whatever its alpha. A translucent bar shows the page through it, so a problem was named that is never drawn, or a real one missed. The region is now blended onto the page first. A surface Core draws in its own scheme (a lightbox, over its media and a blurred page) keeps its own color as the ground. A part also drawn on the page keeps its page measurement. [skip ci]
…sured as that part draws them A color token set on one part (a white accent on the top bar) changes what the parts inside it draw: a primary button there is white with the on-accent text on it. The pair was never measured in that scope. It is now, in each mode it is set for, with a fixing line for the on-color on the same part. [skip ci]
|
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 what the experimental theme editor's contrast checks measure, and one defect needs fixing either way.
No current spec defines this check, so an engineering owner needs to approve this reading, or name the spec that governs it, by commenting /approve-spec <full head SHA> on this pull request (the author may, as an engineering owner): a fill token set on one part is paired with its on-color inside that part, in each mode it is set for, and reported below 4.5:1 with a fix line that sets the on-color on that part, only for a part that holds a reader of the on-color and never for a see-through fill.
Blocking, whatever the owner decides:
- The skip in
packages/cli/api/theme-edit/_settings.mjs(lines 12749-12754) drops the pair whenever the on-color is set for the whole theme or on an unrelated part, so after--color-on-accent '#111111' --mode darka white--color-accentonapp-shell-headerreports nothing while its primary Buttons draw white on white; skip only for a variant or state setting, a part around this one, or one of its readers, and add the whole-theme and unrelated-part cases totheme-contrast-measures-whats-drawn.test.mjs.
Non-blocking: a setting on a group (--on containers) is stored but not measured, and expanding the part with partsOf would cover each member.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- Title and release note: a fill and its on-color set inside a part are measured as that part draws them, with a fixing line. Partly false: verified for the top bar and a dialog (
_settings.mjs:12696-12802, test lines 123-151), but nothing is measured once the on-color is set for the whole theme or on another part (blocking finding). - A color token set on one part changes what the parts inside it draw, such as a primary button. Verified: the problem names
buttonas the reader. - The pair was never measured in that scope. Verified: the new test fails on the base at line 137 and passes on this head.
- It is measured in each mode it is set for, with a fix line for the on-color on the same part. Verified: test lines 138-151; following the fix clears the line.
- Only a part that holds a reader is measured; a part that reads the on-color itself is left to the text pairs; a link holds no reader. Verified: test lines 154-163; on a button the existing text pair reports 1:1.
- It is measured only where the theme sets the on-color on no other part (around it, a reader inside it, or one variant), since the readers then draw the color set there. False as implemented: the skip also fires for a whole-theme on-color and for unrelated parts, where the readers do not draw that color (blocking finding).
- A see-through fill is left out. Verified:
_settings.mjs:12785, test lines 180-188. - Before, a white accent behind white header labels gave no warning; after, it reports 1.00:1 with a fix line and names its readers, and nothing is reported for a button, a link, a top nav item, a see-through accent, or an on-color set on the app shell around it. Verified by the test and by reproduction.
- The regression test is the fill-pair case in
theme-contrast-measures-whats-drawn.test.mjs. Verified. - One defect is restored. Not a restoration: the base never measured this pair and no spec requires it (owner decision above).
- No new public API, default or interaction model, and no internal context. Verified: no command, option, export or result field changes.
- The touched tests, the theme-editor tests, the CLI strict typecheck and eslint were run. Consistent: the touched test, the theme-editor tests that read problem lists, eslint on both changed files and the strict typecheck pass on this head.
Files:
.changeset/experimental-theme-contrast-scoped-fill-pair.md: a patch for@astryxdesign/clitagged[experimental], as the release rules require; its claim holds once the blocking finding is fixed.packages/cli/api/theme-edit/_settings.mjs: blocking finding (on-color skip, lines 12749-12754); non-blocking group note.packages/cli/api/theme-edit/theme-contrast-measures-whats-drawn.test.mjs: clear; it lacks the whole-theme and unrelated-part cases the fix needs.
| data.settings.some( | ||
| y => | ||
| y.source === 'token' && | ||
| y.thing === pair.on && | ||
| (y.on !== x.on || y.when || y.state), | ||
| ) |
There was a problem hiding this comment.
This skips the pair for any other setting of the on-color. A whole-theme setting has no on, so y.on !== x.on is always true for it, and a setting on an unrelated part (say card) matches too; neither reaches this part's readers the way the skip assumes. With --color-on-accent '#111111' --mode dark set for the whole theme, --color-accent '#ffffff' --on app-shell-header --mode light reports nothing while the top bar's primary Buttons draw white on white. Skip only for a variant or state setting, a part that encloses x.on, or one of readers, and let whole-theme settings through (inScope already resolves them through res).
|
/approve-spec 6d26230 |
There was a problem hiding this comment.
Changes requested: one defect in the new scoped fill-pair contrast check. An engineering owner has approved the reading this check implements, so the fix below is what remains.
- The skip in
packages/cli/api/theme-edit/_settings.mjs(lines 12749-12754) drops the pair whenever the on-color is set for the whole theme or on an unrelated part, so after--color-on-accent '#111111' --mode darka white--color-accentonapp-shell-headerreports nothing while its primary Buttons draw white on white; skip only for a variant or state setting, a part around this one, or one of its readers, and add the whole-theme and unrelated-part cases totheme-contrast-measures-whats-drawn.test.mjs.
#13321 proposes this fix; once it is on this branch, the new head can be reviewed. Non-blocking: a setting on a group (--on containers) is stored but not measured, and expanding the part with partsOf would cover each member.
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Title and release note: a fill and its on-color set inside a part are measured as that part draws them, with a fixing line. Partly false: it holds for the top bar and a dialog (
_settings.mjs:12696-12802, test lines 123-191), but nothing is measured once the on-color is set for the whole theme or on another part (blocking finding). - A color token set on one part changes what the parts inside it draw, such as a primary button. Verified: the problem line names
buttonas the reader. - The pair was never measured in that scope. Verified: the new test fails on the base at line 137 and passes on this head.
- It is measured in each mode it is set for, with a fix line for the on-color on the same part. Verified: test lines 137-151; following the fix clears the line.
- Only a part that holds a reader is measured; a part that reads the on-color itself is left to the text pairs; a link holds no reader. Verified: test lines 152-163.
- It is measured only where the theme sets the on-color on no other part (around it, a reader inside it, or one variant). False as implemented: the skip also fires for a whole-theme on-color and for unrelated parts (blocking finding); the part-around case is verified at test lines 164-178.
- A see-through fill is left out. Verified:
_settings.mjs:12785, test lines 179-188. - Before, a white accent behind white header labels gave no warning; after, it reports 1.00:1 with a fix line and names its readers. Verified by the test and by reproduction.
- The regression test is the fill-pair case in
theme-contrast-measures-whats-drawn.test.mjs. Verified. - One defect is fixed, with no new public API, default or interaction model and no internal context. Verified: the base's silence is the gap the approved reading names, and no command, option, export or result field changes.
- The touched tests, the theme-editor tests, the CLI strict typecheck and eslint pass. Consistent: they pass on this head.
- The review findings are handled in a paired pull request. Verified as stated: #13321 proposes the fix, but it is not part of this head.
Files:
.changeset/experimental-theme-contrast-scoped-fill-pair.md: a patch for@astryxdesign/clitagged[experimental], as the release rules require; its claim holds once the blocking finding is fixed.packages/cli/api/theme-edit/_settings.mjs: blocking finding (on-color skip, lines 12749-12754); non-blocking group note.packages/cli/api/theme-edit/theme-contrast-measures-whats-drawn.test.mjs: clear; it lacks the whole-theme and unrelated-part cases the fix needs.
- #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. |
User impact
A fill and its on-color set inside one part (a white accent on the top bar) are checked as that part's buttons and badges draw them, with a fixing line.
Problem and solution fit
A color token set on one part changes what the parts inside it draw: a primary button there is white with the on-accent text on it. The pair was never measured in that scope. It is now, in each mode it is set for, with a fixing line for the on-color on the same part. Only a part that holds a part reading the on-color is measured (a part that reads it itself is the text pairs' to measure; a link or a progress bar holds no reader), and only where the theme sets that on-color on no other part (one around it, a reader inside it, or one variant), since then the readers draw the color set there. A see-through fill is left out: what shows under it is the part, not one known color.
Evidence
theme-contrast-measures-whats-drawn.test.mjs(fill-pair case).Scope
Components: theme editor (contrast checks)
Testing
The touched tests, the stack's theme-editor tests, the CLI strict typecheck and eslint, on this layer's tree.
Gate
preflight: pass 6d26230 (CI half pass; review findings are the paired fix's: #13321)
replay: worse 0 at 6d26230