Skip to content

experimental theme contrast: text is measured on the fill it is drawn on, a state Core paints once mounted included - #12775

Closed
josephfarina wants to merge 1 commit into
c/how-border-state-offers-2from
c/contrast-selected-row
Closed

josephfarina wants to merge 1 commit into
c/how-border-state-offers-2from
c/contrast-selected-row

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

User impact

The editor's contrast check missed text drawn on a fill Core paints only once a component mounts (a selected table row) and measured screen-reader-only labels as if they were visible. Themes passed the check yet showed secondary text under 4.5:1 on a selected row.

Problem and solution fit

Found while checking official themes in dark mode: secondary text on a selected row read at 3.5:1. The general rule: text is measured on the fill it is drawn on, including a state Core paints once mounted; text for screen readers alone is never measured.

Expected behavior and authority

The theme contrast check measures every visible text pair; covered by theme-contrast-selected-row.test.mjs.

Smallest restoration

The census renders the open scenes mounted and adds only their new text pairs; inline backgrounds on a part's own element count as its ground; reader-only frames add no pair.

Evidence

  • Before: no problem reported for secondary text on a selected row.
  • After: the pair is named with its ratio.
  • Unchanged: row dividers and table states read as before.
  • Regression test: theme-contrast-selected-row.test.mjs, with updates to three existing tests.

Scope

Components: cli (experimental theme editor how)

  • 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

CI=1 vitest run --project node packages/cli/api/theme-edit packages/cli/api/theme packages/cli/clients/cli/commands/experimental on the stack top: no failure the base does not have. The CLI typechecks, changeset check and lint pass. This is a layer of a stack on the round-15 theme editor stack; it stays a draft until the layer below lands.

@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 19, 2026 5:51am UTC

Request Review

@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 19, 2026, 5:48 AM UTC

@josephfarina
josephfarina force-pushed the c/contrast-selected-row branch from c8570a3 to 788fe69 Compare November 19, 2026 01:25
@josephfarina
josephfarina force-pushed the c/how-border-state-offers branch from d368c17 to c2469d5 Compare November 19, 2026 01:25
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 19, 2026
@josephfarina
josephfarina force-pushed the c/contrast-selected-row branch from 788fe69 to 8fca148 Compare November 19, 2026 01:40
@josephfarina
josephfarina force-pushed the c/how-border-state-offers branch from c2469d5 to 5bd6257 Compare November 19, 2026 01:40
@josephfarina
josephfarina force-pushed the c/contrast-selected-row branch from 8fca148 to b00463b Compare November 19, 2026 01:43
@josephfarina
josephfarina force-pushed the c/how-border-state-offers branch from 5bd6257 to 0a555b4 Compare November 19, 2026 01:43

@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. No current spec record says what the experimental theme editor's contrast check measures, so its new rules (drawing the open scenes Core finishes on mount, counting a part's own inline color or background as its ground, and skipping screen-reader-only text) need an owner decision: an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

Blocking finding:

  • The open Table scene's Name column renders one fixed tree (packages/cli/api/theme-edit/_catalog.mjs:295-306), so in the editor's overlays picture every row, Alice's and Charlie's included, reads "Bob / Design team"; let the render prop read each row.

The new census pairs are well covered: the new test and the changed assertions fail on the base and pass on this head. A failed mounted render is swallowed (_parts.mjs:1039), so consider letting it surface the way a failed main census does.

Claims and files checked

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

