Skip to content

Change or forget the saved slicer from Settings - #175

Merged
vycdev merged 2 commits into
vycdev:developfrom
officialasishkumar:feat/issue-173-slicer-settings
Nov 19, 2026
Merged

vycdev merged 2 commits into
vycdev:developfrom
officialasishkumar:feat/issue-173-slicer-settings

Conversation

@officialasishkumar

@officialasishkumar officialasishkumar commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Right now the only way to change the slicer that Open in Slicer uses is Choose Slicer… in the 3D download menu. That menu stays disabled until a model is built, and confirming the chooser from there also exports the model and launches the slicer. This adds the Settings row described in #173, so you can switch or forget the saved slicer without opening a model.

What changed

Settings (src/components/Header.tsx, desktop app only)

  • A new Open in Slicer section shows the saved choice: Ask every time, System default, or the slicer's name with its path underneath (long paths are truncated, and the full path is in the tooltip). It works with no image or model loaded.
  • Change… closes Settings and opens the existing SlicerChooserDialog.
  • Forget clears the saved choice, so the next Open in Slicer asks again. It only appears when something is saved. Because the button disappears, focus moves to Change… so keyboard users stay inside Settings.

Chooser in save mode (SlicerChooserDialog, useSlicerChoice)

  • Chooser requests carry a saveOnly flag. Opened from Settings, the description reads "Choose the app that Open in Slicer opens models with." and the confirm button reads Save (data-testid="slicer-save"). It saves the selected slicer (detected, browsed, or System default) and doesn't export or open anything.
  • Always use this slicer is hidden in this mode because the choice is always saved. Opened from the download menu, the chooser behaves exactly as before.
  • The preference still lives in useSlicerChoice and kromacut:desktop-slicer, so it needs no new storage or migration. The download menu and Settings read the same state, so a change in one shows up in the other immediately. The browser build passes no slicer props to Header and shows no row.

Strings, docs, changelog

  • 5 new Settings strings and 2 new chooser strings in all 12 locales, using each locale's existing slicer term and Settings wording. The remember hint now mentions Settings next to Choose Slicer.
  • The export guide's Open in Slicer paragraph (src/docs/generating-exporting-output.md and the 11 translations) now explains the Settings row, Change and Forget.
  • Unreleased changelog entry under Added.

Closes #173

Tests

  • e2e (tests/e2e/open-in-slicer.spec.ts, @smoke):
    • The browser build's Settings dialog has no slicer row.
    • A new desktop test runs entirely without a model at first. It checks "Ask every time" with no Forget button, and that Change replaces Settings with the chooser in save mode (Save button, no remember switch). Cancelling saves nothing. Saving a detected slicer, then a browsed one, then System default each update the preference and the Settings row, and nothing is exported. Forget clears the choice and keeps focus on Change. After building a model, the download menu opens the slicer saved in Settings without asking, and forgetting it in Settings makes the menu ask again.
    • buildModel is split into openApp + buildLoadedModel so the new test can open Settings before any model exists. The existing tests are unchanged.
  • Local runs: npm run lint, npx tsc -b, npm run check:i18n, npm run test:docs, npm run test:i18n, and the full open-in-slicer.spec.ts (6 passed against a fresh production build).
  • Layout: I opened the desktop Settings dialog at 390 × 844 in en, fr, de and bn with a long Cura path saved. Nothing overflows, and the buttons stay on one line next to the truncated path.
  • Not run: the other e2e suites, which this change doesn't touch, and a packaged desktop build.

Maintainer follow-up

Rebased onto develop after #176 (the only conflict was CHANGELOG.md), plus one commit (82ed1af):

  • Closing the chooser opened from Settings (Save, Cancel, Escape) now returns focus to the Settings button instead of the page body, including when the click didn't focus anything (WebKit/macOS).
  • Change… and Forget are described by the row title and current slicer, and a truncated slicer name has a tooltip.
  • The remember hint no longer reads as if Choose Slicer is in Settings (en, de, es, fr, it, pt-PT, ro, uk).
  • The Settings e2e test saves once with a model built, checks focus after Cancel/Escape/Save, checks that Browse from Settings keeps the saved slicer (Keep the saved Browse slicer launchable after more Browse picks #176), and checks that Open in Slicer asks again after Forget.

Proof: the new focus assertions fail without the fix, and an injected export-on-Save makes the final call count fail (2 vs 1). Locally, npm ci, lint, build, npm test, check:e2e, check:i18n, test:i18n, and test:docs pass, and test:e2e:all passes every suite except one @smoke test, image-decode-reuse.spec.ts:177, which also fails on develop (7 of 20 runs).

Council review

Rounds: 2

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

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T20:18:57.311507Z
We couldn’t complete this review. Comment @codex review to try again.
ea37f5c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

officialasishkumar and others added 2 commits November 19, 2026 18:13
The only way to change the slicer that Open in Slicer uses was Choose
Slicer in the 3D download menu. That menu is disabled until a model is
built, and confirming the chooser from there also exports the model and
launches the slicer, so the saved slicer could not be switched without
opening a model.

The desktop Settings dialog now has an Open in Slicer row:
- It shows the saved choice: "Ask every time", "System default", or the
  slicer's name with its path. It works with no image or model loaded.
- Change closes Settings and opens the existing SlicerChooserDialog in a
  save-only mode. Its confirm button reads Save and only stores the
  selected slicer (detected, browsed, or the system default); nothing is
  exported or opened. The "Always use this slicer" switch is hidden in
  this mode because the choice is always saved.
- Forget clears the saved choice, so the next Open in Slicer asks again.
  Focus moves to Change because the Forget button disappears.

useSlicerChoice keeps owning the preference (kromacut:desktop-slicer), so
the download menu and Settings stay in sync without new storage. Chooser
requests carry a saveOnly flag, and onChangeSavedSlicer/onForgetSlicer
are passed to Header only in the desktop app.

The new Settings and chooser strings, the remember hint (which now
points to Settings as well) and the export guide's Open in Slicer
paragraph are updated in all 12 languages. Unreleased changelog entry
under Added.

Tests: new @smoke e2e cases check that the browser Settings dialog has
no slicer row, and that desktop Settings saves a detected, browsed, or
system-default slicer without exporting, cancels, forgets, and that the
download menu follows a choice made or forgotten in Settings.

Closes vycdev#173
The slicer chooser has no trigger, so closing it after Change in Settings
left focus on the page body. It now returns focus to the element that was
focused when it opened, and Change hands focus to the Settings button
first, so focus returns there even when the click did not focus anything
(WebKit, as on macOS).

- Change and Forget are described by the row's title and current slicer,
  and a truncated slicer name shows in full as a tooltip.
- The remember hint names Settings as a separate place to change the
  slicer, instead of reading as if Choose Slicer were in Settings (en, de,
  es, fr, it, pt-PT, ro, uk).
- The Settings e2e test now saves once with a model built, so an
  accidental export on Save fails the final call count. It also checks
  focus after Cancel, Escape (including a click that focuses nothing) and
  Save, that Browse from Settings keeps the saved slicer (vycdev#176), and that
  Open in Slicer asks again after Forget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vycdev
vycdev force-pushed the feat/issue-173-slicer-settings branch from ea37f5c to 82ed1af Compare November 19, 2026 16:41
@vycdev
vycdev merged commit 82df030 into vycdev:develop Nov 19, 2026
11 checks 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.

2 participants