feat(accounts): reference the default token instead of copying it #103

Closed
KofTwentyTwo wants to merge 2 commits from feat/default-token-ux into main
pull from: feat/default-token-ux
2 Commits
Author SHA1 Message Date
james.maesandClaude Fable 5.1 c0a99cacd8 feat(accounts): reference the default token instead of copying it
An account can now resolve to the default token saved in Settings
(TokenSource = Default) instead of holding a copy of its own, so replacing the
default token rotates every such account at once. Own stays the on-disk
default and is omitted from accounts.json, so existing files and vault entries
are untouched.

AccountTokenResolver is the one place that turns an account into its token;
the desktop workspace, Sync All and the CLI go through it. AccountsStore saves
a Default account without a vault entry and removes an own entry when an
account switches, vault first with the same put-it-back compensation as a
delete; CountUsingDefaultToken feeds the Settings captions in step 3.

CLI parity: `accounts add` and `accounts edit` take --use-default-token (a
fatal error when no default token is saved; exclusive with the other token
options), `accounts list` shows the source as a column and as tokenSource in
JSON, and `sync --account` names the source and the fix when no token
resolves. Threat model T5 and docs/CLI.md updated; the approved plan is in
docs/plans/default-token-ux.md.

Closes #104
Part of #102

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-10 17:03:16 -05:00
james.maesandClaude Fable 5.1 ef86a52bc6 docs(plans): UX plan for the default token and account tokens
Design for #101 (Settings shows a saved default token as a masked value) and #102 (Add account uses the default token by reference, so rotating it in Settings rotates every such account): TokenSource on the account record, one resolver for app and CLI, wizard step 2 as a choice, guarded removal in Settings, CLI parity, tests and delivery order.

Relates to #101, #102

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-10 16:44:57 -05:00