Repository navigation
experimental theme: a saved --only on a part styled on its own opens - #12895
josephfarina wants to merge 1 commit into
Conversation
|
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.
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
onlyon a part styled on its own builds as if absent but is still a separate setting, becausekeyOf(packages/cli/api/theme-edit/_settings.mjs:4332) and theset/undoentry matches in_edit.mjs(lines 5423, 5440 and 5563) still countonly, sosetwithout--onlyadds a second entry instead of replacing it,undowithout--onlysays the theme does not set it, and a plain entry at the same place is silently covered; countonlythere only whenonlyMeans(on) === 'member'and test those three cases. onlyMeansis described as the one rule, yetpartsOf(_settings.mjs:4383) and_edit.mjslines 2364, 7034 and 7336 keep their own copies of its member test, so callonlyMeansthere and delete the copies, so that a later change to--onlyreaches the build and the hints too.
Also worth a look (not blocking):
- A whole-theme entry with
onlyis 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 ifsetrefused--onlyon 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
onlyon 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
onlywere absent, which holds for the built CSS, butset,undoand 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 --onlyon 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:
--onlymeans one thing tosetand to the settings reader, since both callonlyMeans, 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;
sethas refused--onlyon 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 --onlyrefusal and the stored-value check, consistent withonlyMeans; 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 thesetrefusal; note on the first test's catch.
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.
bb430f2 to
51c1076
Compare
|
/approve-spec 51c1076 |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
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
onlyon 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, andshowleaves 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 --onlyfollows 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
undoremoves it, and fix lines carry no--only(new tests). - Verified:
--onlyon a group, or with no part, still stops the theme with an undo line (checked at this head). - Verified: one function decides what
--onlymeans, andset, 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-typesare 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
onlypass, 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: theset --onlyrefusal; clear.packages/cli/api/theme-edit/_edit.mjs: hints and the alike-height check callonlyMeans; 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.
- #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
|
Landed in #12940. |
What users see
A theme whose settings hold an
onlyon a part that is styled on its own (for example, a text shadow saved with--onlyon 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.only, which is what--onlymeans 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.undofinds it, and contrast fix lines carry no--onlythatsetwould refuse.--onlyon a group itself, or with no part, still stops the theme, as before.Why
set --onlyand the settings reader decided what--onlymeans in two different places, and another editor version saved anonlythat this reader rejected, so the theme couldn't be opened at all. The general rule now: one function,onlyMeans, says what--onlymeans on a place.set, the settings reader, the build's group spread and the result hints all follow it. The reader accepts everyonlythe 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.mjscovers:set --only, and the theme opens again;set --onlyon a part styled on its own is refused with the line without it;onlythere, written as another editor version wrote it, opens with one note, the file is unchanged byshow, and the CSS holds its value;undoremoves it;onlybeside a plain entry for the same place opens, keeping the later one;onlyoncardcarries no--only.sync:api-typesare 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:#numbers,/pull/or/issues/).