Skip to content

experimental theme set: a theme made one-mode says where the page color shows, once - #12730

Merged
josephfarina merged 1 commit into
feature/theme-editorfrom
fix/theme-page-note-modes-frames
Nov 21, 2026
Merged

josephfarina merged 1 commit into
feature/theme-editorfrom
fix/theme-page-note-modes-frames

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

User impact

When an agent makes a theme one-mode with the editor (set <theme> mode dark-only or light-only), the theme draws its page for that mode only. In an app with nothing painting the page, a dark-only theme viewed in a light OS shows its light text on the browser's white page. The editor already says where the page color shows when a page color is set; it said nothing here.

Where it came from

Theme builds measured page by page: in several runs a dark-only theme made by the editor showed an unpainted page in a light OS.

The general rule: an editor action that changes what the page shows says where the page color shows and how to paint it.

Behavior

  • set <theme> mode dark-only (or light-only) gives the page note once, when the theme has set no page color yet, as setting one does. Going back to both modes and to one mode again says it again; switching between the two one-mode values does not.
  • A theme that already sets its page color gets no note: it heard it then.

Testing

  • theme-page-note-one-mode.test.mjs: the note once, again after both modes, and none for a theme with a page color. The first test fails on main.

preflight: pass 332bcae (review deferred to batch: subagent cap)
replay: worse 0 at 332bcae

@vercel

vercel Bot commented Nov 18, 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 6:35am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 21, 2026, 6:53 AM UTC

@josephfarina
josephfarina force-pushed the fix/theme-page-note-modes-frames branch from a8c4ee2 to 017602a Compare November 18, 2026 23:38
@josephfarina
josephfarina changed the base branch from theme-r15-p21 to theme-r15-p22 November 18, 2026 23:38
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 18, 2026
@josephfarina
josephfarina force-pushed the fix/theme-page-note-modes-frames branch from 017602a to f14e326 Compare November 19, 2026 00:09

@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. Five problems need fixing, and the new page-color notes also need an engineering owner's decision.

  • set <theme> background-image <gradient> --on layout-content (or a background image value) prints set <theme> --color-background-body <gradient> as the page line, and that printed command fails with ERR_THEME_BAD_VALUE; print the page line only for a color value.
  • The changeset says an embedded app gets no page note, but the main-panel note (_edit.mjs:7128) and the --on layout refusal (_check.mjs:5653) still append it there; gate both on the same check or narrow the wording.
  • embeddedInHostPage treats any app without a @astryxdesign/core/reset.css import as embedded, so an app that owns its page and loads only astryx.css loses the page note on its first set --color-background-body, and the guide says only that an embedded area adds no body rule; keep that note or detect embedding from a signal that means it, and correct the description.
  • Following the editor's own how 'page background …' answer, its --on layout-content line now tells the agent to run the --color-background-body line it already ran and repeats the page note; skip both when the theme already sets that page color.
  • The rule for which parts draw the page is now computed in pageFrameParts (_edit.mjs), inline in _check.mjs, and in the existing pageReaders (_how-question.mjs) with two different predicates; move it into one shared helper that all three call.

No current record decides what experimental theme editor set says about the page color, so approval also needs an engineering owner to settle the one-mode note, the main-panel note, the frame refusal's first line and the embedded-app silence for this head by commenting /approve-spec <full head SHA>; the author may do so as an engineering owner.

Claims and files checked

