Skip to content

fix(cli): a padding of two to four lengths where only one works is written as its sides - #12742

Closed
josephfarina wants to merge 16 commits into
mainfrom
josephfarina/theme-calc-padding-write
Closed

josephfarina wants to merge 16 commits into
mainfrom
josephfarina/theme-calc-padding-write

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Since #12729, set <theme> padding '5px 0' --on dropdown-menu offers the sides instead of a dead end. A user still needs a second command for something the editor can do itself. A menu or segmented control reads its padding inside calc(), where one length works, but its padding-block, padding-inline and per-side paddings all work.

Problem and solution fit

  • Why a second command? set refused a valid CSS shorthand, though each side it names can be set on that part.
  • Why does it matter? An author recreating a look writes the shorthand they know. The editor should take it, not hand it back.
  • The fix: set writes the shorthand as its sides, in one change. Each side is read by its own check, so padding '5px 10%' writes padding-inline 10% where the part takes it. 5px 0 becomes padding-block 5px + padding-inline 0; three lengths become top / inline / bottom; four become each side. The result names them: "wrote padding '5px 0' as its sides, padding-block 5px, padding-inline 0: dropdown-menu reads padding inside calc(), where one length works; undo t takes back all 2". One bare undo takes back all of them. The same working length for every side (5px 5px) is written as that one length, with a note; the same value that is no one length there (10% 10%) is written as its sides.

Expected behavior and authority

A value CSS defines and the part can take is written. A refusal happens only when a side's own check refuses that side's value. Each side replaces the longhands it covers, as a plain side set does: an earlier padding-left 9px is replaced by padding '5px 0' and comes back with its undo. An earlier padding on the part is replaced by the sides and named ("replaces padding = 4px on dropdown-menu"); the undo brings it back when the editor still accepts it (a hand-edited value it refuses is left out, and the note does not promise it). A repeat set that changes nothing, also after a change elsewhere, keeps every side where it is, says so with the typed value and claims no undo step. When only some sides change ('5px 0' then '5px 2px'), the undo note names only those. A later setting of the same side that hides a written side names it, as for a plain side set (a later setting of other longhands that cover it is not named). how checks such a padding the way set writes it, so it offers set <theme> padding '5px 0' --on dropdown-menu, never the first length alone. A repeat over a stale or missing build claims no undo step, and a state word read as another state is said once for every side. A hand-edited saved entry is still checked as written (the expansion applies only to the value set is given).

Smallest restoration

  • boxSides in _check.mjs gives the sides of a 2–4 length padding/margin. The calc() padding check returns them, each checked by checkSetting, only when set asks (flags.sides).
  • _edit.mjs writes the first side as the change's setting and the others beside it in the same commit, replaces each side's covered longhands, and adds the note.
  • New result field: asSides ({thing, value, sides}) on the experimental set result (ThemeEditChangeData, set --json). It names the value typed and the sides written. The status line leads with it: padding = 5px 0 on dropdown-menu (padding-block 5px, padding-inline 0).
  • This replaces fix(cli): a padding of two to four lengths where only one works offers its sides #12729's offered side lines, so boxSideLines is removed. fix(cli): a padding of two to four lengths where only one works offers its sides #12729's repair-gate coverage fix stays, with a unit test.

