Skip to content

Keep the saved Browse slicer launchable after more Browse picks - #176

Merged
vycdev merged 3 commits into
vycdev:developfrom
officialasishkumar:fix/issue-174-keep-saved-slicer
Nov 19, 2026
Merged

vycdev merged 3 commits into
vycdev:developfrom
officialasishkumar:fix/issue-174-keep-saved-slicer

Conversation

@officialasishkumar

@officialasishkumar officialasishkumar commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

open_model_in_slicer only launches a detected preset or an app picked in the native dialog. Picked apps are kept in picked-slicers.json, capped at 16 (MAX_PICKED_APPS), and remember_picked_app dropped the oldest entries first. So after a slicer picked with Browse was saved with Always use this slicer, 16 more Browse picks pushed it off the list. Open in A then said "A could not be found" and cleared the saved choice, even though A was still installed.

What changed

I went with the issue's "keep the currently saved app in the list when trimming" option. Moving the app to the newest position whenever it's saved or launched doesn't cover the reproduction steps: the extra picks happen between launches, so A can be evicted before it's used again.

  • pick_slicer_app takes an optional keep argument, the saved slicer's path. pickSlicerApp(title, filterName, savedPath) sends it, and SlicerChooserDialog passes the saved app when one is saved. That covers every place Browse can be used while a slicer is saved.
  • remember_picked_app(file, path, keep) still adds the new pick as the newest entry and trims to 16. It now drops the oldest entry other than keep, so the saved slicer stays launchable until it is moved, uninstalled, or replaced. Once a different slicer is saved, the old one ages out like any other pick.
  • keep can only stop an existing entry from being dropped. It never adds a path, so the web view still can't make Kromacut launch an app the user didn't pick.
  • Unreleased changelog entry under Fixed.

Fixes #174

Tests

  • Rust: the_saved_slicer_outlives_later_picks, next to picked_apps_are_deduplicated_and_capped, picks 17 apps after the saved one. It checks that the saved slicer is still first, the oldest others were dropped, and the list is still 16 long. It then saves another slicer and checks that the old one ages out. The existing test now passes None.
  • e2e (tests/e2e/open-in-slicer.spec.ts): Browse sends the saved slicer's path while Orca is saved (both picks in the remember/change test). After a missing saved slicer is forgotten, Browse sends keep: null.
  • Local runs: rustfmt --check on all src-tauri/src files; npm run lint, npx tsc -b, and the full open-in-slicer.spec.ts (4 passed against a fresh production build).
  • Not run here: cargo test/clippy on the whole Tauri crate, because this machine can't do a full Tauri build. Instead I compiled read_picked_apps, remember_picked_app and both picked-app tests, taken verbatim from slicer_apps.rs, in a small crate with serde_json. Both tests pass and clippy --all-targets -D warnings is clean. The new test fails with the previous drain(..excess) trimming. The only other Rust change is the keep: Option<String> command argument and passing keep.as_deref() inside the existing move closure.

This touches a few of the same files as #175 (#173), but the two branches merge cleanly in either order.

Maintainer follow-up

  • e3d43f9: only_detected_or_picked_apps_can_open_models still called remember_picked_app with two arguments, so the crate's tests didn't compile. It now passes None.
  • 2ee9ced: the chooser and Browse (Feature: choose which slicer opens the generated model #152) are still unreleased, so the CHANGELOG note is folded into that Added bullet instead of a separate Fixed entry.

Proof: npm run lint, npm run build, npm test and npm run check:e2e pass on the app code, which hasn't changed since c0099e0 (the later commits touch only a Rust test line and CHANGELOG). npm run test:e2e:all passes all 8 suites at e3d43f9, including open-in-slicer.spec.ts (4/4 on a fresh server), and tests/releaseMetadata.test.ts passes after the CHANGELOG change. In src-tauri, cargo test --lib (30/30), cargo clippy --all-targets -- -D warnings and cargo fmt --check are clean. the_saved_slicer_outlives_later_picks fails when the old drain(..excess) trimming is restored.

Council review

Rounds: 2

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

open_model_in_slicer only launches a detected preset or an app picked in
the native dialog. Picked apps are kept in picked-slicers.json, capped at
16, and remember_picked_app dropped the oldest entries first. A slicer
picked with Browse and saved with "Always use this slicer" therefore
fell off the list after 16 more Browse picks: Open in Slicer then said it
could not be found and cleared the saved choice, although it was still
installed.

Browse now sends the saved slicer's path as `keep` (pick_slicer_app gains
an optional `keep` argument; pickSlicerApp passes the chooser's saved
app). When trimming, remember_picked_app drops the oldest picked app
other than `keep`, so the saved slicer stays launchable until it is
moved, uninstalled or replaced. Once another slicer is saved, the old one
ages out like any other pick. `keep` can only protect an entry that is
already in the list, so the web view still cannot make Kromacut launch an
app the user never picked.

Tests:
- Rust: the_saved_slicer_outlives_later_picks picks 17 apps after the
  saved one and checks it survives while the oldest others are dropped,
  and that it ages out once a different slicer is saved. It fails with
  the previous trimming.
- e2e: Browse sends the saved slicer's path while one is saved, and null
  after a missing saved slicer was forgotten.
- Unreleased changelog entry under Fixed.

Fixes vycdev#174
@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:19:11.489990Z
We couldn’t complete this review. Comment @codex review to try again.
c0099e0 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.

vycdev and others added 2 commits November 18, 2026 23:32
The picked-app guard test still called remember_picked_app with two
arguments, so the Tauri crate's tests no longer compiled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The slicer chooser and Browse are still unreleased, so the trimming fix
belongs in their Added bullet rather than under Fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vycdev
vycdev merged commit a582d3f into vycdev:develop Nov 19, 2026
11 checks passed
vycdev added a commit to officialasishkumar/Kromacut that referenced this pull request Nov 19, 2026
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]>
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