Skip to content

feat: default new portable installs' jobs folder inside the package - #411

Merged
thcp merged 2 commits into
mainfrom
feat/portable-default-jobs-dir
Aug 21, 2026
Merged

feat: default new portable installs' jobs folder inside the package#411
thcp merged 2 commits into
mainfrom
feat/portable-default-jobs-dir

Conversation

@thcp

@thcp thcp commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #410 (needs that merged first, or the diff below will include its commit too).

  • Windows portable builds already keep cache/models/settings.json inside the package next to StemDeck.exe, via local_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/jobs regardless of portable-ness.
  • documents_dir_for_jobs() now defaults new portable installs to local_data_dir()/jobs (i.e. <exe dir>/data/jobs), consistent with cache/models.
  • Existing installs are unaffected. If ~/Documents/StemDeck/jobs already has anything in it, that stays the resolved default - checked directly against disk content rather than a migration flag, since there's no explicit jobs_dir recorded in settings.json for an implicit default, and only the Python backend writes that file (kept this self-contained rather than crossing that boundary).
  • Non-portable installs (installer builds, macOS, Linux) are untouched either way - the original Documents rationale (visible in Finder/Explorer, OneDrive/iCloud backup, survives reinstalls) still applies to them.
  • Manual relocation via Settings still overrides everything, unchanged.

Test plan

  • cargo clippy --all-targets clean (3 pre-existing, unrelated warnings)
  • cargo test - 36/36 pass (3 new tests for directory_has_entries)
  • CI green

Thales 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.
@thcp
thcp merged commit ff6efd0 into main Aug 21, 2026
10 checks passed
@thcp
thcp deleted the feat/portable-default-jobs-dir branch August 21, 2026 21:35
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.

1 participant