Problem
The root of AppData<T> is computed, not injected. AppData.Path is AppDataPath / AppDomain, which is %AppData%/<AppDomain.CurrentDomain.FriendlyName>. Both properties are read-only and expression-bodied. Every LoadOrCreate overload (AppData.cs:498, :538, :545, :552) takes only a RelativeDirectoryPath, which is joined beneath AppData.Path. A caller has no way to ask for an arbitrary absolute root.
That blocks adopting AppData<T> in libraries that expose their data directory as public API. For example, ktsu-dev/Keybinding#93 has four public entry points that accept an absolute dataDirectory, and its test suite isolates each test in its own temp directory.
Proposal
Add a LoadOrCreate overload that takes an AbsoluteDirectoryPath root, alongside the optional file name. It should use the same atomic tmp/.bk write and the same recovery path as the existing overloads. The Get() singleton does not need to change. Callers that pass an explicit root keep the returned instance themselves.
Acceptance criteria
LoadOrCreate(AbsoluteDirectoryPath root, FileName? fileName = null) (exact shape is open) loads, saves and recovers from .bk under root. The FriendlyName segment is not inserted.
- Two instances of the same
T with different roots do not share a file.
- Tests cover per-root isolation and backup recovery under a custom root.
Context
The maintainer decided on 2026-09-28 that Keybinding should adopt ktsu.AppDataStorage, and that the missing absolute-root support should be fixed upstream here (option 1 in Keybinding#93). This follows the org-wide reuse rule "prefer reuse, accept costs; fix gaps upstream" (ktsu-dev/.github#15).
Problem
The root of
AppData<T>is computed, not injected.AppData.PathisAppDataPath / AppDomain, which is%AppData%/<AppDomain.CurrentDomain.FriendlyName>. Both properties are read-only and expression-bodied. EveryLoadOrCreateoverload (AppData.cs:498,:538,:545,:552) takes only aRelativeDirectoryPath, which is joined beneathAppData.Path. A caller has no way to ask for an arbitrary absolute root.That blocks adopting
AppData<T>in libraries that expose their data directory as public API. For example, ktsu-dev/Keybinding#93 has four public entry points that accept an absolutedataDirectory, and its test suite isolates each test in its own temp directory.Proposal
Add a
LoadOrCreateoverload that takes anAbsoluteDirectoryPathroot, alongside the optional file name. It should use the same atomic tmp/.bkwrite and the same recovery path as the existing overloads. TheGet()singleton does not need to change. Callers that pass an explicit root keep the returned instance themselves.Acceptance criteria
LoadOrCreate(AbsoluteDirectoryPath root, FileName? fileName = null)(exact shape is open) loads, saves and recovers from.bkunderroot. TheFriendlyNamesegment is not inserted.Twith different roots do not share a file.Context
The maintainer decided on 2026-09-28 that Keybinding should adopt
ktsu.AppDataStorage, and that the missing absolute-root support should be fixed upstream here (option 1 in Keybinding#93). This follows the org-wide reuse rule "prefer reuse, accept costs; fix gaps upstream" (ktsu-dev/.github#15).