Open on the account that was in front when the app last ran #14

Closed
asxpi wants to merge 0 commits from asxpi/anotherim-js:feat/start-on-last-account into develop
First-time contributor

Every start put the first account in front, the one added first, so someone who mostly works in another account had to switch to it each time.

The main window now keeps its account in front in localStorage (anotherim.front), next to the app's other per-device choices, and the next start opens on it (Store.begin, #loadAccounts):

  • Kept whenever the account in front changes: the account menu, opening another account's chat, a notification.
  • An account removed since, or storage that can't be read (a private window, blocked site data), falls back to the first, as before.
  • Only the main window, the one begun with no account of its own, keeps it. A desktop window opened beside it on another account (?window=N&acc=…) doesn't change where the next start opens.

Tests: a new ui/test/start-account.test.ts (first run; last used; removed since; a window beside the main one; blocked storage). multi-account-list.test.ts now clears the storage between its cases, which otherwise carried one case's account into the next. tsc and the i18n check pass. make test-ui: 2153 passed, 2 failed, both thread-footer cases, which fail under load and pass alone. Checked by hand in a local Flatpak build: switched to another account, quit, and it opened on that account.

🤖 Generated with Claude Code

Every start put the first account in front, the one added first, so someone who mostly works in another account had to switch to it each time. The main window now keeps its account in front in `localStorage` (`anotherim.front`), next to the app's other per-device choices, and the next start opens on it (`Store.begin`, `#loadAccounts`): - Kept whenever the account in front changes: the account menu, opening another account's chat, a notification. - An account removed since, or storage that can't be read (a private window, blocked site data), falls back to the first, as before. - Only the main window, the one begun with no account of its own, keeps it. A desktop window opened beside it on another account (`?window=N&acc=…`) doesn't change where the next start opens. Tests: a new `ui/test/start-account.test.ts` (first run; last used; removed since; a window beside the main one; blocked storage). `multi-account-list.test.ts` now clears the storage between its cases, which otherwise carried one case's account into the next. `tsc` and the i18n check pass. `make test-ui`: 2153 passed, 2 failed, both thread-footer cases, which fail under load and pass alone. Checked by hand in a local Flatpak build: switched to another account, quit, and it opened on that account. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Every start put the first account in front, the one added first, so
someone who mostly works in another had to switch to it each time.
The main window now keeps its account in front (localStorage
anotherim.front) and the next start opens on it; one removed since,
or storage that cannot be read, falls back to the first as before.

Only the main window, the one begun with no account of its own,
keeps it: a desktop window opened beside it on another account does
not change where the next start opens.

multi-account-list.test.ts clears the storage between its cases,
which otherwise carried one case's account into the next.

Assisted-by: Claude:opus-5-5
asxpi force-pushed feat/start-on-last-account from 7792e940d2 to 5938553727 2026-10-16 06:55:40 +00:00 Compare
Owner

Reviewed and merged into develop by hand with merge commit 6acf255c, released in 0.5.6 (v0.5.6 = 33b27872, https://dev.another.im/another-im/anotherim-js/releases/tag/v0.5.6). The forge does not mark a hand merge as merged, so this PR is closed here.

Reviewed and merged into develop by hand with merge commit 6acf255c, released in 0.5.6 (v0.5.6 = 33b27872, https://dev.another.im/another-im/anotherim-js/releases/tag/v0.5.6). The forge does not mark a hand merge as merged, so this PR is closed here.
ann closed this pull request 2026-10-16 08:50:03 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.