Skip to content

[Feat] Open Account in a New Tab + Reusable ConfirmDialog Component#42

Merged
maneeshaxyz merged 1 commit into
OpenGovMail:mainfrom
saknarajapakshe:33-feat-account-context-multi-tab-plumbing
Jul 15, 2026
Merged

[Feat] Open Account in a New Tab + Reusable ConfirmDialog Component#42
maneeshaxyz merged 1 commit into
OpenGovMail:mainfrom
saknarajapakshe:33-feat-account-context-multi-tab-plumbing

Conversation

@saknarajapakshe

@saknarajapakshe saknarajapakshe commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • AccountContext.addAccount no longer auto-switches the current tab — callers decide whether to switch.
  • On mount, AccountContext now checks ?account=<id> in the URL before falling back to the stored active account, so a freshly opened tab knows which account it belongs to.
  • Add src/nonview/core/openAccountInNewTab.ts, using import.meta.env.BASE_URL (not a bare "/") since the app is served under /quicksilver/.
  • Add src/view/atoms/ConfirmDialog.tsx, a reusable confirm dialog (fullScreen on mobile, centered on desktop — same pattern as ComposeDialog), for later use by "Sign out of all accounts?" and "Remove this account?".

Closes #33

Test plan (After fixing #23 completely)

  • Open a tab with ?account=<id> in the URL, reload, and confirm it still shows that account.
  • Open two tabs on two different accounts simultaneously and confirm each keeps its own active account.
  • Confirm ConfirmDialog renders full-screen on mobile widths and centered on desktop.
  • Confirm no behavior change for existing single-account flows.

@Aravinda-HWK
Aravinda-HWK self-requested a review July 12, 2026 06:13
@saknarajapakshe
saknarajapakshe force-pushed the 33-feat-account-context-multi-tab-plumbing branch from 0726e70 to 98fa3de Compare July 13, 2026 03:41
@saknarajapakshe
saknarajapakshe force-pushed the 33-feat-account-context-multi-tab-plumbing branch from 98fa3de to 633e500 Compare July 15, 2026 03:45
@saknarajapakshe saknarajapakshe changed the title Multi-tab plumbing in AccountContext + reusable ConfirmDialog Feat: Open Account in a New Tab + Reusable ConfirmDialog Component Jul 15, 2026

@maneeshaxyz maneeshaxyz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@saknarajapakshe saknarajapakshe changed the title Feat: Open Account in a New Tab + Reusable ConfirmDialog Component [Feat] Open Account in a New Tab + Reusable ConfirmDialog Component Jul 15, 2026
@maneeshaxyz
maneeshaxyz merged commit 46c53ce into OpenGovMail:main Jul 15, 2026
3 checks passed
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.

Multi-tab plumbing in AccountContext + reusable ConfirmDialog

2 participants