Skip to content

experimental theme: a saved --only on a part styled on its own opens - #12895

Closed
josephfarina wants to merge 1 commit into
mainfrom
theme-saved-only-opens
Closed

josephfarina wants to merge 1 commit into
mainfrom
theme-saved-only-opens

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What users see

A theme whose settings hold an only on a part that is styled on its own (for example, a text shadow saved with --only on a segmented control item) now opens. Before, every editor command on the theme stopped with "has only, which is for one member of a group styled alike", and the only way on was to remove the setting.

  • The entry is read as without only, which is what --only means on that part: it changes nothing, since the part doesn't spread to a group. One note says so, and the next change saves the entry without it.
  • Every reader sees it the same way: the line a refusal offers replaces the entry, undo finds it, and contrast fix lines carry no --only that set would refuse.
  • If reading it so puts the entry on the same place as a plain entry, the later one is kept, since it's the one the build shows. The earlier one is named in a note.
  • --only on a group itself, or with no part, still stops the theme, as before.

Why

set --only and the settings reader decided what --only means in two different places, and another editor version saved an only that this reader rejected, so the theme couldn't be opened at all. The general rule now: one function, onlyMeans, says what --only means on a place. set, the settings reader, the build's group spread and the result hints all follow it. The reader accepts every only the writer accepts, plus a meaningless one on a part styled on its own, which it reads as absent. The rule is recorded in AST-050 DEC-11.

Test plan

  • theme-saved-only-reads-as-written.test.mjs covers:
    • every member of a group that spreads takes set --only, and the theme opens again;
    • set --only on a part styled on its own is refused with the line without it;
    • a saved only there, written as another editor version wrote it, opens with one note, the file is unchanged by show, and the CSS holds its value;
    • the offered line replaces that entry instead of adding a second one, and a bare undo removes it;
    • a saved only beside a plain entry for the same place opens, keeping the later one;
    • a contrast fix line for a saved only on card carries no --only.
  • Checked on a real theme that held that saved entry: this refusal is gone.
  • Five cli typechecks and sync:api-types are clean. The theme-edit, theme, parity and experimental suites have no new failures against main.

Writing rubric results

