Repository navigation
experimental theme pictures: a change removes the pictures cut from a tall one - #13200
Conversation
… 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
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).
| p => !retaken.has(p.slice(p.lastIndexOf('/') + 1)), | ||
| p => | ||
| !retaken.has( | ||
| p.slice(p.lastIndexOf('/') + 1).replace(/-\d+(?=\.png$)/, ''), |
There was a problem hiding this comment.
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) && |
There was a problem hiding this comment.
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.
|
/approve-spec cd550f0 |
There was a problem hiding this comment.
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).
| /\.(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( |
There was a problem hiding this comment.
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.
- #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
|
Landed on main in #13470. |
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 intosheet-<family>-1.png,-2and 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
sheet(-<family>)?.pngonly, so a numbered cut picture never matched.sheet-containers-1.pngafter a change sees the old look and judges the wrong theme.--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
set t corners square,sheet-containers-1.pngandsheet-containers-dark-2.pngwere still on disk.show t --png --section containersto take them again.theme-change-removes-cut-pictures.test.mjs. It fails onmain(the cut picture is still there) and passes here.Scope
Components: experimental theme editor pictures (CLI)
Testing
CI=1 vitest run --project node packages/cli/api/theme-edit/theme-change-removes-cut-pictures.test.mjs: 1 passed here, 1 failed onmain.replay: worse 0 at cd550f0
preflight: pass cd550f0 (review deferred to batch: subagent cap)