Claims:

  • Changeset: the contrast check measures text on the fill it is drawn on, including states Core paints once a part mounts, such as a selected table row: verified (new test; base and head problem lists).
  • Changeset: text only screen readers get is no longer measured: verified (a checkbox list row's hidden label leaves the census; the new test checks the selection checkbox label).
  • Description: the check missed text on a fill Core paints after mount and measured screen-reader-only labels: verified (the base census has no selected-row pair and has the hidden label pair).
  • Description: themes passed the check while secondary text on a selected row read under 4.5:1: verified (a gothic-based theme with a blue accent reads 3.5:1 on the head and reports nothing on the base).
  • Description: found on official themes in dark mode at 3.5:1: consistent; 3.5:1 measured on a gothic-based theme with a changed accent, since the editor lists only problems a theme adds over its base.
  • Description: the check measures every visible text pair: verified for the pairs the census draws (catalog, sample page and the two mounted scenes).
  • Description: mounted scenes add only new pairs, a part's own inline background counts, reader-only elements add none: verified (_parts.mjs:1014-1055, :1694-1709, :1548-1561).
  • Description: before, no problem for secondary text on a selected row; after, the pair is named with its ratio: verified.
  • Description: row dividers and table states read as before: verified (the table states test passes on base and head; the census is otherwise unchanged).
  • Description: one regression test with updates to three existing tests: verified for test bodies; three test bodies change, and a fourth file changes a shared helper.
  • Description: the node test run shows no failure the base lacks: partly verified; the five changed files pass on this head, and the full suites were not run here.
  • Description: the CLI typechecks: false at this head; the strict typecheck reports an undefined name in a file this pull request does not change, and the base fails the same way.
  • Description: the changeset check and lint pass: verified (changeset check; lint of the changed files shows no errors).
  • Description: stays a draft until the layer below lands: verified.
  • Description: no new public API, default or interaction model under the fix label: verified (no command, option or field changes).
  • Description: public text has no internal context: verified.

Files:

  • .changeset/experimental-theme-contrast-selected-row.md: clear.
  • packages/cli/api/theme-edit/_catalog.mjs: blocking (every row named Bob).
  • packages/cli/api/theme-edit/_parts.mjs: waits on the owner decision; one non-blocking note (silent mounted-render failure).
  • packages/cli/api/theme-edit/theme-contrast-selected-row.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-problems-change-lead-result.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-regrown-look-keeps-card-text.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-table-states.test.mjs: clear.
  • packages/cli/clients/cli/commands/experimental-theme-show-text.test.mjs: clear.

Automated review (maintainer link)

key: 'name',
header: 'Name',
sortable: true,
renderCell: {

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 renderCell is one fixed tree, and rendered() turns it into () => el(v.__render), so Core draws the same cell for every row: Alice and Charlie also read "Bob / Design team" in the overlays picture. Let the render prop read the row (for example row => el(v.__render, row) with a leaf that reads row.name).

[],
{openLayers: true},
));
} catch {

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: a failed mounted render returns silently, so the census loses its selected-row pairs and reports nothing. A failed main census marks the theme unchecked with a reason; consider the same path here.

@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. No current spec record says what the experimental theme editor's contrast check measures, so its new rules (drawing the open scenes Core finishes on mount, counting a part's own inline color or background as its ground, and skipping screen-reader-only text) need an owner decision: an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

Blocking finding:

  • The open Table scene's Name column renders one fixed tree (packages/cli/api/theme-edit/_catalog.mjs:295-306), so in the editor's overlays picture every row, Alice's and Charlie's included, reads "Bob / Design team"; let the render prop read each row.

The new census pairs are well covered: the new test and the changed assertions fail on the base and pass on this head. A failed mounted render is swallowed (_parts.mjs:1039), so consider letting it surface the way a failed main census does.

Claims and files checked

Review mode: carry-forward; reason: none

