Skip to content

feat(unified): let a single account turn on All mail / All unread / All starred - #66

Open
lucletoffe wants to merge 1 commit into
bulwarkmail:mainfrom
lucletoffe:feat/single-account-cross-views
Open

lucletoffe wants to merge 1 commit into
bulwarkmail:mainfrom
lucletoffe:feat/single-account-cross-views

Conversation

@lucletoffe

Copy link
Copy Markdown
Contributor

Problem

With a single account, the drawer never shows the Unified section (#843 rule in lib/unified-section.ts: it needs a second account with cross-account on, or a merged group inbox). The cross-folder views - All unread, All starred, All mail - already exist (api/unified-inbox.ts, UnifiedInboxScreen) but are unreachable there.

Unlike "All inboxes", those views are not a repeat of one folder for a single account: they span the inbox and every custom folder. When server-side filters (Sieve) sort mail into folders, there is no way on mobile to read it all in one list - you go folder by folder. The webmail covers this case with its per-view toggles (enableCrossUnreadView / enableCrossStarredView / enableCrossAllView, Settings > Layout), which show the section with a single account.

Change

  • settings-store: the three webmail toggles, same names, off by default - nothing changes for anyone who doesn't turn them on.
  • lib/unified-section.ts: visibleCrossViews() (pure, tested). Alongside the unified section all three views still show, as before; without it, each turned-on view shows.
  • SidebarDrawer: the Unified section renders when either applies. "All inboxes" and the per-role rows (All sent, All trash…) keep the #843 rule, so a single account gets no duplicate Inbox.
  • LayoutSettings: three toggles under "Unified views across accounts", indexed by settings search. Labels are settings.appearance.cross_*.label_mobile in the RN overlays, filled from each language's existing sidebar.unified_all_* webmail translation, so the search result and the row label match; descriptions reuse the webmail's settings.appearance.cross_*.description.

Left out on purpose: the webmail's per-account folder picker (allMailFolderIds) - the views keep the role-exclusion default (inbox + custom folders). And when the unified section is already shown (several accounts, or a group inbox), the toggles don't hide anything, to avoid removing rows existing users have today. Happy to make them authoritative there too, as in the webmail, if you prefer.

Tests

  • src/lib/__tests__/unified-section.test.ts: 3 new cases.
  • tsc --noEmit clean, npm run i18n:check OK, full vitest suite green (3220 passed, 16 skipped).
  • Android release build (0.1.72 + this commit) OK.

🤖 Generated with Claude Code

…ll starred

The drawer hid the whole Unified section unless a second account (with
cross-account on) or a merged group inbox fed it (#843), so a single
account never reached the cross-folder views - although they span the
inbox and every custom folder and repeat no single folder. Sieve-sorted
mail could only be read folder by folder.

Port the webmail's per-view toggles (enableCrossUnreadView,
enableCrossStarredView, enableCrossAllView; off by default) to Settings >
Layout. A turned-on view shows in the Unified section even when the
section would otherwise stay hidden; "All inboxes" and the per-role rows
keep the #843 rule. Alongside the section all three still show, as
before.

The toggles are labelled with the drawer rows' names: their
`label_mobile` in each RN overlay is that language's
`sidebar.unified_all_*` from the webmail catalog, so settings search
lands on the row. Descriptions are the webmail's own.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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