Record rubric (docs/contributing/spec-writing.md) over the sentence added to AST-050 DEC-11:

  • R1 narration: present-tense statements about how the editor reads a saved setting; no project narration.
  • R2 research: none in the record.
  • R3 evidence: none added.
  • R4 rejected alternatives: none added; DEC-11's existing one line is unchanged.
  • R5 change references: none (no # numbers, /pull/ or /issues/).
  • R6 open questions: none added.
  • R7 project status: none; no build-status or work-order words.

@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 2:28pm 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
🟢 Reviewed (for maintainers only) Nov 19, 2026, 2:38 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 19, 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.

Outcome: approval waits on an engineering owner's decision, and two changes are needed.

No current spec covers how the experimental theme editor reads a saved only on a part styled on its own: opening the theme, keeping the entry and building it as if only were absent. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, or names the spec that governs it; the author may do this as an engineering owner.

Blocking:

  • A saved only on a part styled on its own builds as if absent but is still a separate setting, because keyOf (packages/cli/api/theme-edit/_settings.mjs:4332) and the set/undo entry matches in _edit.mjs (lines 5423, 5440 and 5563) still count only, so set without --only adds a second entry instead of replacing it, undo without --only says the theme does not set it, and a plain entry at the same place is silently covered; count only there only when onlyMeans(on) === 'member' and test those three cases.
  • onlyMeans is described as the one rule, yet partsOf (_settings.mjs:4383) and _edit.mjs lines 2364, 7034 and 7336 keep their own copies of its member test, so call onlyMeans there and delete the copies, so that a later change to --only reaches the build and the hints too.

Also worth a look (not blocking):

  • A whole-theme entry with only is now refused as "…for one member of a group, not a group itself", which misnames a dial as a group (_settings.mjs:1697).
  • The first new test's bare catch { continue; } lets it pass even if set refused --only on every member (theme-saved-only-reads-as-written.test.mjs:69-71).

Two of the three new tests fail on the base branch and all three pass here; CI has not run on this head yet.

Claims and files checked

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

  • Verified: a saved only on a part styled on its own no longer stops the theme from opening (the new test fails on the base branch and passes here).
  • Verified: the entry stays in the settings file as saved, also after a later change (new test).
  • Partly verified: the entry builds as if only were absent, which holds for the built CSS, but set, undo and the duplicate check still treat it as its own setting (first blocking finding).
  • Verified: one note per command names the entry and says it changes nothing there (new test).
  • Verified: set --only on such a part is refused by the same rule and offers the same line without --only (new test fails on the base branch).
  • Partly verified: --only means one thing to set and to the settings reader, since both call onlyMeans, but the setting identity and the build's spread test keep their own reading (both blocking findings).
  • Not verifiable here: that another editor version saved such entries; set has refused --only on such a part since the editor was added.
  • .changeset/experimental-theme-saved-only-reads.md: an [experimental] patch note for the CLI, which fits the experimental release rule; claims as above.
  • packages/cli/api/theme-edit/_tables.mjs: onlyMeans; second blocking finding.
  • packages/cli/api/theme-edit/_check.mjs: set --only refusal and the stored-value check, consistent with onlyMeans; clear.
  • packages/cli/api/theme-edit/_settings.mjs: the reader; first blocking finding, plus the whole-theme wording note.
  • packages/cli/api/theme-edit/theme-saved-only-reads-as-written.test.mjs: covers the opened theme, the kept entry and the set refusal; note on the first test's catch.

Automated review (maintainer link)

Comment thread packages/cli/api/theme-edit/_tables.mjs Resolved
One rule, onlyMeans, says what --only means on a place; set, the settings
reader, the build's group spread and the result hints all follow it. A
saved only on a part styled on its own (as another editor version saved
it) is read as absent with one note, so the theme opens, the line the
refusal offers replaces the entry, undo finds it, and fix lines carry no
--only set would refuse; where that lands it on a plain twin's place, the
later entry, the one the build shows, is kept. Recorded in AST-050 DEC-11.
@josephfarina
josephfarina force-pushed the theme-saved-only-opens branch from bb430f2 to 51c1076 Compare November 19, 2026 14:18
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 19, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 51c1076

@josephfarina
josephfarina marked this pull request as ready for review November 19, 2026 14:19
@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 51c1076

⏳ Building… Until it's ready, Storybook · Sandbox open the branch's previous preview.

Current run: The current CI run concluded cancelled. 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.

Approved pending CI: CI has not run on this head yet.

The sentence this pull request adds to the app themes spec, approved by an engineering owner for this head, covers reading a saved only on a part styled on its own as absent, and the new tests fail on the base branch and pass here. All four points from the earlier review are fixed.

Claims and files checked

Review mode: full; reason: history

  • Verified: a saved only on a part styled on its own no longer stops the theme from opening (new test fails on the base branch, passes here).
  • Verified: such an entry is read and built as without only, with one note, and show leaves the file unchanged (new test).
  • Verified: the next saving change writes the entry without only (new test, and the same check with the entries in the other order).
  • Verified: where that puts the entry on the same place as another entry of the same setting, the later one is kept and the earlier one is named and left out (new test).
  • Verified: set --only follows the same rule and, on a part styled on its own, offers the same command without --only (new test).
  • Verified: the offered line replaces the entry, a bare undo removes it, and fix lines carry no --only (new tests).
  • Verified: --only on a group, or with no part, still stops the theme with an undo line (checked at this head).
  • Verified: one function decides what --only means, and set, the settings reader, the build's group spread and the result hints all call it (code).
  • Verified: the rule is recorded in the app themes spec's decision on settings that do not show (spec diff); the writing rubric results match the added sentence.
  • Partly verified: typechecks and sync:api-types are clean; the API types sync and three type projects pass here, and the strict project fails only on two unchanged template pages that need a built theme package.
  • Partly verified: no new test failures; the 22 theme-editor test files that set or save only pass, and the full suites were not run here.
  • Not verifiable here: that another editor version saved such entries, and the check on a real theme.
  • .changeset/experimental-theme-saved-only-reads.md: experimental patch note for the CLI; claims verified above.
  • docs/specs/AST-050-app-themes/spec.md: one sentence appended to an existing decision; owner-approved at this head.
  • packages/cli/api/theme-edit/_tables.mjs: onlyMeans; clear.
  • packages/cli/api/theme-edit/_settings.mjs: the reader and the reworded refusal; clear.
  • packages/cli/api/theme-edit/_check.mjs: the set --only refusal; clear.
  • packages/cli/api/theme-edit/_edit.mjs: hints and the alike-height check call onlyMeans; clear.
  • packages/cli/api/theme-edit/theme-saved-only-reads-as-written.test.mjs: five tests, four of which fail on the base branch; clear.

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12895 experimental theme: a saved --only on a part styled on its own opens
  Author: @josephfarina
- #12706 fix(cli): template reads ~/ as the home folder, never a folder named ~
  Author: @josephfarina
- #12750 feat(cli): experimental icon names each match's meaning import
  Author: @josephfarina
- #12307 fix(core): keep anchored layers on screen when their trigger runs past the viewport
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12940.

@github-actions
github-actions Bot deleted the theme-saved-only-opens branch November 20, 2026 06:06

This branch was successfully deployed

1 active deployment
Preview — 51c1076d 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