Repository navigation
Preserve the first-layer offset when color swatches change - #178
Merged
Merged
Conversation
JohnSt99
marked this pull request as ready for review
November 16, 2026 22:34
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The height sync now preserves edits across reconciliation, so the reset order must reach prevOrderRef, and a First Layer Height change made while no colors are shown must apply when they return. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The stale height array can be off the new first-layer grid after a setting change made without an image, and normalizing it overwrote the reconciled heights and the pending first-layer reset. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 19, 2026
This was referenced Nov 19, 2026
Merged
This was referenced Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #164. Second focused split from #156, based independently on
develop(93b4be6).Swatch reconciliation preserves the first displayed color on the
max(layerHeight, firstLayerHeight) + n * layerHeightlattice. A valid 0.28 mm height with 0.08 mm layers and a 0.20 mm first layer stays 0.28 mm after recomputation. The hook retains slider edits and avoids normalizing an outdated height array while a larger or smaller palette is being reconciled. Other colors keep normal-layer rounding.The React-free helper has node:test coverage for repeated reconciliation with changing storage order, six layer/first-layer combinations, unchanged non-first rounding, and the actual manual swap plan. Native Playwright cases cover default order and a manually reordered first color, including resizing that changes palette size and repeated Undo/Redo.
Validation:
403fc9f: lint/build; 198 browser tests across all 8 suites; 1,154 unit tests passed, 1 skipped across 92 files usingnode --no-warnings --experimental-strip-types --test --test-concurrency=1 tests/*.test.ts.656d958: fresh lint/build, 3 first-layer unit tests, and 25 related browser tests pass, including both first-layer cases, shared-canvas/history, profiled 3D exports and physical-layer preview. The manual-order case reproduced a lost height before the follow-up guard.The aggregate
npm testrunner encountered a 60-second Vite SSR module-import timeout in unchanged Auto-paint/multi-head modules on this machine, both on the mounted drive and in a native Linux checkout. Per-file isolation completed the entire suite; no test-runner changes are included. Upstream CI requires maintainer action before jobs can run; the final full CI run is still pending.Maintainer review follow-up
Three commits on top of
656d958, from the council review. They are needed because heights are now kept across swatch changes:handleResetHeightsupdatesprevOrderRef. Before this, a later swatch change brought back the old order but kept the reset heights.filteredchanges, so the stale height array can't overwrite the reconciled heights. This replaces the length-only guard. Without it, changing First Layer Height to 0.25 mm with no image and then pressing Undo gave 0.49 mm.Proof at
290a267, run locally:npm test(1154 passed, 1 skipped),check:e2e, and every area e2e suite.image-decode-reusefail here and on unchangeddevelop. dnd-kit blocks clicks for 50 ms after a drag, and this machine's timing triggers that.developCI passes them.Council review
Rounds: 4