feat: default new portable installs' jobs folder inside the package - #411
Merged
Conversation
added 2 commits
August 21, 2026 21:40
…art 2) documents_dir_for_jobs() eagerly created ~/Documents/StemDeck/jobs on every startup just to compute the value handed to the backend as STEMDECK_DEFAULT_JOBS_DIR, even when the user had already relocated their library elsewhere via Settings and this default is never used. The Python side (app/core/config.py's ensure_runtime_dirs) already creates whichever JOBS_DIR actually wins that precedence, so the Rust side only needs to compute the path, not create it.
Windows portable builds already keep cache/models/settings.json next to StemDeck.exe (local_data_dir(), #399); the jobs default never plugged into that and always resolved to ~/Documents/StemDeck/jobs regardless of portable-ness. documents_dir_for_jobs() now defaults new portable installs to local_data_dir()/jobs instead. Existing installs are unaffected: if ~/Documents/StemDeck/jobs already has anything in it, that stays the resolved default (checked against disk content directly, since there is no explicit jobs_dir in settings.json to record an implicit default -- and only the backend writes that file). Non-portable installs (installer builds, macOS, Linux) are untouched either way.
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.
Summary
Stacked on #410 (needs that merged first, or the diff below will include its commit too).
cache/models/settings.jsoninside the package next toStemDeck.exe, vialocal_data_dir()'s portable redirect ([Bug]: Several issues with my portable package #399). The jobs default never plugged into that and always resolved to~/Documents/StemDeck/jobsregardless of portable-ness.documents_dir_for_jobs()now defaults new portable installs tolocal_data_dir()/jobs(i.e.<exe dir>/data/jobs), consistent with cache/models.~/Documents/StemDeck/jobsalready has anything in it, that stays the resolved default - checked directly against disk content rather than a migration flag, since there's no explicitjobs_dirrecorded insettings.jsonfor an implicit default, and only the Python backend writes that file (kept this self-contained rather than crossing that boundary).Test plan
cargo clippy --all-targetsclean (3 pre-existing, unrelated warnings)cargo test- 36/36 pass (3 new tests fordirectory_has_entries)