Skip to content

experimental theme pictures: a change removes the pictures cut from a tall one - #13200

Merged
josephfarina merged 2 commits into
feature/theme-editorfrom
theme-change-removes-cut-pictures
Nov 21, 2026
Merged

josephfarina merged 2 commits into
feature/theme-editorfrom
theme-change-removes-cut-pictures

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A theme editor change removes the pictures that no longer show the theme (preview.png, sheet-inputs.png …), so none keeps showing the old look. A family picture taller than about 1600px is cut into sheet-<family>-1.png, -2 and so on, and a change left those cut pictures in place. They kept showing the theme as it was before the change.

Problem and solution fit

  • Why were they kept? The removal matched sheet(-<family>)?.png only, so a numbered cut picture never matched.
  • Why does it matter? A reader who opens sheet-containers-1.png after a change sees the old look and judges the wrong theme.
  • The fix: the removal also matches the numbered cut pictures, and a cut picture the running command takes again (its --png) is kept, as an uncut one is. A change whose build fails puts the cut pictures back too, as it does the others.

Expected behavior and authority

This follows the existing rule in buildThemeSteps: the pictures the editor recorded that no longer match the build are removed and named, with the command that takes them again.

Smallest restoration

One regex and the retaken check in _settings.mjs, and the same regex in the copy a change keeps to put pictures back when its build fails (_edit.mjs).

Evidence

  • Before: after set t corners square, sheet-containers-1.png and sheet-containers-dark-2.png were still on disk.
  • After: both are removed, and the result names them, with show t --png --section containers to take them again.
  • Regression test: theme-change-removes-cut-pictures.test.mjs. It fails on main (the cut picture is still there) and passes here.

Scope

Components: experimental theme editor pictures (CLI)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • CI=1 vitest run --project node packages/cli/api/theme-edit/theme-change-removes-cut-pictures.test.mjs: 1 passed here, 1 failed on main.

replay: worse 0 at cd550f0

preflight: pass cd550f0 (review deferred to batch: subagent cap)

… tall one with the others

A family picture taller than about 1600px is cut into sheet-<family>-1.png,
-2 and so on, but a change removed only uncut pictures, so the cut ones
kept showing the theme as it was. A change now removes them with the
others, and a cut picture the running command takes again is kept.
@vercel

vercel Bot commented Nov 21, 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:50am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 7:03 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · cd550f0

Storybook · Sandbox · built from this PR's head

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.

Approval waits on an engineering owner's decision, and the change itself needs nothing fixed.

No current record says which of the theme editor's pictures a change removes: architecture:cli-surface holds the CLI's contract and spec:AST-050 carries the editor's decisions, and neither mentions the pictures, while spec:AST-017 FR22 covers only the [experimental] patch changeset, which this meets. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and you may do so yourself if you are an engineering owner; otherwise the rule belongs in one of those two records first.

No blocking findings.

The fix reads correctly and is proven: the new test fails on main and passes here, a run of editor set on each revision shows the three recorded cut pictures surviving before the change and removed and named after it, and seven neighbouring picture test files (36 tests) pass on this head. Two non-blocking notes, both in the inline comments: the retaken half of the fix has no test, and the cut name -<n>.png is now written in four places across two modules.