Claims:

  • Changeset: the contrast check measures text on the fill it is drawn on, including states Core paints once a part mounts, such as a selected table row: verified (new test; base and head problem lists).
  • Changeset: text only screen readers get is no longer measured: verified (a checkbox list row's hidden label leaves the census; the new test checks the selection checkbox label).
  • Description: the check missed text on a fill Core paints after mount and measured screen-reader-only labels: verified (the base census has no selected-row pair and has the hidden label pair).
  • Description: themes passed the check while secondary text on a selected row read under 4.5:1: verified (a gothic-based theme with a blue accent reads 3.5:1 on the head and reports nothing on the base).
  • Description: found on official themes in dark mode at 3.5:1: consistent; 3.5:1 measured on a gothic-based theme with a changed accent, since the editor lists only problems a theme adds over its base.
  • Description: the check measures every visible text pair: verified for the pairs the census draws (catalog, sample page and the two mounted scenes).
  • Description: mounted scenes add only new pairs, a part's own inline background counts, reader-only elements add none: verified (_parts.mjs:1014-1055, :1694-1709, :1548-1561).
  • Description: before, no problem for secondary text on a selected row; after, the pair is named with its ratio: verified.
  • Description: row dividers and table states read as before: verified (the table states test passes on base and head; the census is otherwise unchanged).
  • Description: one regression test with updates to three existing tests: verified for test bodies; three test bodies change, and a fourth file changes a shared helper.
  • Description: the node test run shows no failure the base lacks: partly verified; the five changed files pass on this head (21 of 21), and the full suites were not run here.
  • Description: the CLI typechecks: verified at this head (template-docs and strict typechecks pass).
  • Description: the changeset check and lint pass: verified (changeset check; lint of the changed files shows no errors).
  • Description: stays a draft until the layer below lands: verified.
  • Description: no new public API, default or interaction model under the fix label: verified (no command, option or field changes).
  • Description: public text has no internal context: verified.

Files:

  • .changeset/experimental-theme-contrast-selected-row.md: clear.
  • packages/cli/api/theme-edit/_catalog.mjs: blocking (every row named Bob).
  • packages/cli/api/theme-edit/_parts.mjs: waits on the owner decision; one non-blocking note (silent mounted-render failure).
  • packages/cli/api/theme-edit/theme-contrast-selected-row.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-problems-change-lead-result.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-regrown-look-keeps-card-text.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-table-states.test.mjs: clear.
  • packages/cli/clients/cli/commands/experimental-theme-show-text.test.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the c/how-border-state-offers branch from 335a24e to cba7b36 Compare November 19, 2026 03:54
@josephfarina
josephfarina force-pushed the c/contrast-selected-row branch from 5e53665 to 13d1a98 Compare November 19, 2026 03:54

@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. No current spec record says what the experimental theme editor's contrast check measures, so its new rules (drawing the open scenes Core finishes on mount, counting a part's own inline color or background as its ground, and skipping screen-reader-only text) need an owner decision: an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

Blocking finding:

  • The open Table scene's Name column renders one fixed tree (packages/cli/api/theme-edit/_catalog.mjs:295-306), so in the editor's overlays picture every row, Alice's and Charlie's included, reads "Bob / Design team"; let the render prop read each row.

The new census pairs are well covered: the new test and the changed assertions fail on the base and pass on this head. A failed mounted render is swallowed (_parts.mjs:1039), so consider letting it surface the way a failed main census does.

Claims and files checked

Review mode: carry-forward; reason: none

Claims:

  • Changeset: the contrast check measures text on the fill it is drawn on, including states Core paints once a part mounts, such as a selected table row: verified (new test; base and head problem lists).
  • Changeset: text only screen readers get is no longer measured: verified (a checkbox list row's hidden label leaves the census; the new test checks the selection checkbox label).
  • Description: the check missed text on a fill Core paints after mount and measured screen-reader-only labels: verified (the base census has no selected-row pair and has the hidden label pair).
  • Description: themes passed the check while secondary text on a selected row read under 4.5:1: verified (a gothic-based theme with a blue accent reads 3.5:1 on the head and reports nothing on the base).
  • Description: found on official themes in dark mode at 3.5:1: consistent; 3.5:1 measured on a gothic-based theme with a changed accent, since the editor lists only problems a theme adds over its base.
  • Description: the check measures every visible text pair: verified for the pairs the census draws (catalog, sample page and the two mounted scenes).
  • Description: mounted scenes add only new pairs, a part's own inline background counts, reader-only elements add none: verified (_parts.mjs:1014-1055, :1694-1709, :1548-1561).
  • Description: before, no problem for secondary text on a selected row; after, the pair is named with its ratio: verified.
  • Description: row dividers and table states read as before: verified (the table states test passes on base and head; the census is otherwise unchanged).
  • Description: one regression test with updates to three existing tests: verified for test bodies; three test bodies change, and a fourth file changes a shared helper.
  • Description: the node test run shows no failure the base lacks: partly verified; the five changed files pass on this head (21 of 21), and the full suites were not run here.
  • Description: the CLI typechecks: verified at this head (template-docs and strict typechecks pass).
  • Description: the changeset check and lint pass: verified at this head (changeset check passes; lint of the changed files reports nothing).
  • Description: stays a draft until the layer below lands: verified.
  • Description: no new public API, default or interaction model under the fix label: verified (no command, option or field changes).
  • Description: public text has no internal context: verified.

Files:

  • .changeset/experimental-theme-contrast-selected-row.md: clear.
  • packages/cli/api/theme-edit/_catalog.mjs: blocking (every row named Bob).
  • packages/cli/api/theme-edit/_parts.mjs: waits on the owner decision; one non-blocking note (silent mounted-render failure).
  • packages/cli/api/theme-edit/theme-contrast-selected-row.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-problems-change-lead-result.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-regrown-look-keeps-card-text.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-table-states.test.mjs: clear.
  • packages/cli/clients/cli/commands/experimental-theme-show-text.test.mjs: clear.

Automated review (maintainer link)

@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. No current spec record says what the experimental theme editor's contrast check measures, so its new rules (drawing the open scenes Core finishes on mount, counting a part's own inline color or background as its ground, and skipping screen-reader-only text) need an owner decision: an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

