Skip to content

feat(editor): expose printable STL export - #727

Open
nicemit wants to merge 2 commits into
pascalorg:mainfrom
nicemit:feat/expose-print-stl-export
Open

feat(editor): expose printable STL export#727
nicemit wants to merge 2 commits into
pascalorg:mainfrom
nicemit:feat/expose-print-stl-export

Conversation

@nicemit

@nicemit nicemit commented Aug 28, 2026

Copy link
Copy Markdown

What does this PR do?

Exposes printable STL export in the settings panel Export section. Users can now download printable STL files (as a zip) via a dedicated button, using the same safe print profile as the existing 3MF export (printScale: 100, printScope: levels, printContent: structure, printBase: none).

Follow-up to Discussion #331 — exposes the existing internal print-stl export path in the Settings UI.

How to test

  1. Run bun dev and open http://localhost:3002
  2. Open or create a project with printable geometry
  3. Open the sidebar → Export section
  4. Confirm both Export 3D print 3MF and Export 3D print STL files buttons are visible
  5. Click Export 3D print STL files — a zip should download
  6. Click Export 3D print 3MF — still works as before
  7. Run bun --cwd packages/editor run test -- print-export-button

Screenshots / screen recording

Screenshot_20260828_140351

Screenshot shows the new "Export 3D print STL files" button alongside the existing 3MF export in the Export panel.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

Low Risk
UI-only wiring to an existing print-stl export path with unchanged preflight and export options; no auth or data-model changes.

Overview
Adds a second Export 3D print STL control next to the existing 3MF button in the settings Export section, so users can download printable STL (zip) from the same UI.

preparePrintExport now takes an explicit print-3mf or print-stl format instead of always calling print-3mf; both paths still use the same fixed safe print options (scale, levels scope, structure content, no base). Export loading state tracks which format is running so one export disables both buttons and sets per-button aria-busy. Tests pass the format argument and assert STL uses the same profile as 3MF.

Reviewed by Cursor Bugbot for commit e67e701. Bugbot is set up for automated code reviews on this repo. Configure here.

@nicemit
nicemit marked this pull request as ready for review August 28, 2026 08:50

@Aymericr Aymericr 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.

Thanks — this is exactly the follow-up I left open in #331, and it's shaped the way I hoped: both actions stay on the fixed safe profile, preflight still gates the download, 3MF stays first as the recommended default, and the new test locks the STL path to the same profile the 3MF test does. I also checked this against #715 (the manifold/webpack module-graph problem): you don't touch the import chain, so it's neutral there — the browser-safe boundary is a separate track on my side, and nothing here makes it harder.

Two small things before I merge:

  1. print-export-button.tsxaria-busy now lies on the idle button: both buttons share isExporting, so exporting 3MF announces the STL button as busy too. Track the in-flight format (useState<PrintModelExportFormat | null>) and set aria-busy only on the active button. Keep both disabled during an export — that part is right, since they share one export pipeline.

  2. Labels: "Export 3D print 3MF" vs "Export 3D print STL files" isn't parallel, and the STL artifact is actually a zip of per-level STLs (print_levels_1-100_<date>.zip). Make them "Export 3D print 3MF" / "Export 3D print STL" — the plural/zip detail is better carried by the downloaded filename than the button. Worth keeping them clearly distinct from the plain "Export STL" button that already lives in this panel, which "3D print" does.

The format default on preparePrintExport is only there so the old test call sites don't change — I'd make it a required parameter, but I won't hold the PR on that.

I checked for anything depending on the old "Export 3D print files" label — nothing in tests or docs references it, so the rename is safe. I've approved the workflow run; once the two items above are in I'll merge.

Track in-flight format for aria-busy, align button labels, and make preparePrintExport format required.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nicemit

nicemit commented Sep 4, 2026

Copy link
Copy Markdown
Author

Thanks for the review @Aymericr, addressed both items (plus making format required on preparePrintExport):

  1. aria-busy is scoped to the in-flight format; both buttons stay disabled during export
  2. Label is now "Export 3D print STL"

@nicemit
nicemit requested a review from Aymericr September 4, 2026 05:39
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.

2 participants