Claims and files checked

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

  • Changeset, a change removes the pictures cut from a tall family picture with the others: verified (the widened picture test; the three recorded pieces go in a run on this head and stay in the same run on the base).
  • A family picture taller than about 1,600 px is cut into numbered pictures: verified (the family picture height, the cutting helper and the page cutter that names the pieces).
  • A change left the cut pictures in place before this fix: verified (the new test is red on the base with the piece still on disk).
  • The removal matched only the uncut names: verified (the base's picture test).
  • A cut picture the running command takes again is kept, as an uncut one is: verified (the retaken filter; a section run leaves that family's pieces out of the note exactly as it leaves the whole picture out).
  • The fix is one regex and the retaken check in one file: verified (the only source change).
  • The new test passes here and fails on main: verified by running both.
  • No new public API, default or interaction model: verified (no command, option, exported signature or type changes).
  • Public text carries no internal context: verified over the added lines, title, body, branch name and commit message.
  • Files: the editor settings module (clear, the two hunks are the whole change), the new regression test (clear, red on the base; its gap is the missing retaken case), the changeset (clear, [experimental] and patch, and the changeset check passes), the recorded test times (clear, one entry in sorted place, no other entry touched).

Automated review (maintainer link)

p => !retaken.has(p.slice(p.lastIndexOf('/') + 1)),
p =>
!retaken.has(
p.slice(p.lastIndexOf('/') + 1).replace(/-\d+(?=\.png$)/, ''),

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: nothing tests this half. The new test covers the removal, so dropping the -\d+ normalisation here would keep every test green while show t --png --section inputs started naming the pictures it is about to take again. A case that records sheet-inputs-1.png, runs that command and asserts the note leaves it out would hold it.

? fs.readdirSync(f.dir).filter(
n =>
// A picture cut from a tall one too (sheet-inputs-2.png).
/^(preview(-dark)?|sheet(-[a-z][a-z-]*)?(-\d+)?)\.png$/.test(n) &&

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: with this line the cut name -<n>.png is written four times — here, at the retaken filter below, at the note's section match, and in pagesOfPicture, which builds the names in _context.mjs. The drift between two of those spellings is what this pull request fixes, so one shared name test beside the code that writes the pieces would keep them together.

…he cut pictures too

A change keeps a copy of the pictures it may remove and puts them back
when its build fails; the copy matched uncut pictures only, so a cut one
(sheet-inputs-2.png) removed by the failed build stayed gone.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec cd550f0

@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 because the pull request is a draft, and it runs once the pull request is marked ready for review.

An engineering owner's /approve-spec for this head settles which of the theme editor's pictures a change removes and puts back, which no current record states. No blocking findings.

Two non-blocking points, both in the inline comments:

  • Neither guard of the fix has a test: the put-back of cut pictures in show (_edit.mjs) and the retaken filter in _settings.mjs.
  • The cut-picture name is now written in six places across three modules, so one shared name test beside the code that cuts the pictures would keep them from drifting again.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Changeset, a change removes the pictures cut from a tall family picture with the others: verified (the widened removal test; the new test fails on the base and passes here).
  • Changeset, a change that fails to build puts them back with the others: verified (a refused set and a refused show both leave every recorded cut picture in place here).
  • Description, a change removes the pictures that no longer show the theme: verified (the existing removal step).
  • Description, a family picture taller than about 1,600 px is cut into numbered pictures: verified (the family picture height constant and the cutting helper that names the pieces).
  • Description, before this fix a change left the cut pictures in place, showing the old look: verified (red-first test on the base; a run of set on the base keeps them and names only the uncut picture).
  • Description, the removal matched only uncut names: verified (the base's removal pattern).
  • Description, the fix removes the numbered pictures too: verified (the widened pattern and the run of set here).
  • Description, a cut picture the running command takes again is treated as an uncut one is: verified from the code (left out of the removed note and taken again; not covered by a test).
  • Description, a change whose build fails puts the cut pictures back too: verified (refused set and show runs here).
  • Description, this follows the build step's existing rule for recorded pictures: verified.
  • Description, the smallest restoration is one pattern and the retaken check in the settings module and the same pattern in a put-back copy in the edit module: verified; the copy is the show command's, and the case it newly covers is a show refused after its rebuild, since a failed build is already put back by the build's own rollback.
  • Description, the before and after evidence for set with two cut pictures: verified (red-first and the run here).
  • Description, the new test fails on main and passes here: verified by running both.
  • Description, no new public API, visual representation, default or interaction model: verified (no command, option, export or type changes).
  • Description, public text carries no internal context: verified over the added lines, title, body, branch name and commit messages.
  • File .changeset/experimental-theme-change-removes-cut-pictures.md: clear (experimental tag, patch bump, accurate).
  • File packages/cli/api/theme-edit/_edit.mjs: clear (the put-back pattern covers everything the build removes; untested, non-blocking).
  • File packages/cli/api/theme-edit/_settings.mjs: clear (the retaken half is untested, non-blocking).
  • File packages/cli/api/theme-edit/theme-change-removes-cut-pictures.test.mjs: clear (red on the base, green here; covers the removal only).
  • File scripts/vitest-node-durations.json: clear (one entry in sorted place).

Automated review (maintainer link)

/\.(css|js|d\.ts|css\.d\.ts|variants\.d\.ts)$/.test(n)) ||
/^(sheet-[a-z-]+\.html|(sheet|preview)(-[a-z-]+)?\.png)$/.test(n),
// (A picture cut from a tall one, sheet-inputs-2.png, too.)
/^(sheet-[a-z-]+\.html|(sheet|preview)(-[a-z-]+)?(-\d+)?\.png)$/.test(

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: nothing tests this line. Without it, a show refused after rebuilding a stale build (a render that fails, say) loses the cut pictures the rebuild removed, as the earlier commit did; a failing build is already put back by the build’s own rollback, so this is the case it covers. A test that records sheet-containers-1.png, deletes t.css, makes the render fail and asserts the picture is still there would hold it.

@josephfarina
josephfarina marked this pull request as ready for review November 21, 2026 08:19
@josephfarina
josephfarina changed the base branch from main to feature/theme-editor November 21, 2026 17:22
@josephfarina
josephfarina merged commit a332157 into feature/theme-editor Nov 21, 2026
89 of 135 checks passed
josephfarina added a commit that referenced this pull request Nov 21, 2026
…hole, cut between pages and named (#13199)

Reviewed pull request #13199, merged into the theme working branch with only its own changes (the layer below it, #13200, is already here). It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
… tall one (#13200)

Reviewed pull request #13200, merged into the theme working branch. It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
…hole, cut between pages and named (#13199)

Reviewed pull request #13199, merged into the theme working branch with only its own changes (the layer below it, #13200, is already here). It reaches main with the branch's next landing.
josephfarina added a commit that referenced this pull request Nov 21, 2026
- #12787 experimental theme: a pressed or hovered part's flat tint is measured as the fill it is
- #13252 experimental theme: a one-color layer is a fill only where it covers the whole box
- #13300 experimental theme: a fill and its on-color set inside a part are measured as that part draws them
- #13321 experimental theme: a part's fill pair is measured though its on-color is set for the whole theme
- #13360 experimental theme: an on-color set on a part holding the readers leaves the fill pair out
- #12768 feat(cli): experimental theme editor show <theme> --on <part> gives what one part of a theme shows
- #13057 experimental theme pictures: sheet cells are never narrower than what they hold, and a panel over the page is drawn at its cell's full width
- #13200 experimental theme pictures: a change removes the pictures cut from a tall one
- #13199 experimental theme pictures: the pages section draws the sample app whole, cut between pages and named
- #13320 fix(cli): corners said before their edge run after it, so the whole answer does both
- #13375 experimental theme how: a clashing fill's text color goes in that fill's choice
- #13411 experimental theme how: a clash with a see-through fill joins its text too; another look's text leaves it joined
- #13420 fix(cli): experimental theme editor - glossy writes no sample gradient
- #13452 test(cli): the said-order test reads a named corner as that corner
- #13262 fix(cli): experimental theme editor - an ask that starts with clear the and names only removable looks takes them away
- #13450 fix(cli): experimental theme editor - a bar's text token is checked in the menus its items open
- #13442 feat(cli): a light neutral also fills the page, surface and card backgrounds in light mode
- #13477 docs(changeset): the clear reading takes looks away for one part
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed on main in #13470.

@github-actions
github-actions Bot deleted the theme-change-removes-cut-pictures branch November 22, 2026 06:04

This branch was successfully deployed

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