Blocking finding:

  • The open Table scene's Name column renders one fixed tree (packages/cli/api/theme-edit/_catalog.mjs:295-306), so in the editor's overlays picture every row, Alice's and Charlie's included, reads "Bob / Design team"; let the render prop read each row.

The new census pairs are well covered: the new test and the changed assertions fail on the base and pass on this head. A failed mounted render is swallowed (_parts.mjs:1039), so consider letting it surface the way a failed main census does.

Claims and files checked

Review mode: carry-forward; reason: none

Claims:

  • Changeset: the contrast check measures text on the fill it is drawn on, including states Core paints once a part mounts, such as a selected table row: verified (new test; base and head problem lists).
  • Changeset: text only screen readers get is no longer measured: verified (a checkbox list row's hidden label leaves the census; the new test checks the selection checkbox label).
  • Description: the check missed text on a fill Core paints after mount and measured screen-reader-only labels: verified (the base census has no selected-row pair and has the hidden label pair).
  • Description: themes passed the check while secondary text on a selected row read under 4.5:1: verified (a gothic-based theme with a blue accent reads 3.5:1 on the head and reports nothing on the base).
  • Description: found on official themes in dark mode at 3.5:1: consistent; 3.5:1 measured on a gothic-based theme with a changed accent, since the editor lists only problems a theme adds over its base.
  • Description: the check measures every visible text pair: verified for the pairs the census draws (catalog, sample page and the two mounted scenes).
  • Description: mounted scenes add only new pairs, a part's own inline background counts, reader-only elements add none: verified (_parts.mjs:1014-1055, :1694-1709, :1548-1561).
  • Description: before, no problem for secondary text on a selected row; after, the pair is named with its ratio: verified.
  • Description: row dividers and table states read as before: verified (the table states test passes on base and head; the census is otherwise unchanged).
  • Description: one regression test with updates to three existing tests: verified for test bodies; three test bodies change, and a fourth file changes a shared helper.
  • Description: the node test run shows no failure the base lacks: partly verified; the five changed files pass on this head (21 of 21), and the full suites were not run here.
  • Description: the CLI typechecks: verified at this head (template-docs and strict typechecks pass).
  • Description: the changeset check and lint pass: verified at this head (changeset check passes; lint of the changed files reports nothing).
  • Description: stays a draft until the layer below lands: verified.
  • Description: no new public API, default or interaction model under the fix label: verified (no command, option or field changes).
  • Description: public text has no internal context: verified.

Files:

  • .changeset/experimental-theme-contrast-selected-row.md: clear.
  • packages/cli/api/theme-edit/_catalog.mjs: blocking (every row named Bob).
  • packages/cli/api/theme-edit/_parts.mjs: waits on the owner decision; one non-blocking note (silent mounted-render failure).
  • packages/cli/api/theme-edit/theme-contrast-selected-row.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-problems-change-lead-result.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-regrown-look-keeps-card-text.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-table-states.test.mjs: clear.
  • packages/cli/clients/cli/commands/experimental-theme-show-text.test.mjs: clear.

Automated review (maintainer link)

… on, a state Core paints once mounted included; text for screen readers alone is never measured
@josephfarina
josephfarina force-pushed the c/how-border-state-offers branch from 5bbcb90 to b2001be Compare November 19, 2026 05:37
@josephfarina
josephfarina force-pushed the c/contrast-selected-row branch from e9915d4 to 6b36a85 Compare November 19, 2026 05:37
@josephfarina
josephfarina changed the base branch from c/how-border-state-offers to c/how-clash-keeps-the-rest November 19, 2026 05:42
@josephfarina
josephfarina changed the base branch from c/how-clash-keeps-the-rest to c/how-border-state-offers-2 November 19, 2026 05:43

@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. No current spec record says what the experimental theme editor's contrast check measures, so its new rules (drawing the open scenes Core finishes on mount, counting a part's own inline color or background as its ground, and skipping screen-reader-only text) need an owner decision: an engineering owner records it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

