Skip to content

experimental theme: a fill and its on-color set inside a part are measured as that part draws them - #13300

Merged
josephfarina merged 2 commits into
feature/theme-editorfrom
josephfarina/theme-a/01c2-scoped-fill-pair
Nov 21, 2026
Merged

josephfarina merged 2 commits into
feature/theme-editorfrom
josephfarina/theme-a/01c2-scoped-fill-pair

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Before: a white accent behind white header labels gave no warning.
  • After: it reports 1.00:1 with a fixing line; nothing is reported for a button, a link or a top nav item, for a see-through accent, or when the on-color is set on the app shell around it; the problem names the readers it found.
  • Regression test: theme-contrast-measures-whats-drawn.test.mjs (fill-pair case).

Scope

Components: theme editor (contrast checks)

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

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

… 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]
@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 11:57am UTC

Request Review

@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, 1:18 PM UTC

@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 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 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 dark a white --color-accent on app-shell-header reports 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 to theme-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 button as 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/cli tagged [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.

Automated review (maintainer link)

Comment on lines +12749 to +12754
data.settings.some(
y =>
y.source === 'token' &&
y.thing === pair.on &&
(y.on !== x.on || y.when || y.state),
)

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.

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

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 6d26230

@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: 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 dark a white --color-accent on app-shell-header reports 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 to theme-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 button as 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/cli tagged [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.

Automated review (maintainer link)

@josephfarina
josephfarina changed the base branch from josephfarina/theme-a/01b2-see-through-region to feature/theme-editor November 21, 2026 16:57
@josephfarina
josephfarina merged commit 9814ba4 into feature/theme-editor Nov 21, 2026
13 checks passed
josephfarina added a commit that referenced this pull request Nov 21, 2026
…r is set for the whole theme (#13321)

Reviewed pull request #13321, merged into the theme working branch with only its own changes (the layer below it, #13300, is already here). It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
…sured as that part draws them (#13300)

Reviewed pull request #13300, merged into the theme working branch with only its own changes (the layer below it, #13299, is already here). It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
…r is set for the whole theme (#13321)

Reviewed pull request #13321, merged into the theme working branch with only its own changes (the layer below it, #13300, is already here). It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
…sured as that part draws them (#13300)

Reviewed pull request #13300, merged into the theme working branch with only its own changes (the layer below it, #13299, is already here). It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
…r is set for the whole theme (#13321)

Reviewed pull request #13321, merged into the theme working branch with only its own changes (the layer below it, #13300, is already here). It reaches main with the branch's next landing.
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.

@github-actions
github-actions Bot deleted the josephfarina/theme-a/01c2-scoped-fill-pair branch November 22, 2026 06:04

This branch was successfully deployed

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