Review mode: carry-forward; reason: none

  • Claim: a one-mode switch gives the page note once: verified (new test; _edit.mjs:6334-6344).
  • Claim: a main-panel fill says it covers that panel and names the page line: verified for color values; false for image values, whose printed line fails.
  • Claim: a shell-frame fill is refused with the page line first: verified (new test; the line runs).
  • Claim: an embedded app gets no page note: false on the main-panel and frame paths.
  • Claim: the editor already gave the note when a page color is set: verified (base _edit.mjs).
  • Claim: page-frame parts come from the part data, not a list: verified (pageFrameParts gives layout and layout-content on the neutral base).
  • Claim: an app with no Core reset is embedded, as the guide says: false; the guide says only that an embedded area adds no body rule.
  • Claim: the new test covers the one-mode, panel, frame and embedded cases: verified (4 of 4 pass; 3 fail without the change).
  • Claim: the node suite passes apart from inherited failures, and the type gate and changeset check are clean: not rerun; nine related test files (35 tests) pass.
  • Claim: theme-build runs showed unpainted pages and page fills on the wrong part: a measurement outside the repository, not checkable here.
  • File .changeset/experimental-theme-page-note-modes-frames.md: finding (embedded claim).
  • File packages/cli/api/theme-edit/_check.mjs: finding (embedded gap, copied page-part rule).
  • File packages/cli/api/theme-edit/_edit.mjs: finding (image page line, embedded gap, repeated note, copied rule).
  • File packages/cli/api/theme-edit/_project.mjs: finding (embedding inferred from the reset import).
  • File packages/cli/api/theme-edit/theme-page-note-frames-and-modes.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.

Changes requested. Seven problems need fixing, and the new page-color notes also need an engineering owner's decision.

  • set <theme> background-image <gradient> --on layout-content (or a background image value) prints set <theme> --color-background-body <gradient> as the page line, and that printed command fails with ERR_THEME_BAD_VALUE; print the page line only for a color value.
  • The changeset says an embedded app gets no page note, but the main-panel note (_edit.mjs:7128) and the --on layout refusal (_check.mjs:5653) still append it there; gate both on the same check or narrow the wording.
  • embeddedInHostPage treats any app without a @astryxdesign/core/reset.css string as embedded, so an app that owns its page and loads only astryx.css, or links Core from a versioned CDN URL, loses the page note on its first set --color-background-body, and the guide says only that an embedded area adds no body rule; keep that note or detect embedding from a signal that means it, and correct the description.
  • Following the editor's own how 'page background …' answer, its --on layout-content line now tells the agent to run the --color-background-body line it already ran and repeats the page note; skip both when the theme already sets that page color.
  • The rule for which parts draw the page is now computed in pageFrameParts (_edit.mjs), inline in _check.mjs, and in the existing pageReaders (_how-question.mjs) with two different predicates; move it into one shared helper that all three call.
  • Miss: embeddedInHostPage copies the project scan that doctor's coreStylesheetLoad (api/doctor/doctor.mjs) already does with parsed imports, and the copy already misses versioned CDN links and counts line comments; extend doctor's scan to take the stylesheet and call it from both.
  • Miss: with --state, the --on layout refusal still says "set --color-background-body (the first line)" but prints no such line, so the first line it shows sets the frame's surface instead; build the page line without the state and condition, or drop that sentence when either is set.