Evidence

  • Before: set t padding '5px 0' --on dropdown-menu refuses (with fix(cli): a padding of two to four lengths where only one works offers its sides #12729, it offers two lines).
  • After: it writes padding-block 5px, padding-inline 0; the CSS has padding-top/bottom: 5px, padding-left/right: 0 on the menu. One undo t removes both.
  • Unchanged: one length, a variable, calc()/min()/max()/clamp(); padding-inline '4px 8px' on an item is still refused. A hand-edited padding: 2px 6px entry still refuses the next command.
  • Tests: theme-edit-calc-padding-sides.test.mjs (writes, names, one undo for 2/3/4 lengths; one length for equal sides; an earlier side is replaced and comes back with undo; a no-change repeat claims no undo; 5px 10% writes both sides; asSides in the result). theme-palette now expects the shorthand written as sides. theme-repair-gate-value-carry has a unit test for the coverage rule.

Scope

Components: cli (experimental theme editor)

  • 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 (the one new field, asSides on the experimental set result, is named above).
  • 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: 483 of 492 files pass. The 9 failing files (app copy, compile check, clean-checkout builds and one picture run) fail the same on main in this environment. The five CLI typechecks and sync:api-types are clean, the CLI structure check passes, and Prettier is clean.

preflight: pass 3352125

@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 2:22am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 18, 2026
@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 21, 2026, 5:14 AM UTC

@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 decision, and the fixes below are needed after it.

The experimental theme editor's set now writes a padding of two to four lengths as its sides on parts that read padding inside calc(), and adds an asSides field to the set result. No current record decides that behavior or covers the field, so an engineering owner records the decision by commenting /approve-spec <full head SHA>; the author may do so as an engineering owner.

Blocking findings:

  • After a repeat set that changes nothing, the result still says undo <theme> takes back all 2 next to "no undo step was added", and that undo then takes back an earlier unrelated change (a mode change in our run); build the note and status line from what the commit wrote (_edit.mjs:6778-6782, theme.mjs:597).
  • Sides after the first skip the longhand replacement, so an earlier padding-left 9px stays saved under padding '5px 0' and comes back after undo <theme> padding-inline --on dropdown-menu, while a plain set padding-inline replaces it (_edit.mjs:6296-6299, _edit.mjs:6344-6370).
  • The description says a refusal happens only when the part cannot take a side, but padding '5px 10%' is refused with only how padding offered although padding-inline 10% is accepted (_check.mjs:281); let each side's own check decide or narrow the claim.
  • The description's scope box says no new public API is added, but asSides is new on the exported ThemeEditChangeData and in set --json; name it in the description.
Claims and files checked

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

  • Changeset: set with a padding of two to four lengths on a calc() padding part writes the sides in one change: verified (_check.mjs:7304-7321, _edit.mjs:5866, _edit.mjs:6296; new test).
  • Changeset: two lengths give block and inline, three give top, inline and bottom, four give each side, each with its typed length: verified (_check.mjs:277-300; new test).
  • Changeset: the result names the sides: verified (note _edit.mjs:6778-6782, asSides _edit.mjs:7342-7350, status line theme.mjs:600).
  • Changeset: one undo takes back all of them: verified (new test; a bare undo prints "undid 4 changes"), except after a no-change repeat (first finding).
  • Changeset: the same length on every side is written as that one length: verified (new test).
  • Description: menus and segmented controls take padding-block, padding-inline and per-side paddings: verified (new test, theme-palette test).
  • Description: the quoted result note and one bare undo removing all sides: verified (head CLI run).
  • Description: any value CSS defines and the part can take is written; a refusal comes only from a side's own check: false (third finding).
  • Description: a hand-edited saved entry is still checked as written: verified (theme-palette hand-edited padding test passes; only set passes flags.sides).
  • Description: boxSides replaces boxSideLines, and the repair-gate coverage rule stays with a unit test: verified (diff; the test passes on base and head).
  • Description: before, the set refuses and offers side lines; after, the CSS has padding-top and padding-bottom 5px and padding-left and padding-right 0: verified (base and head CLI runs).
  • Description: one length, a variable and calc(), min(), max() or clamp() are unchanged, and padding-inline '4px 8px' on an item is still refused: verified (theme-palette test passes).
  • Description: the new test fails before the change: verified (fails on the base, passes on the head).
  • Description: 483 of 492 test files pass and the typechecks are clean: not reproduced (only the changed tests were run).
  • Description: no new public API under the bug-fix label: false (fourth finding).
  • .changeset/experimental-theme-calc-padding-sides.md: clear.
  • packages/cli/api/theme-edit/_check.mjs: third finding (length-only filter).
  • packages/cli/api/theme-edit/_edit.mjs: first and second findings.
  • packages/cli/api/theme-edit/_settings.mjs: clear.
  • packages/cli/api/theme-edit/theme-edit.type.mjs: new asSides member, part of the owner decision.
  • packages/cli/clients/cli/commands/experimental/theme.mjs: first finding (status line after no change).
  • packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear; it covers neither a repeat nor earlier side settings.
  • packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-repair-gate-value-carry.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

Copy link
Copy Markdown
Contributor Author

/approve-spec aab4ee6

@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: the engineering owner's approval settles the direction, and the fixes below remain.

The experimental theme editor's set now writes a padding of two to four lengths as its sides on parts that read padding inside calc(). The approval for this head covers that behavior and the new asSides result field, so no spec decision is pending.

Blocking findings:

  • After a repeat set that changes nothing, the result still says undo <theme> takes back all 2 next to "no undo step was added", and that undo then takes back an earlier unrelated change (for example a mode change), so build the note and status line from what the commit wrote (_edit.mjs:6778-6782, theme.mjs:597).
  • Sides after the first skip the longhand replacement, so an earlier padding-left 9px stays saved under padding '5px 0' and comes back after undo <theme> padding-inline --on dropdown-menu, while a plain set padding-inline replaces it (_edit.mjs:6296-6299, _edit.mjs:6344-6370).
  • The description says a refusal happens only when the part cannot take a side, but padding '5px 10%' is refused with only how padding offered although padding-inline 10% is accepted (_check.mjs:281), so let each side's own check decide or narrow the claim.
  • The description's scope box says no new public API is added, but asSides is new on the exported ThemeEditChangeData and in set --json, so name it in the description.

The new repair-gate commit looks right: its added assertion fails against the base's rule and passes on this head.

Claims and files checked

Review mode: incremental; reason: none

  • Changeset: set with a padding of two to four lengths on a calc() padding part writes the sides in one change: verified (_check.mjs:7304-7321, _edit.mjs:5866, _edit.mjs:6296; new test).
  • Changeset: two lengths give block and inline, three give top, inline and bottom, four give each side, each with its typed length: verified (_check.mjs:277-300; new test).
  • Changeset: the result names the sides: verified (note _edit.mjs:6778-6782, asSides _edit.mjs:7342-7350, status line theme.mjs:600).
  • Changeset: one undo takes back all of them: verified (new test), except after a no-change repeat (first finding).
  • Changeset: the same length on every side is written as that one length: verified (new test).
  • Description: menus and segmented controls take padding-block, padding-inline and per-side paddings: verified (new test, theme-palette test).
  • Description: the quoted result note, and one bare undo removing all sides: verified (new test; head run).
  • Description: any value CSS defines and the part can take is written, and a refusal comes only from a side's own check: false (third finding).
  • Description: a hand-edited saved entry is still checked as written: verified (theme-palette passes; only set asks for sides, _edit.mjs:5563).
  • Description: boxSides replaces boxSideLines, and _edit.mjs writes the first side as the change and the others in the same commit, with a note: verified (diff).
  • Description: the base's repair-gate coverage fix stays, with a unit test: verified; this head also narrows it so a line reading the whole value carries nothing (_normal.mjs:1847), and the new assertion fails against the base's rule.
  • Description: before, the set refuses and offers side lines; after, it writes the two sides and the built CSS sets the matching physical paddings: verified (base and head runs; the code is unchanged since).
  • Description: one length, a variable and calc(), min(), max() or clamp() are unchanged, and padding-inline '4px 8px' on an item is still refused: verified (theme-palette passes).
  • Description: the listed tests cover the new behavior and the coverage rule: verified (29 changed tests pass; nine neighbouring test files, 824 tests, pass).
  • Description: 483 of 492 test files pass and the typechecks are clean: not reproduced (only the changed and neighbouring test files were run).
  • Description: no new public API is hidden under the bug-fix label: false (fourth finding).
  • .changeset/experimental-theme-calc-padding-sides.md: clear.
  • packages/cli/api/theme-edit/_check.mjs: third finding (length-only filter).
  • packages/cli/api/theme-edit/_edit.mjs: first and second findings.
  • packages/cli/api/theme-edit/_normal.mjs: clear.
  • packages/cli/api/theme-edit/_settings.mjs: clear.
  • packages/cli/api/theme-edit/theme-edit.type.mjs: clear (new asSides member, covered by the approval; see the fourth finding for the description).
  • packages/cli/clients/cli/commands/experimental/theme.mjs: first finding (status line after no change).
  • packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear; it covers neither a repeat nor earlier side settings.
  • packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-repair-gate-value-carry.test.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 76b4ad5

@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: the engineering owner's approval settles the direction, the three earlier findings are fixed, and two fixes remain.

  • Miss: after set t padding '5px 0' --on dropdown-menu, set t padding '3px 2px' --on menus reports only padding-block on dropdown-menu as no longer showing although its padding-inline 0 is hidden too, because the note in _edit.mjs (lines 7301-7304) reads only the first side; run it for every side written.
  • The description says a refusal happens only when a side's own check refuses, but padding '10% 10%' and '0 0' on dropdown-menu are refused by the one-length check after boxSides collapses equal values (_check.mjs line 281), while '10% 5%' and '0 5px' are written; collapse only a value that is one working length, or narrow the claim.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: a padding of two to four values on a calc() part is written as its sides in one change (two: block and inline; three: top, inline and bottom; four: each side), verified by the calc-padding test and head runs.
  • Claim: the result names the sides and one bare undo takes back all of them, verified by the calc-padding test and a head run.
  • Claim: the same length said for every side is written as that one length with a note, verified for lengths by the calc-padding test and a head run.
  • Claim: each side is read by its own check, so 5px 10% writes padding-inline 10%, verified by the calc-padding test and a head run.
  • Claim: a value CSS defines and the part can take is written, and a refusal happens only when a side's own check refuses, false for one value said on every side that is not one working length (10% 10%, 0 0).
  • Claim: each side replaces the longhands it covers, and an earlier padding-left 9px comes back with the undo, verified by the calc-padding test and a head run.
  • Claim: a repeat that changes nothing says so with the typed value and claims no undo step, verified by the calc-padding test and head runs of the API and the text output.
  • Claim: a hand-edited saved entry is still checked as written, verified by code: only the typed value of set asks for sides.
  • Claim: the new optional asSides field names the typed value and the sides, and the status line leads with it, verified by head runs of set --json and the text output.
  • Claim: the earlier offered side lines are removed and the repair-gate coverage rule keeps a unit test, verified; the coverage rule is narrowed rather than kept as it was, which the wording understates.
  • Claim: one length, a variable and math functions are unchanged, and a two-length padding-inline on an item is still refused, verified by the palette test.
  • Claim: the listed tests exist and cover the listed cases, verified in the diff; the changed and neighbouring test files pass on the head.
  • Claim: the full-suite and typecheck tallies in the Testing section, partly reproduced: the changed and neighbouring files pass, and the JSON API typecheck is clean.
  • Changeset: writes the sides in one change, names them, one undo takes back all, and the same length on every side is that length, verified.
  • File .changeset/experimental-theme-calc-padding-sides.md: clear.
  • File packages/cli/api/theme-edit/_check.mjs: finding (equal non-length values are refused).
  • File packages/cli/api/theme-edit/_edit.mjs: finding (the masked-settings note reads only the first side).
  • File packages/cli/api/theme-edit/_normal.mjs: clear.
  • File packages/cli/api/theme-edit/_settings.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit.type.mjs: clear.
  • File packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-repair-gate-value-carry.test.mjs: clear.
  • File packages/cli/clients/cli/commands/experimental/theme.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/theme-edit/_edit.mjs Resolved
Comment thread packages/cli/api/theme-edit/_check.mjs Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 93e2bba

@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: the engineering owner's approval settles the direction, both earlier findings are fixed, and one description claim needs correcting.

  • The description says "A later setting that hides the sides names each side it hides", but after set q padding '5px 0' --on dropdown-menu, a later set q padding '1px 2px 3px 4px' --on menus hides both dropdown-menu sides and names neither (and '1px 2px 3px' names only padding-inline), because the note in _edit.mjs (lines 7301-7307) relies on maskedSettings, which matches only a later setting of the same side; narrow the claim to same-side settings, as for a plain side set, or extend the note to sides other longhands cover.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: a padding of two to four values on a calc() part is written as its sides in one change (two: block and inline; three: top, inline and bottom; four: each side), verified by the calc-padding test and head runs.
  • Claim: the result note names the typed value and the sides, and one bare undo takes back all of them, verified by the calc-padding test and a head run.
  • Claim: one working length said for every side is written as that length with a note, and an equal value that is no one length (10% 10%) is written as its sides, verified by the calc-padding test and head runs (0 0 too).
  • Claim: each side is read by its own check, so 5px 10% writes padding-inline 10%, verified by the calc-padding test.
  • Claim: a value CSS defines and the part can take is written, and a refusal happens only when a side's own check refuses, verified for two to four values; the one-value path is unchanged.
  • Claim: each side replaces the longhands it covers, and an earlier padding-left 9px comes back with the undo, verified by the calc-padding test.
  • Claim: a repeat that changes nothing says so with the typed value and claims no undo step, verified by the calc-padding test.
  • Claim: a later setting that hides the sides names each side it hides, false for three- and four-value group paddings (head runs with the built CSS); true for a same-side group padding.
  • Claim: a hand-edited saved entry is still checked as written, verified by code: only the typed value of set asks for sides.
  • Claim: the new optional asSides field names the typed value and the sides, and the status line leads with it, verified in the type, the result builder and the text formatter, unchanged since the last review's head runs.
  • Claim: the earlier offered side lines are removed and the repair-gate coverage rule keeps a unit test, verified; the rule is narrowed rather than kept as it was.
  • Claim: one length, a variable and math functions are unchanged, and a two-length padding-inline on an item is still refused, verified by the palette test.
  • Claim: the listed tests exist and cover the listed cases, verified; the two new cases fail on the previous revision and pass on this head.
  • Claim: the full-suite and typecheck tallies in the Testing section, partly reproduced: the changed and neighbouring files pass, and the JSON API typecheck is clean.
  • Changeset: writes the sides in one change, names them, one undo takes back all, and the same length on every side is that length, verified.
  • File .changeset/experimental-theme-calc-padding-sides.md: clear.
  • File packages/cli/api/theme-edit/_check.mjs: clear.
  • File packages/cli/api/theme-edit/_edit.mjs: finding (the description's hidden-sides claim overstates what the note reports).
  • File packages/cli/api/theme-edit/_normal.mjs: clear.
  • File packages/cli/api/theme-edit/_settings.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit.type.mjs: clear.
  • File packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-repair-gate-value-carry.test.mjs: clear.
  • File packages/cli/clients/cli/commands/experimental/theme.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/theme-edit/_edit.mjs Resolved
@josephfarina
josephfarina force-pushed the josephfarina/theme-calc-padding-sides branch from caad34d to e173ca5 Compare November 19, 2026 18:29
@josephfarina
josephfarina force-pushed the josephfarina/theme-calc-padding-write branch from 93e2bba to 889fb7e Compare November 19, 2026 18:29

@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 decision for this head, and one fix is needed after it.

The branch was rebased, and an /approve-spec decision covers only the head it names, so the earlier approval of writing a two-to-four-value padding as its sides, and of the new asSides result field, does not carry over. No current spec decides what the editor's set accepts or writes, so an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.

  • Miss: after set q padding 4px --on dropdown-menu, a later set q padding '5px 0' --on dropdown-menu keeps padding 4px saved beside the new sides with no note (_edit.mjs keys the change by its first side from line 5867), so the build still writes --_dropdown-menu-padding: 4px for the menu's row corners, undo q padding-inline --on dropdown-menu then says the base theme's value applies while the inline padding is 4px, and a hand-edited padding: 2px 6px entry survives set q padding '2px 6px' and keeps refusing the next command; remove and name an earlier setting of the typed shorthand in the same scope, as a plain set replaces its previous setting, and have the saved-entry refusal offer the whole value.

Every finding from the earlier reviews is fixed, and the narrowed claim about hidden sides matches the head.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: with the base pull request, a two-value padding on a calc() part is refused with the sides offered, verified by a base run.
  • Claim: the part takes padding-block, padding-inline and each physical side, verified by head runs.
  • Claim: set writes the shorthand as its sides in one change, each side read by its own check, so 5px 10% writes padding-inline 10%, verified by the calc-padding test.
  • Claim: two values become block and inline, three become top, inline and bottom, four become each side, verified by the calc-padding test.
  • Claim: the result note names the typed value and the sides, and one bare undo takes back all of them, verified by the calc-padding test and a head run.
  • Claim: one working length said for every side is written as that length with a note, and an equal value that is not one length (10% 10%) is written as its sides, verified by the calc-padding test.
  • Claim: a value the part can take is written and a refusal happens only when a side's own check refuses, verified for two to four values (5px auto is refused as padding-inline); the one-value path is unchanged.
  • Claim: each side replaces the longhands it covers, and an earlier padding-left 9px comes back with the undo, verified by the calc-padding test; an earlier padding itself is not replaced (finding).
  • Claim: a repeat that changes nothing says so with the typed value and claims no undo step, verified by the calc-padding test and a head run.
  • Claim: a later setting of the same side names each written side it hides, and a later setting of other longhands that cover it is not named, verified by the calc-padding test and head runs.
  • Claim: a hand-edited saved entry is still checked as written, and a hand-edited two-length padding still refuses the next command, verified by a head run.
  • Claim: the split helper gives the sides and the calc() check returns them only when set asks, verified in code.
  • Claim: the first side is the change's setting, the others are written in the same commit, each replaces its covered longhands, and the note is added, verified in code and tests.
  • Claim: the new optional asSides field names the typed value and the sides on the experimental result and in set --json, and the status line leads with it, verified by head runs.
  • Claim: the offered side lines are removed and the repair-gate coverage fix stays with a unit test, verified; the carry is kept only for a line that offers fewer tokens than were typed.
  • Claim: one length, a variable and math functions are unchanged, and a two-length padding-inline on an item is still refused, verified by the palette test and head runs.
  • Claim: after the change the menu's CSS has 5px top and bottom and 0 left and right, and one undo removes both, verified by a head run.
  • Claim: the listed tests exist and cover the listed cases, verified; they pass on this head.
  • Claim: the Testing section's tallies, partly reproduced: the changed and neighbouring test files pass and the JSON API typecheck is clean; the full suite, the API type sync, the structure check and Prettier were not rerun.
  • Claim: the one new public field is asSides on the experimental result, verified.
  • Changeset: writes the sides in one change, names them, one undo takes back all, and the same length on every side is that length, verified.
  • File .changeset/experimental-theme-calc-padding-sides.md: clear.
  • File packages/cli/api/theme-edit/_check.mjs: clear.
  • File packages/cli/api/theme-edit/_edit.mjs: finding (an earlier padding on the same part is not replaced by a two-to-four-value padding).
  • File packages/cli/api/theme-edit/_normal.mjs: clear.
  • File packages/cli/api/theme-edit/_settings.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit.type.mjs: clear.
  • File packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-repair-gate-value-carry.test.mjs: clear.
  • File packages/cli/clients/cli/commands/experimental/theme.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/theme-edit/_edit.mjs Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec d7c682c

@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: the engineering owner's approval of this head settles the direction, and the earlier-padding finding is fixed; one fix remains.

  • Setting padding '5px 0' --on dropdown-menu again after padding '3px 2px' --on menus has hidden its sides moves them back on top and adds an undo step, but the note stops at "undo q" (and with '5px 9px' names only padding-inline), because sidesChanged (packages/cli/api/theme-edit/_edit.mjs:6374) counts only sides whose saved entry is new; count every side that moves as changed.
Claims and files checked

Review mode: incremental; reason: none

  • Claim: before this change, the two-length padding was refused with offered side lines (verified: the removed boxSideLines in _check.mjs).
  • Claim: two, three and four values become block and inline, top, inline and bottom, and each side, in one change (verified: the sides test).
  • Claim: each side is read by its own check, so 5px 10% writes padding-inline 10% (verified: the sides test).
  • Claim: the result names the sides, and one bare undo takes back all of them (verified: the sides test and a head run).
  • Claim: one working length on every side is written as that length with a note, while 10% 10% is written as sides (verified: the sides test).
  • Claim: a refusal happens only when a side's own check refuses (verified: 5px auto is refused as padding-inline).
  • Claim: each side replaces the longhands it covers, and an earlier padding-left 9px comes back with the undo (verified: the sides test).
  • Claim: an earlier padding on the part is replaced, named, and restored by undo (verified: the sides test and a head run).
  • Claim: a repeat that changes nothing keeps every side in place and claims no undo step (verified: the sides test).
  • Claim: when only some sides change, the undo note names only those (verified for 5px 0 then 5px 2px; false when a hidden side moves, the finding above).
  • Claim: a later setting of the same side names each written side it hides (verified: the sides test).
  • Claim: a hand-edited saved entry is still checked as written and refuses the next command (verified: a head run).
  • Claim: asSides is on the experimental set result and --json, and the status line leads with it (verified: theme-edit.type.mjs:93, theme.mjs:597 and :600).
  • Claim: the CSS gives the menu top and bottom 5px and left and right 0 (verified: a head run).
  • Claim: one length, a variable and the calc functions are unchanged, and padding-inline '4px 8px' on an item is still refused (verified: the palette test).
  • Claim: the repair-gate fix stays with a unit test (verified: the repair-gate test).
  • Claim: typechecks, the CLI structure check and Prettier are clean (verified for the JSON-API typecheck, the structure check and Prettier; the strict typecheck's two errors are in unchanged template pages that import an unbuilt theme).
  • Claim: 483 of 492 test files pass (not rerun in full; the three changed test files pass).
  • Claim (changeset): the sides are written in one change, named, taken back by one undo, and one repeated length is written once (verified).
  • File .changeset/experimental-theme-calc-padding-sides.md: clear.
  • File packages/cli/api/theme-edit/_check.mjs: clear.
  • File packages/cli/api/theme-edit/_edit.mjs: the finding above.
  • File packages/cli/api/theme-edit/_normal.mjs: clear.
  • File packages/cli/api/theme-edit/_settings.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit.type.mjs: clear.
  • File packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-repair-gate-value-carry.test.mjs: clear.
  • File packages/cli/clients/cli/commands/experimental/theme.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/theme-edit/_edit.mjs Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec b38afd0

@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: the engineering owner's approval of this head settles the direction, and the earlier undo-note finding is fixed; one fix remains.

  • Miss: setting padding '5px 0' --on dropdown-menu again after a later padding-top 9px (or padding-left 9px) on the menu removes that longhand and adds an undo step that puts it back, but the first note stops at "undo q " because the undo clause (packages/cli/api/theme-edit/_edit.mjs:6835-6842) names only moved sides and an earlier typed padding; name the longhands the change removes too (for example "brings back padding-top = 9px on dropdown-menu"), so the clause is never empty.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: before this change, a two-length padding on the menu was refused with offered side lines (verified: the removed boxSideLines in _check.mjs and the removed test expectations).
  • Claim: two, three and four values become block and inline; top, inline and bottom; and each side, in one change (verified: the sides test).
  • Claim: each side is read by its own check, so 5px 10% writes padding-inline 10% (verified: the sides test).
  • Claim: the result names the sides, and one bare undo takes back all of them (verified for a first write and for a re-set over a group padding; the undo clause is empty when a re-set only removes a later longhand, the finding above).
  • Claim: one working length on every side is written as that length with a note, while 10% 10% is written as sides (verified: the sides test).
  • Claim: a refusal happens only when a side's own check refuses (verified: 5px auto is refused as padding-inline).
  • Claim: each side replaces the longhands it covers, and an earlier padding-left 9px comes back with the undo (verified: the sides test).
  • Claim: an earlier padding on the part is replaced, named and restored by undo (verified: the sides test).
  • Claim: a repeat that changes nothing keeps every side in place, says so with the typed value and claims no undo step (verified: the sides test and a head run).
  • Claim: when only some sides change, the undo note names only those (verified: the sides test).
  • Claim: a later setting of the same side names each written side it hides, and other covering longhands are not named (verified: the sides test).
  • Claim: a hand-edited saved entry is still checked as written (verified: the expansion flag is passed only for the typed set value, _edit.mjs:5564).
  • Claim: asSides is on the experimental set result and --json, and the status line leads with it (verified: theme-edit.type.mjs:93, theme.mjs:597 and :600).
  • Claim: the CSS gives the menu top and bottom 5px and left and right 0 (verified: a head run).
  • Claim: one length, a variable and the calc functions are unchanged, and padding-inline '4px 8px' on an item is still refused (verified: the palette test).
  • Claim: boxSideLines is removed and the repair-gate fix stays with a unit test (verified: the diff and the repair-gate test).
  • Claim: the CLI typechecks, the structure check and Prettier are clean (verified for the JSON-API typecheck, the structure check and Prettier; the strict typecheck's two errors are in unchanged template pages that import an unbuilt theme).
  • Claim: 483 of 492 test files pass (not rerun in full; the three changed test files pass).
  • Claim (changeset): the sides are written in one change, named, taken back by one undo, and one repeated length is written once (verified: the sides test).
  • File .changeset/experimental-theme-calc-padding-sides.md: clear.
  • File packages/cli/api/theme-edit/_check.mjs: clear.
  • File packages/cli/api/theme-edit/_edit.mjs: the finding above.
  • File packages/cli/api/theme-edit/_normal.mjs: clear.
  • File packages/cli/api/theme-edit/_settings.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit.type.mjs: clear.
  • File packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-repair-gate-value-carry.test.mjs: clear.
  • File packages/cli/clients/cli/commands/experimental/theme.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/theme-edit/_edit.mjs Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 9d13f83

@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 engineering owner's approval of this head settles the direction, and the earlier undo-note finding is fixed: setting the same padding again after a later padding-top on the menu now says that undo brings it back. No blocking findings remain.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: before this change, a two-length padding on the menu was refused with offered side lines (verified: the removed boxSideLines and its removed test expectations).
  • Claim: two, three and four values become block and inline; top, inline and bottom; and each side, in one change (verified: the sides test).
  • Claim: each side is read by its own check, so 5px 10% writes padding-inline 10% (verified: the sides test).
  • Claim: the result names the sides, and one bare undo takes back all of them (verified: the sides test and a head run).
  • Claim: one working length on every side is written as that length with a note, while 10% 10% is written as sides (verified: the sides test).
  • Claim: a refusal happens only when a side's own check refuses (verified: 5px auto is refused as padding-inline in a head run).
  • Claim: each side replaces the longhands it covers, and an earlier padding-left 9px comes back with the undo (verified: the sides test).
  • Claim: an earlier padding on the part is replaced, named and restored by undo (verified: the sides test and a head run).
  • Claim: a repeat that changes nothing keeps every side in place, says so with the typed value and claims no undo step (verified: the sides tests and a head run).
  • Claim: when only some sides change, the undo note names only those (verified: the sides test).
  • Claim: a later setting of the same side names each written side it hides, and other covering longhands are not named (verified: the sides test).
  • Claim: a hand-edited saved entry is still checked as written, and a hand-edited padding: 2px 6px refuses the next command (verified: a head run; the expansion is asked only for the typed set value, _edit.mjs:5564).
  • Claim: asSides is on the experimental set result and --json, and the status line leads with it (verified: theme-edit.type.mjs:93, theme.mjs:597 and :600).
  • Claim: the CSS gives the menu top and bottom 5px and left and right 0, and one undo removes both (verified: a head run and the sides test).
  • Claim: one length, a variable and the calc functions are unchanged, and padding-inline '4px 8px' on an item is still refused (verified: the palette test).
  • Claim: boxSideLines is removed and the repair-gate fix stays with a unit test (verified: the diff and the repair-gate test).
  • Claim: the CLI typechecks, the API type sync, the structure check and Prettier are clean (verified for the JSON-API, template-docs and authoring typechecks, the API type sync, the structure check and Prettier; the strict typecheck's two errors are in unchanged template pages that import an unbuilt theme).
  • Claim: 483 of 492 test files pass, the failures matching main (verified for the three changed test files, 162 tests; the full run was not repeated).
  • Claim (changeset): the sides are written in one change, named, taken back by one undo, and one repeated length is written once (verified: the sides test).
  • File .changeset/experimental-theme-calc-padding-sides.md: clear.
  • File packages/cli/api/theme-edit/_check.mjs: clear.
  • File packages/cli/api/theme-edit/_edit.mjs: clear.
  • File packages/cli/api/theme-edit/_normal.mjs: clear.
  • File packages/cli/api/theme-edit/_settings.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit.type.mjs: clear.
  • File packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-repair-gate-value-carry.test.mjs: clear.
  • File packages/cli/clients/cli/commands/experimental/theme.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 9ce34ac

josephfarina and others added 11 commits November 20, 2026 17:17
…the same value on every side collapses only when it is one working length

[skip ci]
…g on the part, and a repeat that changes nothing keeps every side in place

[skip ci]
…so a padding written as sides is offered as working

[skip ci]
…epeat whose later side carries a note adds no undo step

[skip ci]
…ver a stale build claims no undo step

[skip ci]
@josephfarina
josephfarina force-pushed the josephfarina/theme-calc-padding-write branch from 9361f65 to a1eb90e Compare November 21, 2026 01:17
@github-actions github-actions Bot removed needs:design-review Affects visuals — Design should review needs:spec-owner-review Current knowledge records await owner approval labels 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 decision for this exact head; no code changes are needed.

No current spec decides that set writes a two-to-four value padding on a part that reads its padding inside calc() (dropdown-menu, segmented-control, the menus group) as its sides in one undoable change, that how offers that whole-value line, or the new experimental asSides result field. The earlier /approve-spec comments name older heads, and the decision binds one exact head, so an engineering owner identifies the governing spec or records the decision by commenting /approve-spec <full head SHA> on this head; the author may do so as an engineering owner. The last review's two blockers are fixed here: the branch now carries only its own 12 files, and the CLI's strict typecheck passes.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: a two-to-four value padding on a part that reads it inside calc() is written as its sides in one change (verified: the sides tests and command-line runs).
  • Claim: before this change, main refused it and offered the side lines (verified: a command-line run on main).
  • Claim: two, three and four values become block and inline; top, inline and bottom; and each side, and one undo takes back all of them (verified: the sides tests and command-line runs).
  • Claim: each side is read by its own check, so 5px 10% writes padding-inline 10% (verified: a command-line run and the sides test).
  • Claim: one working length on every side is written once with a note, while 10% 10% is written as sides (verified: a command-line run and the sides tests).
  • Claim: each side replaces the longhands it covers, and an earlier padding on the part is replaced, named and restored by undo (verified: the sides tests).
  • Claim: a repeat that changes nothing keeps every side, names the typed value and claims no undo step, also over a stale or missing build (verified: the sides tests and a command-line run).
  • Claim: the undo note names only the sides a change changes (verified: the sides test).
  • Claim: a later setting of the same side names each written side it hides (verified: the sides test).
  • Claim: how offers the whole-value set line, never the first length alone (verified: the sides test and runs on main and this head).
  • Claim: a state word read as another state is said once for every side (verified: the sides test).
  • Claim: a hand-edited saved entry is still checked as written and offered back whole (verified: the sides test).
  • Claim: asSides is on the experimental set result and --json, and the status line leads with it (verified: command-line runs).
  • Claim: the offered side lines are replaced, and the repair-gate coverage fix keeps a unit test (verified: the diff and the repair-gate test).
  • Claim: one length, a variable and calc() are unchanged, and padding-inline '4px 8px' on an item is still refused (verified: the palette test).
  • Claim: no separable tag-alongs, and asSides is the only new API (verified: the diff at this head).
  • Claim: one defect is restored (not settled: the write is new behaviour that waits on the owner decision above).
  • Claim: the CLI typechecks, the API type sync, the CLI structure check and Prettier are clean (verified: each run at this head).
  • Claim: the listed test run passes apart from nine environment failures (partly verified: the three changed and seventeen neighbouring test files pass; the full run was not repeated).
  • Changeset: set now writes the sides in one change, the result names them, one undo takes back all, and one working length is written once (verified: command-line runs); its "before" text (verified: runs of the code before the side lines landed).
  • File .changeset/experimental-theme-calc-padding-sides.md: clear.
  • File packages/cli/api/theme-edit/_check.mjs: clear.
  • File packages/cli/api/theme-edit/_edit.mjs: clear.
  • File packages/cli/api/theme-edit/_how-commands.mjs: clear.
  • File packages/cli/api/theme-edit/_normal.mjs: clear.
  • File packages/cli/api/theme-edit/_settings.mjs: clear.
  • File packages/cli/api/theme-edit/_vet.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit.type.mjs: asSides waits on the owner decision.
  • File packages/cli/clients/cli/commands/experimental/theme.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-repair-gate-value-carry.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 decision for this exact head; no code changes are needed.

No current spec decides that set writes a two-to-four value padding on a part that reads its padding inside calc() (dropdown-menu, segmented-control, the menus group) as its sides in one undoable change, what its replace and undo notes say, that how offers that whole-value line, or the new experimental asSides result field. The earlier /approve-spec comments name older heads, and the decision binds one exact head, so an engineering owner identifies the governing spec or records the decision by commenting /approve-spec <full head SHA> on this head; the author may do so as an engineering owner. The new commit's note fix checks out: the undo note now names back only entries undo restores, and its test passes.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: a two-to-four value padding on a part that reads it inside calc() is written as its sides in one change (verified: the sides tests).
  • Claim: before this change, main refused it and offered the side lines (verified: the refusal code on main and the earlier command-line run).
  • Claim: two, three and four values become block and inline; top, inline and bottom; and each side, and one undo takes back all of them (verified: the sides tests).
  • Claim: each side is read by its own check, so 5px 10% writes padding-inline 10% (verified: the sides test).
  • Claim: one working length on every side is written once with a note, while 10% 10% is written as sides (verified: the sides tests).
  • Claim: a refusal happens only when a side's own check refuses that side's value (verified: each side goes through the setting check).
  • Claim: each side replaces the longhands it covers, and an earlier side comes back with undo (verified: the sides test).
  • Claim: an earlier padding on the part is replaced and named, and undo brings it back only when the editor still accepts it, with no promise for a refused hand edit (verified: two sides tests and a probe of the following undo).
  • Claim: a repeat that changes nothing keeps every side, names the typed value and claims no undo step, also over a stale or missing build (verified: the sides tests).
  • Claim: the undo note names only the sides a change changes (verified: the sides test).
  • Claim: a later setting of the same side names each written side it hides, and other covering longhands are not named (verified: the sides test and the note code).
  • Claim: how offers the whole-value set line, never the first length alone (verified: the sides test).
  • Claim: a state word read as another state is said once for every side (verified: the sides test).
  • Claim: a hand-edited saved entry is still checked as written (verified: the stored check runs without the sides flag, and the sides test).
  • Claim: asSides is on the experimental set result and --json, and the status line leads with it (verified: the type and the formatter).
  • Claim: the offered side lines are replaced, and the repair-gate coverage fix keeps a unit test (verified: the diff and the repair-gate test).
  • Claim: one length, a variable and calc() are unchanged, padding-inline '4px 8px' on an item is still refused, and a hand-edited padding: 2px 6px still refuses the next command (verified: the palette and sides tests).
  • Claim: no separable tag-alongs, and asSides is the only new API (verified: the diff).
  • Claim: one defect is restored (not settled: the write is new behaviour that waits on the owner decision above).
  • Claim: the CLI typechecks, the API type sync, the CLI structure check and Prettier are clean (partly verified: the strict typecheck has no error in the changed code and Prettier is clean; the other checks were not repeated for this note-only commit).
  • Claim: the listed test run passes apart from nine environment failures (partly verified: the three changed test files pass; the full run was not repeated).
  • Changeset: set now writes the sides in one change, the result names them, one undo takes back all, one working length is written once, and its "before" text describes the last release (verified: the tests and the code before the side lines landed).
  • File .changeset/experimental-theme-calc-padding-sides.md: clear.
  • File packages/cli/api/theme-edit/_check.mjs: clear.
  • File packages/cli/api/theme-edit/_edit.mjs: clear.
  • File packages/cli/api/theme-edit/_how-commands.mjs: clear.
  • File packages/cli/api/theme-edit/_normal.mjs: clear.
  • File packages/cli/api/theme-edit/_settings.mjs: clear.
  • File packages/cli/api/theme-edit/_vet.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit.type.mjs: asSides waits on the owner decision.
  • File packages/cli/clients/cli/commands/experimental/theme.mjs: clear.
  • File packages/cli/api/theme-edit/theme-edit-calc-padding-sides.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-palette.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-repair-gate-value-carry.test.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina marked this pull request as ready for review November 21, 2026 03:04
@josephfarina

Copy link
Copy Markdown
Contributor Author

Covers the theme-editor behavior this pull request decides (the owner's ruling): on a part whose padding Core reads inside calc(), two to four padding values are written as their sides in one change, each side value checked on its own; one bare undo takes them all back; the same length on every side is written as that one length; how offers that whole-value line; and the experimental set --json result gains an asSides field naming the typed value and the sides written.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 3352125

josephfarina added a commit that referenced this pull request Nov 21, 2026
josephfarina added a commit that referenced this pull request Nov 21, 2026
- #12742 fix(cli): a padding of two to four lengths where only one works is written as its sides
  Author: @josephfarina
- #13185 chore(theme editor): a status border is measured like the icon, so its own exemption and note go
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #13189.

@github-actions
github-actions Bot deleted the josephfarina/theme-calc-padding-write branch November 22, 2026 06:04

This branch was successfully deployed

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