Skip to content

feat(accounts): remove a specific account from the switcher#559

Open
shukiv wants to merge 2 commits into
bulwarkmail:mainfrom
shukiv:feat/account-remove-button
Open

feat(accounts): remove a specific account from the switcher#559
shukiv wants to merge 2 commits into
bulwarkmail:mainfrom
shukiv:feat/account-remove-button

Conversation

@shukiv

@shukiv shukiv commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The account switcher only offered sign out of active and sign out of all — there was no way to drop a single non-active account. That leaves you stuck if an account lands in an error state you can't switch into to sign out of.

This adds a hover × on non-active, non-default rows and a removeAccount(id) auth-store action that:

  • stops the account's refresh timer and disconnects/evicts its client,
  • removes it from the account registry,
  • clears its per-slot session/token cookies.

Removing the active account defers to logout() (which handles switching away / redirecting). Locale keys (sidebar.remove_account, sidebar.remove_account_confirm) added to all 20 locales — English fallback for the untranslated ones.

Depends on #517 (account-switcher redesign). Until #517 merges, this PR's diff includes those commits. Rebase onto main once #517 lands.

Test plan

  • Hover a non-active account → × appears; default and active rows show none.
  • Click × → confirm → account leaves the switcher; active account unchanged.
  • Re-add via + Add account works afterward (slot cookies were cleared).
  • Removing the only other account collapses the switcher correctly.

shukiv added 2 commits June 28, 2026 19:47
The account switcher now always renders the default (starred) account first
and lets you drag the remaining accounts into any order. Default stays
pinned; only non-default rows are draggable (shown via a grip handle on
hover). Wraps each row in a draggable container and persists the new order
through the existing reorderAccounts store action.

Ordering logic extracted to pure helpers (sortDefaultFirst,
reorderNonDefaultIds) in account-utils with unit tests.
The switcher only offered 'sign out of active' and 'sign out of all' — no
way to drop a single non-active account (e.g. one stuck in an error state you
can't switch into to sign out). Add a hover × on non-active, non-default rows
and a removeAccount(id) auth action that tears down the client, drops it from
the registry, and clears its per-slot session/token cookies.

Stacks on the switcher redesign in bulwarkmail#517.
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