No current record decides what experimental theme editor set says about the page color, so approval also needs an engineering owner to settle the one-mode note, the main-panel note, the frame refusal's first line and the embedded-app silence for this head by commenting /approve-spec <full head SHA>; the author may do so as an engineering owner.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: making a theme one-mode gives the page note once, and again after going back to both modes: verified (new test; _edit.mjs:6331-6344).
  • Claim: a fill on the main panel says it covers that panel, not the page, and names the page color line: verified for color values; false for image values, whose printed line fails.
  • Claim: a fill on the shell frame is refused with the page color line first: verified for plain and --mode fills (the line runs); false with --state, where the message names a line that is not printed.
  • Claim: an embedded app gets no page note: false on the main-panel and frame paths.
  • Claim: the editor already gave the note when a page color is set: verified (the base gates it only on the first page color).
  • Claim: a dark-only theme in a light OS shows light text on the browser's white when nothing paints the page: consistent with the existing one-mode note; no rendered check needed.
  • Claim: a fill on the main panel or the shell frame covers only that panel: verified from the part data (layout-content draws the surface; the app shell paints the page).
  • Claim: page-frame parts come from the part data, not a list: verified (layout and layout-content on the neutral base).
  • Claim: an app with no Core reset is embedded and gets no page note, as the guide says: false; the guide says only that an embedded area adds no body rule.
  • Claim: the new test covers the one-mode, panel, frame and embedded cases: verified (4 of 4 pass; 3 fail without the change).
  • Claim: the node suite passes apart from inherited failures, and the type gate and changeset check are clean: not rerun; the new test file and nine related theme-edit test files (39 tests) pass.
  • Claim: theme builds showed unpainted pages and page fills on the wrong part: measurements outside the repository, not checkable here.
  • File .changeset/experimental-theme-page-note-modes-frames.md: finding (embedded claim).
  • File packages/cli/api/theme-edit/_check.mjs: finding (embedded gap, copied page-part rule, --state page line).
  • File packages/cli/api/theme-edit/_edit.mjs: finding (image page line, embedded gap, repeated note, copied rule).
  • File packages/cli/api/theme-edit/_project.mjs: finding (embedding inferred from the reset string; copy of doctor's scan).
  • File packages/cli/api/theme-edit/theme-page-note-frames-and-modes.test.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/theme-edit/_edit.mjs Resolved
Comment thread packages/cli/api/theme-edit/_edit.mjs Resolved
Comment thread packages/cli/api/theme-edit/_check.mjs Resolved
@josephfarina
josephfarina force-pushed the theme-r15-p22 branch 15 times, most recently from 7d518b8 to 0712faa Compare November 19, 2026 03:55
@josephfarina
josephfarina force-pushed the theme-r15-p22 branch 20 times, most recently from dfd50b0 to b4cfbe8 Compare November 19, 2026 13:21
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@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. Seven problems need fixing, and the new page-color notes also need an engineering owner's decision.

  • set <theme> background-image <gradient> --on layout-content (or a background image value) prints set <theme> --color-background-body <gradient> as the page line, and that printed command fails with ERR_THEME_BAD_VALUE; print the page line only for a color value.
  • The changeset says an embedded app gets no page note, but the main-panel note (_edit.mjs:7187) and the --on layout refusal (_check.mjs:5827) still append it there; gate both on the same check or narrow the wording.
  • embeddedInHostPage treats any app without a @astryxdesign/core/reset.css string as embedded, so an app that owns its page and loads only astryx.css, or links Core from a versioned CDN URL, loses the page note on its first set --color-background-body, and the guide says only that an embedded area adds no body rule; keep that note or detect embedding from a signal that means it, and correct the description.
  • Following the editor's own how 'page background …' answer, its --on layout-content line now tells the agent to run the --color-background-body line it already ran and repeats the page note; skip both when the theme already sets that page color.
  • The rule for which parts draw the page is now computed in pageFrameParts (_edit.mjs), inline in _check.mjs, and in the existing pageReaders (_how-question.mjs) with two different predicates; move it into one shared helper that all three call.
  • Miss: embeddedInHostPage copies the project scan that doctor's coreStylesheetLoad (api/doctor/doctor.mjs) already does with parsed imports, and the copy already misses versioned CDN links and counts line comments; extend doctor's scan to take the stylesheet and call it from both.
  • Miss: the --on layout refusal always says "set --color-background-body (the first line)", but with --state or an image background value it prints no such line, so the first line shown sets the frame's surface on hover or there is none at all; build the page line without the state and condition and only for a color value, or drop that sentence otherwise.

No current record decides what experimental theme editor set says about the page color, so approval also needs an engineering owner to settle the one-mode note, the main-panel note, the frame refusal's first line and the embedded-app silence by commenting /approve-spec <full head SHA> on the pull request; the author may do so as an engineering owner. Also worth fixing: after a one-mode switch gives the page note, the first set --color-background-body repeats it word for word.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: making a theme one-mode gives the page note once, and again after going back to both modes: verified (new test; _edit.mjs:6370-6383).
  • Claim: a fill on the main panel says it covers that panel, not the page, and names the page color line: verified for color values; false for image values, whose printed line fails.
  • Claim: a fill on the shell frame is refused with the page color line first: verified for plain and --mode fills (the line runs); false with --state or an image background value, where the message names a line that is not printed.
  • Claim: an embedded app gets no page note: false on the main-panel and frame paths.
  • Claim: the editor already gave the note when a page color is set: verified (the base gates it only on the first page color).
  • Claim: a dark-only theme in a light OS shows light text on the browser's white when nothing paints the page: consistent with the existing one-mode note; no rendered check needed.
  • Claim: a fill on the main panel or the shell frame covers only that panel: verified from the part data (layout-content draws the surface; the app shell paints the page).
  • Claim: page-frame parts come from the part data, not a list: verified (layout and layout-content on the neutral base).
  • Claim: an app with no Core reset is embedded and gets no page note, as the guide says: false; the guide says only that an embedded area adds no body rule.
  • Claim: the new test covers the one-mode, panel, frame and embedded cases: verified (4 of 4 pass; 3 fail without the change).
  • Claim: the node suite passes apart from inherited failures: not rerun in full; the new test file and 20 related theme-edit test files pass.
  • Claim: the type gate is clean: partly checked; the strict CLI typecheck reports no error in the changed files (its two errors are templates that need a built theme package).
  • Claim: the changeset check passes: verified.
  • Claim: theme builds showed unpainted pages and page fills on the wrong part: measurements outside the repository, not checkable here.
  • File .changeset/experimental-theme-page-note-modes-frames.md: finding (embedded claim).
  • File packages/cli/api/theme-edit/_check.mjs: finding (embedded gap, copied page-part rule, page line under --state or an image value).
  • File packages/cli/api/theme-edit/_edit.mjs: finding (image page line, embedded gap, repeated note, copied rule).
  • File packages/cli/api/theme-edit/_project.mjs: finding (embedding inferred from the reset string; copy of doctor's scan).
  • File packages/cli/api/theme-edit/theme-page-note-frames-and-modes.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.

Waiting on an engineering owner's decision. No blocking problems were found.

No current spec decides what astryx experimental theme editor set says about the page color, so the new page note on set <theme> mode light-only|dark-only needs an engineering owner to approve or amend that direction by commenting /approve-spec <full head SHA> on the pull request; the author may do so as an engineering owner. Also worth fixing: after the switch gives the page note, the first set <theme> --color-background-body repeats it word for word, because that note still counts as unsaid there.

Claims and files checked

Review mode: full; reason: history

  • Claim: making a theme light-only or dark-only from both modes gives the page note when it sets no page color: verified (new test; _edit.mjs:6369-6381).
  • Claim: going back to both modes and then to one mode again gives it again, and switching between the two one-mode values does not: verified (new test).
  • Claim: a theme that already sets its page color gets no note: verified (new test; also for a page color set for one mode).
  • Claim: the note comes once: verified per switch; the first page color set afterwards repeats it.
  • Claim: the editor already gave the note when a page color is set and said nothing on a mode switch: verified (base code; the new test's first case fails on the base).
  • Claim: a dark-only theme in a light OS shows its text on the browser's page when nothing paints it: consistent with the existing one-mode note; no rendered check is needed for a CLI text change.
  • Claim: theme builds showed unpainted pages: measurements outside the repository, not checkable here.
  • Claim: the first test fails on main: verified.
  • Claim: preflight passes: not rerun; CI did not run on this draft head, and the new test, the related theme-editor tests and the changeset check pass locally.
  • File .changeset/experimental-theme-page-note-one-mode.md: clear.
  • File packages/cli/api/theme-edit/_edit.mjs: non-blocking note (repeated page note; page-color check written twice).
  • File packages/cli/api/theme-edit/theme-page-note-one-mode.test.mjs: clear.

Automated review (maintainer link)

Comment on lines +6377 to +6380
!data.settings.some(
x => x.thing === '--color-background-body' && !x.on,
)
? [pageColorNote(data.mode)]

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: after this note, the first set <theme> --color-background-body gives the same note again, word for word, since hadPageColor (:6136-6138) is still false at :7167-7172, whose comment says the note is said once for the theme. Skip that later note for a theme this switch already told, or keep the note on the first page color only. This check is also the one hadPageColor computes in the same function; using it keeps both notes on one rule.

@josephfarina

Copy link
Copy Markdown
Contributor Author

Covers the theme-editor detail this pull request records (the owner's ruling): experimental theme editor set <theme> mode dark-only|light-only gives the page-color note once, when the theme has set no page color, as setting a page color does.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 332bcae

@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed on main in #13226.

This branch was successfully deployed

1 active deployment
Preview — 332bcaef 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