Skip to content

Block 3D export while a rebuild starts, so it can't mix two builds - #212

Merged
vycdev merged 3 commits into
developfrom
fix/export-during-rebuild
Nov 19, 2026
Merged

vycdev merged 3 commits into
developfrom
fix/export-during-rebuild

Conversation

@vycdev

@vycdev vycdev commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Downloading a 3MF (or STL, or using Open in Slicer) in the half second after clicking Build exported the previous build's mesh with the new build's settings. Rebuilding a routed multi-head model as single-head and exporting in that window gave the 36 old routed objects with their head 1/2 extruders, but a single-head nozzle_diameter and no M600 swap pause: a silently wrong print. Mouse users can't hit it because the build overlay covers the Download button, but keyboard and screen-reader users could, since the overlay didn't make the buttons behind it inert.

The cause: applyThreeDState publishes the new build settings immediately, while window.__KROMACUT_LAST_MESH kept the old mesh until ThreeDView started the new build (120 ms debounce, a bounding-box scan, then an idle callback).

Now:

  • Publishing new build settings clears the exported mesh, so an export in that window reports "3D model not ready yet" instead of mixing builds.
  • ThreeDView reports when it is building. While a build starts or runs, the 3D download menu is disabled (Download STL/3MF, Open in Slicer, Choose Slicer), and the preview actions behind the build overlay are inert.
  • The STL and 3MF export callbacks also refuse while a build starts or runs. This covers exports that start later and skip the menu, such as Open in Slicer after a slow saved-slicer check (with Export the current build's settings when Open in Slicer's slicer check is slow #205 that check calls the latest callback). It also covers build A finishing and republishing its mesh just after build B's settings are published.
  • An older build's start no longer clears the "starting" state of a newer Build request that is still preparing.

Proof: the new @smoke spec tests/e2e/export-during-rebuild.spec.ts holds a multi-head → single-head rebuild open by queueing idle callbacks. It fails on develop (old mesh still exported) and passes with the fix. Removing only inert makes its Tab-sweep check fail. With the UI gating and the early mesh clear temporarily removed, a keyboard Download 3MF during the held rebuild still showed "3D model not ready yet" and downloaded nothing, from the export guard alone. tsc -b, lint, npm test and npm run test:e2e:all (all 8 suites) pass on this head. A local merge with current develop (including #205) typechecks and passes npm test.

Council review

Rounds: 3

Delegate Round 1 Round 2 Round 3
Claude Opus 5.5 9/10 9/10 9/10
GPT-6.2 Sol 7/10 8/10 9/10

Fixed from review: export callbacks refuse while a build is busy; a stale build acknowledgement can't end a newer request's preparation state; the Tab sweep checks every preview action, not just the disabled download trigger. Declined: closing the portaled preview-mode picker during builds (it only changes render mode), a separate preparation-phase test (old mesh and old settings still match then), stronger after-build assertions, and test-only nits.

🤖 Generated with Claude Code (Claude Opus 5.5 in T3 Code; reviews by Claude Opus 5.5 and GPT-6.2 Sol)

vycdev and others added 3 commits November 19, 2026 22:44
Clicking Build published the new settings right away, but the previous mesh
stayed exported until ThreeDView started the new build, so an export in that
window paired the old mesh with the new settings. Clear the exported mesh when
the settings are published, disable the download menu while a build starts
or runs, and make the preview actions behind the build overlay inert.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ting flag

Exports that start later, such as Open in Slicer after a slow slicer check,
skip the disabled menu, so the export callbacks refuse while a build starts
or runs. An older build's start no longer clears the starting flag of a newer
request that is still preparing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vycdev
vycdev merged commit 533e2f1 into develop Nov 19, 2026
11 checks passed
vycdev added a commit that referenced this pull request Nov 20, 2026
Merge the four Open in Slicer bullets into one entry for the shipped
flow, fold Multi-head filament requirements into Multi-head printing,
and move the decode-once image work into its own Changed entry. Move
touch-up history fixes that predate v4.3 into Fixed, add the missing
diagnostics folder fix, and reduce the cats benchmark entry to one
Fixed line. Fold in the notes from PRs merged since (#203, #205, #206,
#208, #209, #210, #212, #213) and trim test-only and maintenance
details that do not help users.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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