Skip to content

feat: add combined inbox view across connected mailboxes - #2087

Closed
elizabethburg wants to merge 2 commits into
Mail-0:stagingfrom
elizabethburg:feature/combined-inbox
Closed

elizabethburg wants to merge 2 commits into
Mail-0:stagingfrom
elizabethburg:feature/combined-inbox

Conversation

@elizabethburg

Copy link
Copy Markdown

Summary

  • Adds a "Combined Inbox" view that merges recent inbox threads from every connected mailbox into one date-sorted list, so users with multiple accounts don't have to switch accounts just to scan for new mail.
  • New mail.listAllThreads tRPC procedure fans out to each of the user's connected (tokened) accounts in parallel, tags each thread with its source account, and merges/sorts by received date.
  • Thread rows use preview data (subject, sender, received date) that was already being computed in the local thread cache but discarded before reaching the client — no extra per-thread fetch needed.
  • Clicking a thread in the combined view switches the active connection to its owning account (reusing the existing connections.setDefault) and opens it in the normal single-account thread view.
  • Small drive-by fix: app-sidebar.tsx's nav-badge assignment indexed into the sidebar's "Core" section by fixed array position, which the new nav item would have silently broken — changed to look up by item id instead.
  • Also includes a separate first commit fixing pre-existing lint warnings (unused imports/vars in chat.ts and email-verification.ts) that were failing the repo's own --deny-warnings pre-commit hook on staging HEAD, unrelated to this feature but blocking any commit.

Scope / known limitations for this first pass

  • Combined view covers the inbox folder only — no cross-account search or infinite pagination yet.
  • Only the English locale string (navigation.sidebar.combined) was added; other locales will fall back to English until translated.

Test plan

  • tsc --noEmit clean on all touched files (server + mail)
  • oxlint --deny-warnings clean (full repo)
  • react-router build succeeds
  • Manual click-through in a running dev environment with 2+ connected mailboxes (not yet done by a maintainer/reviewer)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rno78tLTPRHVACcZ4EHmYJ

Elizabeth M Burg and others added 2 commits September 11, 2026 14:22
The repo's own pre-commit hook (oxlint --deny-warnings) currently
fails on staging HEAD due to unrelated unused-import/unused-variable
warnings in chat.ts and email-verification.ts, which blocks any
commit to the repo, not just this branch. Fixed the flagged warnings:
removed unused imports (ConnectionContext, createSimpleAuth,
SimpleAuth, parseHeaders, groq) and an unused interface (ThreadRow)
in chat.ts, prefixed a couple of genuinely-unused-but-kept variables
with `_`, and dropped unused catch/callback error bindings across
both files. No behavior changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rno78tLTPRHVACcZ4EHmYJ
Adds a new "Combined Inbox" nav item that shows recent inbox threads
from every connected mailbox in one merged, date-sorted list, so
users with multiple accounts don't have to switch between them to
scan for new mail.

- New `mail.listAllThreads` tRPC procedure fans out to each of the
  user's tokened connections in parallel, tags each thread with its
  source account, and merges/sorts the results by received date.
- Thread rows carry inline preview data (subject, sender, received
  date) already stored on the local thread cache, avoiding a second
  per-thread fetch. `getThreadsFromDB`/`queryThreads` in the ZeroDriver
  agent now surface `latestSubject`/`latestSender` (previously
  computed but discarded) alongside `latestReceivedOn`; the 5 near-
  identical row-mapping call sites in `queryThreads` are consolidated
  into one `mapThreadRow` helper.
- New `/mail/combined` route + page renders the merged list; clicking
  a thread switches the active connection to its owning account (via
  the existing `connections.setDefault`) and opens it in the normal
  single-account thread view.
- `cleanNameDisplay` (sender-name cleanup) is promoted from a private
  helper in `mail-list.tsx` to a shared `lib/utils.ts` export so the
  new page can reuse it.
- Sidebar badge assignment in `app-sidebar.tsx` was indexing into the
  "Core" nav section by fixed array position (`items[0].items[3]` for
  Sent), which the new nav item would have silently shifted; changed
  to look up by item `id` instead so it's robust to reordering.

Scope for this first pass: combined view covers the inbox folder only
(no cross-account search or infinite pagination yet), and only the
English locale string was added — other locales fall back to English
until translated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rno78tLTPRHVACcZ4EHmYJ
@elizabethburg

Copy link
Copy Markdown
Author

Withdrawing this for now — the combined inbox view needs real design work before it's ready to propose upstream (doesn't match the app's existing list styling, and the account-merging needs more testing). Will reopen or resubmit once it's actually good.

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