Repository navigation
Choose which slicer Open in Slicer uses - #155
Merged
vycdev merged 1 commit intoNov 16, 2026
Merged
Conversation
Open in Slicer (vycdev#148) always handed the 3MF to the operating system's default .3mf app, so anyone whose default was a 3D viewer, or who uses more than one slicer, had to change OS file associations first. This adds the slicer choice that vycdev#69 asked for and vycdev#148 left out. Native side (src-tauri/src/slicer_apps.rs): - list_slicer_apps detects Bambu Studio, Orca Slicer, PrusaSlicer and UltiMaker Cura in their usual locations: /Applications and ~/Applications on macOS; Program Files and %LOCALAPPDATA%\Programs on Windows (the newest "UltiMaker Cura <version>" folder wins, and the case-insensitive match also finds the older "Ultimaker Cura" folders); PATH commands and user/system Flatpak exports on Linux. Only installed slicers are listed, one entry per slicer. - pick_slicer_app opens the native file dialog (app bundles on macOS, .exe on Windows, any executable on Linux) and remembers the picked app in picked-slicers.json in the app config directory (at most 16). - open_model_in_slicer takes an optional, percent-encoded X-Kromacut-Slicer-App header. A model is only launched with a detected slicer or a picked app, never with an arbitrary program named by the web view; find_slicer_app applies the same rule. - macOS launches with `open -a <app> <model>` through the existing checked launcher, so Launch Services failures are reported. Flatpak slicers run through `flatpak run --file-forwarding`, because the exported launcher would not let the sandbox read Kromacut's cache. Other apps are spawned with the model as their argument and reaped in the background. Frontend: - Open in Slicer shows a chooser before building the 3MF: System default (the previous behavior), the detected slicers, and Browse. "Always use this slicer" saves the choice under kromacut:desktop-slicer; the menu item then names the slicer ("Open in Orca Slicer") and a new Choose Slicer item changes or forgets it. Turning the switch off and opening clears the choice. - A saved slicer that was moved or uninstalled is forgotten and the chooser explains that it could not be found. - Launch failures keep the localized error from b2873f4. - useSlicerChoice owns the saved preference and the chooser state; SlicerChooserDialog uses the existing AlertDialog, Switch and radio-list patterns. slicerPreference.ts validates stored values and tolerates blocked storage. Strings, docs and changelog: - New chooser and menu strings in all 12 locales, using each locale's existing slicer term. The Open in Slicer hint no longer promises the default 3MF app. - The export guide's Open in Slicer paragraph describes the chooser in all 12 languages. - Unreleased changelog entry under Added. Tests: - Native: detection per platform, newest Cura version, rejecting folders without an executable, launchable-app validation, describing picked apps, the detected-or-picked launch rule, picked-app storage and cap, launch commands (open -a, Flatpak file forwarding, direct), and percent-decoding of the slicer header. - Unit: saving, loading, forgetting and rejecting malformed stored preferences, and blocked storage. - e2e: the first click asks; choosing, remembering, changing, browsing (including a rejected pick), forgetting, remembering the system default, and a missing saved slicer. Fixes vycdev#152
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Owner
|
Verified before merge on macOS at 53c46f2:
Not covered: the native Browse dialog and a real slicer launch inside a packaged build. Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved 🤖 Generated with Claude Code |
This was referenced Nov 16, 2026
Merged
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.
Open in Slicer from #148 always opened the 3MF with the operating system's default
.3mfapp. If that default was a 3D viewer, or you use more than one slicer, you had to change OS file associations first. This adds the parts of #69 that #148 left out: choosing the slicer, remembering it, built-in presets, and Browse.What changed
Behavior
Native (
src-tauri/src/slicer_apps.rs)list_slicer_appslooks for Bambu Studio, Orca Slicer, PrusaSlicer and UltiMaker Cura in their usual install locations and lists only the ones it finds, one entry per slicer:BambuStudio.app,OrcaSlicer.app,PrusaSlicer.appandUltiMaker Cura.appin/Applicationsor~/Applications.Bambu Studio\bambu-studio.exe,OrcaSlicer\orca-slicer.exeandPrusa3D\PrusaSlicer\prusa-slicer.exein Program Files or%LOCALAPPDATA%\Programs. For Cura it takes the newestUltiMaker Cura <version>\UltiMaker-Cura.exe. Windows names ignore case, so this also finds the older "Ultimaker Cura 5.x" folders. I checked the Orca and Cura paths against their CPack and NSIS packaging.bambu-studio,orca-slicer,prusa-slicerandcuraonPATH, then the user and system Flatpak exports (com.bambulab.BambuStudio,com.orcaslicer.OrcaSlicerand the olderio.github.softfever.OrcaSlicer,com.prusa3d.PrusaSlicer,com.ultimaker.cura).pick_slicer_appopens the native file dialog: app bundles on macOS (starting in/Applications),.exefiles on Windows, and any executable on Linux, so AppImages work. Kromacut remembers the picked app inpicked-slicers.jsonin the app config folder, keeping at most 16.open_model_in_sliceraccepts an optionalX-Kromacut-Slicer-Appheader. The path is percent-encoded because header values must be ASCII and user paths are often not. It only launches a detected slicer or an app picked in the native dialog. The web view can never name some other program to run, which keeps the "only a 3MF can be written or opened" guarantee from Open the generated 3MF in the default slicer from the desktop app #148.find_slicer_appuses the same rule.open -a <app> <model>through the existing checked launcher, so Launch Services errors are reported.flatpak run --file-forwarding <id> @@ <model> @@. The exported launcher doesn't forward files, so the sandboxed slicer couldn't otherwise read Kromacut's cache.Frontend
useSlicerChoiceholds the saved preference and the chooser state.SlicerChooserDialogreuses the existingAlertDialog,Switchand radio-list patterns (the list matches the preview-mode menu).slicerPreference.tsstores{ kind: 'system' }or{ kind: 'app', app: { name, path } }underkromacut:desktop-slicer. It rejects malformed values and keeps working when storage is blocked.useAppHandlers.onOpenInSlicernow takes the chosen slicer. The browser build is unchanged and has no chooser or menu item.Strings, docs, changelog
Closes #152
Tests
slicer_appshas 8 new tests,slicer_handoffhas 1):PATHcommands taking priority over Flatpakopen -a, Flatpak file forwarding, direct start in the app's folder)cargo testpasses natively on macOS (29 tests) and on Linux (rust:1-bookwormwith the WebKitGTK packages, 26 tests).cargo clippy --all-targetsis clean on macOS, Linux andx86_64-pc-windows-msvc(cross-checked), andcargo fmt --checkis clean.tests/slicerPreference.test.tscovers round-trips, forgetting, malformed stored values and blocked storage.tests/e2e/open-in-slicer.spec.ts,@smoke):v1.60.0-noble):npm run lint,npx tsc -b,npm run check:i18n,npm test(1138 pass, 1 skipped),npm run test:i18n,npm run test:docs,npm run check:e2e, andnpm run test:e2e:all. All 8 suites passed, 96@smoketests among them..appfilter on macOS hasn't been seen in a real build either.