mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-03 16:07:32 +00:00
Merge branch 'pr-66' into catch-up-2026-11
# Conflicts: # locales/rn/en.json # src/components/SidebarDrawer.tsx
This commit is contained in:
@@ -27,7 +27,7 @@ import {
|
||||
buildMailboxTree, flattenVisible, mailboxSubtreeIds, ownMailboxes, type MailboxNode,
|
||||
} from '../lib/mailbox-tree';
|
||||
import { localizeMailboxName } from '../lib/mailbox-label';
|
||||
import { showUnifiedSection } from '../lib/unified-section';
|
||||
import { showUnifiedSection, visibleCrossViews } from '../lib/unified-section';
|
||||
import { generateAvatarColor, getAccountInitials } from '../lib/avatar-utils';
|
||||
import { jmapClient } from '../api/jmap-client';
|
||||
import {
|
||||
@@ -346,6 +346,9 @@ export default function SidebarDrawer({ visible, onClose, docked = false }: Side
|
||||
const showFolderTotalCount = useSettingsStore((s) => s.showFolderTotalCount);
|
||||
const includeGroupInUnified = useSettingsStore((s) => s.includeGroupInUnified);
|
||||
const unifiedCrossAccount = useSettingsStore((s) => s.unifiedCrossAccount);
|
||||
const enableCrossUnreadView = useSettingsStore((s) => s.enableCrossUnreadView);
|
||||
const enableCrossStarredView = useSettingsStore((s) => s.enableCrossStarredView);
|
||||
const enableCrossAllView = useSettingsStore((s) => s.enableCrossAllView);
|
||||
const notificationMutes = useSettingsStore((s) => s.notificationMutes);
|
||||
const updateSetting = useSettingsStore((s) => s.updateSetting);
|
||||
const keywordDefs = useKeywordsStore((s) => s.keywords);
|
||||
@@ -713,6 +716,9 @@ export default function SidebarDrawer({ visible, onClose, docked = false }: Side
|
||||
const showUnified = showUnifiedSection({
|
||||
accountCount: accounts.length, unifiedCrossAccount, includeGroupInUnified, hasSharedInbox,
|
||||
});
|
||||
const crossViews = visibleCrossViews({
|
||||
showUnified, enableCrossUnreadView, enableCrossStarredView, enableCrossAllView,
|
||||
});
|
||||
const unifiedCounts = React.useMemo(() => {
|
||||
const pools: Mailbox[][] = [mailboxes];
|
||||
if (unifiedCrossAccount) {
|
||||
@@ -1054,7 +1060,7 @@ export default function SidebarDrawer({ visible, onClose, docked = false }: Side
|
||||
</Pressable>
|
||||
|
||||
{/* Unified per-role and cross views */}
|
||||
{showUnified && (
|
||||
{(showUnified || crossViews.length > 0) && (
|
||||
<>
|
||||
<Pressable style={styles.sectionHeader} onPress={() => toggleSection('unifiedExpanded', setUnifiedExpanded)}>
|
||||
{unifiedExpanded ? (
|
||||
@@ -1070,7 +1076,7 @@ export default function SidebarDrawer({ visible, onClose, docked = false }: Side
|
||||
{ view: 'unread' as const, Icon: MailOpen, label: t('sidebar.unified_all_unread', 'All unread'), unread: unifiedCounts.crossUnread },
|
||||
{ view: 'starred' as const, Icon: Star, label: t('sidebar.unified_all_starred', 'All starred'), unread: 0 },
|
||||
{ view: 'all' as const, Icon: Mails, label: t('sidebar.unified_all_mail', 'All mail'), unread: unifiedCounts.crossUnread },
|
||||
]).map((row) => (
|
||||
]).filter((row) => crossViews.includes(row.view)).map((row) => (
|
||||
<SidebarRow
|
||||
key={row.view}
|
||||
icon={<row.Icon size={16} color={c.textSecondary} />}
|
||||
@@ -1086,7 +1092,7 @@ export default function SidebarDrawer({ visible, onClose, docked = false }: Side
|
||||
onToggleExpand={() => {}}
|
||||
/>
|
||||
))}
|
||||
{unifiedCounts.roles.map((r) => {
|
||||
{showUnified && unifiedCounts.roles.map((r) => {
|
||||
const Icon = unifiedIcon(r.role);
|
||||
return (
|
||||
<SidebarRow
|
||||
|
||||
@@ -90,6 +90,9 @@ export function LayoutSettings() {
|
||||
const showAvatarsInJunk = useSettingsStore((s) => s.showAvatarsInJunk);
|
||||
const showFolderTotalCount = useSettingsStore((s) => s.showFolderTotalCount);
|
||||
const unifiedCrossAccount = useSettingsStore((s) => s.unifiedCrossAccount);
|
||||
const enableCrossUnreadView = useSettingsStore((s) => s.enableCrossUnreadView);
|
||||
const enableCrossStarredView = useSettingsStore((s) => s.enableCrossStarredView);
|
||||
const enableCrossAllView = useSettingsStore((s) => s.enableCrossAllView);
|
||||
const keywordDefs = useKeywordsStore((s) => s.keywords);
|
||||
const invalidateListOrder = useEmailStore((s) => s.invalidateListOrder);
|
||||
const order = React.useMemo(() => sanitizeSortLevels(messageListOrderRaw), [messageListOrderRaw]);
|
||||
@@ -182,10 +185,28 @@ export function LayoutSettings() {
|
||||
<SettingItem
|
||||
label={t('settings.layout.unified_cross_account', 'Unified views across accounts')}
|
||||
description={t('settings.layout.unified_cross_account_description', 'Combine every signed-in account in "All inboxes". Off keeps the unified views inside the active account and its shared folders.')}
|
||||
noBorder
|
||||
>
|
||||
<ToggleSwitch checked={unifiedCrossAccount} onChange={(v) => update('unifiedCrossAccount', v)} />
|
||||
</SettingItem>
|
||||
<SettingItem
|
||||
label={t('settings.appearance.cross_unread.label_mobile', 'All unread')}
|
||||
description={t('settings.appearance.cross_unread.description', 'Show an Unread entry in the Unified Mailbox listing unread mail across the selected folders.')}
|
||||
>
|
||||
<ToggleSwitch checked={enableCrossUnreadView} onChange={(v) => update('enableCrossUnreadView', v)} />
|
||||
</SettingItem>
|
||||
<SettingItem
|
||||
label={t('settings.appearance.cross_starred.label_mobile', 'All starred')}
|
||||
description={t('settings.appearance.cross_starred.description', 'Show a Starred entry in the Unified Mailbox listing flagged/starred mail across the selected folders.')}
|
||||
>
|
||||
<ToggleSwitch checked={enableCrossStarredView} onChange={(v) => update('enableCrossStarredView', v)} />
|
||||
</SettingItem>
|
||||
<SettingItem
|
||||
label={t('settings.appearance.cross_all.label_mobile', 'All mail')}
|
||||
description={t('settings.appearance.cross_all.description', 'Show an All mail entry in the Unified Mailbox listing all mail across the selected folders.')}
|
||||
noBorder
|
||||
>
|
||||
<ToggleSwitch checked={enableCrossAllView} onChange={(v) => update('enableCrossAllView', v)} />
|
||||
</SettingItem>
|
||||
</View>
|
||||
|
||||
<View style={{ gap: spacing.sm, marginTop: spacing.lg }}>
|
||||
|
||||
Reference in New Issue
Block a user