Repository navigation
fix(package): Search per-platform data directories for Character Packages - #1207
Conversation
…ages Co-authored-by: Oded Messer <odedmesser@gmail.com>
omesser
left a comment
There was a problem hiding this comment.
Soft-gate — PR #1207
Tip gated: 0cfb85be0643166e7dacd63849d11552ca0af7da (cursor/per-platform-character-search-b00a)
Draft: no · Mergeable: yes (mergeable_state clean/unstable→settled) · Closes #1189: yes
Hard — Holds
- Bundled
characters/stays last insearch_paths; still resolved. - Character switch /
load_all_characters: earlier directory wins viacache.contains_keyskip — user packages not overwritten by bundled duplicates. - Additive
FIDGET_CHARACTERSprepends then keepsmemory::data_dir()/characters+ bundled (empty/unset extras add nothing). - Windows path no longer depends on
HOME; usesdata_dir(APPDATA). Tests assert no literalLibrarycomponent on Windows/Linux hosts.
Soft ledger
| Item | Status | Evidence |
|---|---|---|
| (a) #1189 acceptance | Holds | Order: additive FIDGET_CHARACTERS (platform sep) → memory::data_dir()/characters → Linux XDG_DATA_DIRS fidget/characters (skip relative; unset/empty → /usr/local/share then /usr/share) → bundled. Earlier wins. Closes #1189. |
| (b) Per-platform correctness | Holds | macOS App Support via data_dir; Linux XDG_DATA_HOME + XDG_DATA_DIRS; Windows APPDATA; no production ~/Library/... hardcode (only test fixtures / macOS data_dir literals). |
| (c) Tests + Settings UX | Holds | Unit tests per desktop + empty FIDGET + Windows-without-HOME + Linux host assertion; picker help shows user_characters_dir(); fixtures updated; DEVELOPMENT.md table. |
| (d) Merge hygiene | Holds | mergeable: true vs main @ 397ac6cc. |
| (e) CI on tip | Holds | Tip checks: build success, checks (ubuntu-latest) success, checks (macos-latest) success, windows success, deploy skipped. No red. |
| (f) FIDGET_CHARACTERS behavior | Holds | Replacement → additive (PATH-like) is intentional per #1189 (“additive matches how PATH-style variables behave”) and documented in PR body + DEVELOPMENT.md. Scripts that relied on exclusive override to hide bundled/user paths would now still see them — documented; no exclusive override needed for acceptance. |
Local verify (box)
node --test tests/settings.test.js→ 34/34 pass- Named
cargo test -p fidget --bin fidget -- …→ skipped (box missingpkg-config/ GTK build deps;aptmirror 500). Rely on CI green for Rust filter.
Verdict
Soft CLEARED · Hard Holds · COMMENT review only (no approve, no merge).
— Cursor agent (Architect), on @omesser's behalf.
Keep the notes that stop a reader replacing FIDGET_CHARACTERS, dropping the dead_code allows, or letting a later package win a switch. Co-authored-by: Oded Messer <odedmesser@gmail.com>
omesser
left a comment
There was a problem hiding this comment.
Soft-re-gate CLEARED @ 38ed8b71fde57fda6ef61127eb4b2a554e18cc41
vs prior Soft-CLEARED 0cfb85be0643166e7dacd63849d11552ca0af7da (COMMENT 5373212702): tip moved +1 commit chore(package): Cut comments that restate the character search — comment/docstring trim only in package.rs + settings/form.rs (−35/+5). No behavior/path/test/logic change.
Draft: no · Mergeable: yes · mergeStateStatus: UNSTABLE (CI settling) · Closes #1189: yes · base main @ 2321ea7a
Soft ledger
| Item | Status | Evidence |
|---|---|---|
| (a) #1189 acceptance | Met | Order: additive FIDGET_CHARACTERS → memory::data_dir()/characters → Linux XDG → bundled; earlier wins; issue Closes linked. |
| (b) Per-platform paths | Met | macOS App Support via data_dir; Linux XDG_DATA_HOME + XDG_DATA_DIRS; Windows APPDATA; user_characters_dir() = data_dir()/characters. |
| (c) Tests + Settings picker | Met | macos_search / linux_search / windows_search / fidget_characters_* / empty-extra tests intact; picker help shows characters_dir; form + fixture coverage. |
| (d) Merge hygiene | Met | MERGEABLE vs main; Closes #1189; no dirty conflict (UNSTABLE = checks, not CONFLICTING). |
| (e) CI | Met (pending OK) | tip: build success; deploy skipped; checks (ubuntu/macos) + windows in_progress — no failures. |
| (f) FIDGET_CHARACTERS additive | Met | Prepends via split_list; empty/unset adds nothing; user + bundled stay. |
Hard
none — bundled last; additive extras keep user+bundled; windows_search_paths_keep_the_user_directory_without_home still asserts APPDATA path without HOME/Library.
Next: await Oded merge yes (COMMENT only; no approve/merge).
— Cursor agent (Architect), on @omesser's behalf.
Why
package::search_pathsbuilt the user character directory as$HOME/Library/Application Support/fidget/characterson every OS. That path is the macOS convention. Linux looked in a folder nothing else uses. Windows usually has noHOME, so the user directory was missing.FIDGET_CHARACTERSreplaced every other search path.What changed
FIDGET_CHARACTERSis additive. If it is set, fidget searches those directories first. Split entries with:on macOS and Linux, and with;on Windows. Fidget adds them in front of the other directories, the wayPATHworks, so the user directory and the shipped packages stay findable.The rest of the search, in order:
memory::data_dir()/characters. This is the same per-platform data directory assettings.json. macOS uses~/Library/Application Support/fidget/characters. Linux uses$XDG_DATA_HOME/fidget/characters, or~/.local/share/fidget/characterswhen that variable is unset. Windows uses%APPDATA%\fidget\characters.$XDG_DATA_DIRSentry underfidget/characters. Unset or empty means/usr/local/share/fidget/characters, then/usr/share/fidget/characters. Fidget skips a relative entry.characters/directory.An earlier directory wins when two packages share a name. A character switch loads that earlier package.
The Settings Character picker shows the user directory it reads.
docs/DEVELOPMENT.mdlists the resolved path per platform.How to verify
windows_search_paths_keep_the_user_directory_without_homecovers Windows withHOMEunset. The search reads the roaming data directory and does not readHOME, so that test runs on Linux and macOS too.Notes
The Settings window was not opened. The picker text is the form description the webview draws as help under the Character popup. The form tests and
tests/settings.test.jscover that text.Closes #1189
— Cursor agent (Coder), on @omesser's behalf.