Skip to content

Multi-tab plumbing in AccountContext + reusable ConfirmDialog #33

Description

@saknarajapakshe

Part of: #23

What to build

Two small, independent pieces that the rest of #23 and #25 rely on.

  1. In AccountContext.tsx:
    • Stop addAccount from auto-switching the current tab (drop its internal switchAccount(id) call).
    • On mount, check the URL for ?account=<id> first, before falling back to the stored "active account" — so a freshly opened tab knows which account it belongs to.
  2. A small helper, src/nonview/core/openAccountInNewTab.ts:
    export function openAccountInNewTab(accountId: string): void {
      const url = new URL(import.meta.env.BASE_URL, window.location.origin);
      url.searchParams.set("account", accountId);
      window.open(url.toString(), `quicksilver-${accountId}`);
    }
    Use import.meta.env.BASE_URL, not a bare "/" — the app is served under /quicksilver/.
  3. A reusable src/view/atoms/ConfirmDialog.tsx — the first confirm dialog in the app, used later for "Sign out of all accounts?" and "Remove this account?".

Done when

  • Reloading a tab opened with ?account=<id> still shows that account.
  • ConfirmDialog goes full-screen on mobile, centered on desktop (same pattern as ComposeDialog).

Depends on

Nothing beyond #28 — start any time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions