Skip to content

fix: keep every set-aside preferences file, leave unreadable ones in place, and mute unselected Preferences categories - #15

Merged
MotherSphere merged 2 commits into
mainfrom
fix/preferences-review-followups
Oct 14, 2026
Merged

MotherSphere merged 2 commits into
mainfrom
fix/preferences-review-followups

Conversation

@MotherSphere

Copy link
Copy Markdown
Member

Follow-up to #13, from its review.

  • Set-aside files are never replaced. A second invalid preferences.json goes to preferences.json.invalid.1 (then .2, ...), and the status line names the file it used. Before, fs::rename silently replaced the first .invalid copy.
  • Only invalid files are set aside. load now reports a parse failure as InvalidData; any other read error (permission denied, a directory in place of the file) leaves the file where it is and turns saving off for the session, with the error on the status line.
  • One temporary file per process. save writes through preferences.json.<pid>.tmp, so two Collectors saving at the same moment cannot truncate each other's temporary file and rename a partial one into place.
  • Muted category list (NAV-4). Unselected categories in Preferences use text_muted; hovered ones get bg_card_hover; the selected one keeps the accent fill with on_accent text.

Tests: a second invalid file lands in .invalid.1 with the first untouched; an unreadable path (a directory) is neither moved nor saved over; the round-trip test checks the per-process temporary file is gone.

… temporary file

A second invalid preferences file now goes to preferences.json.invalid.1
(then .2, ...) instead of replacing the first copy, and the status line
names the file. Only a file that is not valid preferences is set aside: one
that cannot be read at all (a permission error, a directory) stays where it
is and nothing is saved this session. The temporary file carries the process
id, so two Collectors saving at once no longer write into the same file.
@MotherSphere
MotherSphere merged commit 51b5eb6 into main Oct 14, 2026
12 checks passed
@MotherSphere
MotherSphere deleted the fix/preferences-review-followups branch October 14, 2026 11:42
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