Blocking finding:

  • The open Table scene's Name column renders one fixed tree (packages/cli/api/theme-edit/_catalog.mjs:295-306), so in the editor's overlays picture every row, Alice's and Charlie's included, reads "Bob / Design team"; let the render prop read each row.

The new census pairs are well covered: the new test and the changed assertions fail on the base and pass with this change. A failed mounted render is swallowed (_parts.mjs:1039), so consider letting it surface the way a failed main census does.

Claims and files checked

Review mode: carry-forward; reason: none

Claims:

  • Changeset: the contrast check measures text on the fill it is drawn on, including states Core paints once a part mounts, such as a selected table row: verified (new test; base and head problem lists).
  • Changeset: text only screen readers get is no longer measured: verified (a checkbox list row's hidden label leaves the census; the new test checks the selection checkbox label).
  • Description: the check missed text on a fill Core paints after mount and measured screen-reader-only labels: verified (the base census has no selected-row pair and has the hidden label pair).
  • Description: themes passed the check while secondary text on a selected row read under 4.5:1: verified (a gothic-based theme with a blue accent reads 3.5:1 on the head and reports nothing on the base).
  • Description: found on official themes in dark mode at 3.5:1: consistent; 3.5:1 measured on a gothic-based theme with a changed accent, since the editor lists only problems a theme adds over its base.
  • Description: the check measures every visible text pair: verified for the pairs the census draws (catalog, sample page and the two mounted scenes).
  • Description: mounted scenes add only new pairs, a part's own inline background counts, reader-only elements add none: verified (_parts.mjs:1014-1055, :1694-1709, :1548-1561).
  • Description: before, no problem for secondary text on a selected row; after, the pair is named with its ratio: verified.
  • Description: row dividers and table states read as before: verified (the table states test passes on base and head; the census is otherwise unchanged).
  • Description: one regression test with updates to three existing tests: verified for test bodies; three test bodies change, and a fourth file changes a shared helper.
  • Description: the node test run shows no failure the base lacks: partly verified on the identical change at the previous revision; the five changed files pass (21 of 21), and the full suites were not run.
  • Description: the CLI typechecks: verified on the identical change at the previous revision (template-docs and strict typechecks pass).
  • Description: the changeset check and lint pass: verified on the identical change at the previous revision (changeset check passes; lint of the changed files reports nothing).
  • Description: stays a draft until the layer below lands: verified.
  • Description: no new public API, default or interaction model under the fix label: verified (no command, option or field changes).
  • Description: public text has no internal context: verified.

Files:

  • .changeset/experimental-theme-contrast-selected-row.md: clear.
  • packages/cli/api/theme-edit/_catalog.mjs: blocking (every row named Bob).
  • packages/cli/api/theme-edit/_parts.mjs: waits on the owner decision; one non-blocking note (silent mounted-render failure).
  • packages/cli/api/theme-edit/theme-contrast-selected-row.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-problems-change-lead-result.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-regrown-look-keeps-card-text.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-table-states.test.mjs: clear.
  • packages/cli/clients/cli/commands/experimental-theme-show-text.test.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 6b36a85

This branch was successfully deployed

1 active deployment
Preview — 6b36a854 Deployed Nov 19, 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