Skip to content

Per-side wall thickness and lid tolerance; fix Back/Forward - #2

Merged
joshmarinacci merged 3 commits into
mainfrom
fix-walls-and-history
Nov 20, 2026
Merged

joshmarinacci merged 3 commits into
mainfrom
fix-walls-and-history

Conversation

@joshmarinacci

Copy link
Copy Markdown
Owner

Summary

Fixes the two known issues listed in #1.

Wall thickness and lid tolerance now apply per side

  • Before: the floor got the full Wall thickness but each side wall only half, because the cavity was width − thick wide. Lid tolerance was the total gap split across both sides, and the lid's insert ring also had half-thickness walls.
  • Now: the floor, every side wall and the lid ring are all Wall thickness thick, and Lid tolerance is the clearance on each side.
  • The default lid tolerance drops from 2 mm to 0.4 mm, since 2 mm per side would be very loose.
  • boxToSolids names each size reduction (cavityShrink, plugShrink, holeShrink) so the per-side arithmetic is explicit.

Back/Forward through edits

  • Restoring a history entry no longer pushes a new one. Previously, pressing Back added an entry a second later, which wiped out Forward.
  • The entry the page loads on now gets a state, so Back returns to the starting box. It used to fail to parse and do nothing.
  • Going back cancels an edit still waiting on the 1 s save debounce.
  • An entry without valid state falls back to the ?data= in its URL.

Behavior change to note

Saved and shared links render differently. A link with wallThickness: 2 now gives 2 mm side walls instead of 1 mm, and a correspondingly smaller interior. Its lid tolerance means per side too. There is no versioning to keep old links unchanged.

Testing

  • New regression tests, confirmed failing on main:
    • 3 geometry tests compare box and lid volumes to closed-form rounded-rectangle formulas, so they pin down actual wall thickness and clearance.
    • 4 history tests drive real jsdom pushState / back / forward.
  • npm run typecheck, npm run lint, npm test (43 tests) and npm run build all pass.
  • In the browser (dev server):
    • Two typed edits created exactly two history entries.
    • Back twice returned to 40 × 10 × 10 and then to the original 10 × 10 × 10 with a clean URL; Forward returned to 40 × 10 × 10.
    • The history length never grew while navigating, and the thicker walls are visible.
  • Not tested: a printed box and lid at the new 0.4 mm default.

🤖 Generated with Claude Code

joshmarinacci and others added 3 commits November 20, 2026 13:19
Each side wall was half the Wall thickness setting (the cavity was
`width - thick` wide), while the floor got the full value. Lid tolerance was
likewise the total gap, split between the two sides, and the lid's insert ring
had half-thickness walls too.

Now the floor, every side wall and the lid ring are all Wall thickness thick,
and Lid tolerance is the clearance on each side. The default tolerance drops
from 2 to 0.4 mm, since 2 mm per side would be very loose.

Saved links keep their numbers but now produce thicker walls and a smaller
interior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Restoring a history entry no longer pushes a new one, which had wiped out
  Forward and kept Back from stepping through edits.
- The entry the page loads on now gets a state via replaceState, so Back can
  return to the starting box (it used to fail to parse and do nothing).
- Going back cancels an edit still waiting on the 1 s save debounce.
- An entry without valid state falls back to the ?data= in its URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joshmarinacci
joshmarinacci merged commit 8c09e81 into main Nov 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant