mirror of
https://github.com/bulwarkmail/native.git
synced 2026-10-31 16:06: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:
@@ -716,6 +716,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "كل البريد"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "كل المميز بنجمة"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "كل غير المقروء"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "أعد تشغيل التطبيق لتطبيق اتجاه النص الجديد.",
|
||||
"system_default": "افتراضي النظام"
|
||||
|
||||
@@ -721,6 +721,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Tot el correu"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Tots els destacats"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Tots els no llegits"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Reinicieu l'aplicació per aplicar la nova direcció del text.",
|
||||
"system_default": "Predeterminat del sistema"
|
||||
|
||||
@@ -720,6 +720,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Veškerá pošta"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Vše s hvězdičkou"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Vše nepřečtené"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Pro použití nového směru textu restartujte aplikaci.",
|
||||
"system_default": "Podle systému"
|
||||
|
||||
@@ -717,6 +717,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Al post"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Alle med stjerne"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Alle ulæste"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Genstart appen for at anvende den nye tekstretning.",
|
||||
"system_default": "Systemstandard"
|
||||
|
||||
@@ -747,6 +747,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Alle Mails"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Alle markierten"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Alle ungelesenen"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Starten Sie die App neu, um die neue Schreibrichtung anzuwenden.",
|
||||
"system_default": "Systemstandard"
|
||||
|
||||
@@ -1017,6 +1017,15 @@
|
||||
"description_mobile": "Text size, reduced motion and the accessibility presets are on the Accessibility page."
|
||||
},
|
||||
"description_mobile": "Customize how the app looks",
|
||||
"cross_all": {
|
||||
"label_mobile": "All mail"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "All starred"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "All unread"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Restart the app to apply the new text direction.",
|
||||
"system_default": "System default"
|
||||
|
||||
@@ -726,6 +726,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Todo el correo"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Todo destacado"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Todo no leído"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Reinicia la app para aplicar la nueva dirección del texto.",
|
||||
"system_default": "Predeterminado del sistema"
|
||||
|
||||
@@ -715,6 +715,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "همه ایمیلها"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "همه ستارهدارها"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "همه خواندهنشدهها"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "برای اعمال جهت جدید متن، برنامه را دوباره راهاندازی کنید.",
|
||||
"system_default": "پیشفرض سیستم"
|
||||
|
||||
@@ -724,6 +724,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Tout le courrier"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Tous les favoris"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Tous les non lus"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Redémarrez l'application pour appliquer le nouveau sens du texte.",
|
||||
"system_default": "Par défaut du système"
|
||||
|
||||
@@ -719,6 +719,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "הכל דוא״ל"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "הכל מסומנים"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "הכל שלא נקראו"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "הפעל מחדש את האפליקציה כדי להחיל את כיוון הטקסט החדש.",
|
||||
"system_default": "ברירת המחדל של המערכת"
|
||||
|
||||
@@ -716,6 +716,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Összes levél"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Összes csillagozott"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Összes olvasatlan"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Az új szövegirány alkalmazásához indítsd újra az alkalmazást.",
|
||||
"system_default": "Rendszer alapértelmezése"
|
||||
|
||||
@@ -722,6 +722,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Tutta la posta"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Tutti gli speciali"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Tutti i non letti"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Riavvia l'app per applicare la nuova direzione del testo.",
|
||||
"system_default": "Predefinita di sistema"
|
||||
|
||||
@@ -721,6 +721,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "すべてのメール"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "すべてのスター付き"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "すべての未読"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "新しい文字の方向を適用するには、アプリを再起動してください。",
|
||||
"system_default": "システムのデフォルト"
|
||||
|
||||
@@ -719,6 +719,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "모든 메일"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "모든 별표"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "모든 읽지 않음"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "새 텍스트 방향을 적용하려면 앱을 다시 시작해 주세요.",
|
||||
"system_default": "시스템 기본값"
|
||||
|
||||
@@ -720,6 +720,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Visas vēstules"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Visi ar zvaigzni"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Visi nelasītie"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Restartējiet lietotni, lai lietotu jauno teksta virzienu.",
|
||||
"system_default": "Sistēmas noklusējums"
|
||||
|
||||
@@ -716,6 +716,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Бүх шуудан"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Бүх одтой"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Бүгд уншаагүй"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Текстийн шинэ чиглэлийг хэрэгжүүлэхийн тулд аппыг дахин эхлүүлнэ үү.",
|
||||
"system_default": "Системийн өгөгдмөл"
|
||||
|
||||
@@ -718,6 +718,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "All e-post"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Alle stjernemerkede"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Alle uleste"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Start appen på nytt for å bruke den nye tekstretningen.",
|
||||
"system_default": "Systemstandard"
|
||||
|
||||
@@ -720,6 +720,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Alle e-mail"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Alle met ster"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Alle ongelezen"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Start de app opnieuw om de nieuwe tekstrichting toe te passen.",
|
||||
"system_default": "Systeemstandaard"
|
||||
|
||||
@@ -720,6 +720,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Cała poczta"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Wszystkie oznaczone gwiazdką"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Wszystkie nieprzeczytane"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Uruchom aplikację ponownie, aby zastosować nowy kierunek tekstu.",
|
||||
"system_default": "Ustawienie systemowe"
|
||||
|
||||
@@ -723,6 +723,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Todo o correio"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Tudo com estrela"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Tudo não lido"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Reinicie o app para aplicar a nova direção do texto.",
|
||||
"system_default": "Padrão do sistema"
|
||||
|
||||
@@ -720,6 +720,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Toată poșta"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Toate cu stea"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Toate necitite"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Reporniți aplicația pentru a aplica noua direcție a textului.",
|
||||
"system_default": "Implicit de sistem"
|
||||
|
||||
@@ -724,6 +724,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Вся почта"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Все помеченные"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Все непрочитанные"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Перезапустите приложение, чтобы применить новое направление текста.",
|
||||
"system_default": "Как в системе"
|
||||
|
||||
@@ -719,6 +719,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Všetka pošta"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Všetky s hviezdičkou"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Všetky neprečítané"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Na použitie nového smeru textu reštartujte aplikáciu.",
|
||||
"system_default": "Podľa systému"
|
||||
|
||||
@@ -721,6 +721,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Tüm postalar"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Tüm yıldızlılar"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Tüm okunmamışlar"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Yeni metin yönünü uygulamak için uygulamayı yeniden başlatın.",
|
||||
"system_default": "Sistem varsayılanı"
|
||||
|
||||
@@ -723,6 +723,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "Уся пошта"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "Усі позначені"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "Усі непрочитані"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "Перезапустіть застосунок, щоб застосувати новий напрямок тексту.",
|
||||
"system_default": "Як у системі"
|
||||
|
||||
@@ -720,6 +720,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "全部郵件"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "全部已加星號"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "全部未讀"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "請重新啟動應用程式以套用新的文字方向。",
|
||||
"system_default": "系統預設"
|
||||
|
||||
@@ -720,6 +720,15 @@
|
||||
}
|
||||
},
|
||||
"appearance": {
|
||||
"cross_all": {
|
||||
"label_mobile": "全部邮件"
|
||||
},
|
||||
"cross_starred": {
|
||||
"label_mobile": "全部加星标"
|
||||
},
|
||||
"cross_unread": {
|
||||
"label_mobile": "全部未读"
|
||||
},
|
||||
"language": {
|
||||
"restart_for_direction": "请重启应用以应用新的文字方向。",
|
||||
"system_default": "系统默认"
|
||||
|
||||
@@ -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 }}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { showUnifiedSection } from '../unified-section';
|
||||
import { showUnifiedSection, visibleCrossViews } from '../unified-section';
|
||||
|
||||
const base = { accountCount: 1, unifiedCrossAccount: false, includeGroupInUnified: true, hasSharedInbox: false };
|
||||
|
||||
@@ -19,3 +19,21 @@ describe('showUnifiedSection (#843)', () => {
|
||||
expect(showUnifiedSection({ ...base, hasSharedInbox: true, includeGroupInUnified: false })).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
const off = { showUnified: false, enableCrossUnreadView: false, enableCrossStarredView: false, enableCrossAllView: false };
|
||||
|
||||
describe('visibleCrossViews', () => {
|
||||
it('lists none for a single account until one is turned on', () => {
|
||||
expect(visibleCrossViews(off)).toEqual([]);
|
||||
});
|
||||
|
||||
it('lists the turned-on views for a single account, in drawer order', () => {
|
||||
expect(visibleCrossViews({ ...off, enableCrossAllView: true })).toEqual(['all']);
|
||||
expect(visibleCrossViews({ ...off, enableCrossStarredView: true })).toEqual(['starred']);
|
||||
expect(visibleCrossViews({ ...off, enableCrossAllView: true, enableCrossUnreadView: true })).toEqual(['unread', 'all']);
|
||||
});
|
||||
|
||||
it('keeps all three alongside the unified section, whatever the toggles', () => {
|
||||
expect(visibleCrossViews({ ...off, showUnified: true })).toEqual(['unread', 'starred', 'all']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -88,6 +88,9 @@ export const SETTINGS_SEARCH_PATHS: Record<SettingsTabId, string[]> = {
|
||||
'settings.layout.show_folder_total_count',
|
||||
'settings.layout.show_avatars_in_junk',
|
||||
'settings.layout.unified_cross_account',
|
||||
'settings.appearance.cross_unread',
|
||||
'settings.appearance.cross_starred',
|
||||
'settings.appearance.cross_all',
|
||||
],
|
||||
reading: [
|
||||
'settings.email_behavior.mark_read',
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { CrossView } from '../api/unified-inbox';
|
||||
|
||||
/**
|
||||
* Whether the drawer offers the unified mailbox (the "All inboxes" row and
|
||||
* the Unified section), following the webmail's rule (#843): only when the
|
||||
@@ -18,3 +20,28 @@ export function showUnifiedSection(opts: {
|
||||
const crossAccountActive = opts.unifiedCrossAccount && opts.accountCount > 1;
|
||||
return crossAccountActive || (opts.includeGroupInUnified && opts.hasSharedInbox);
|
||||
}
|
||||
|
||||
const CROSS_VIEW_ORDER: CrossView[] = ['unread', 'starred', 'all'];
|
||||
|
||||
/**
|
||||
* Which cross-folder views (All unread / All starred / All mail) the drawer
|
||||
* lists. Alongside the unified section they all show, as before. Without it -
|
||||
* a single account, no group inbox merged in - each one shows once turned on
|
||||
* in Settings > Layout, like the webmail's per-view toggles: they span the
|
||||
* inbox and the custom folders, so even for one account they are not a repeat
|
||||
* of any single folder.
|
||||
*/
|
||||
export function visibleCrossViews(opts: {
|
||||
showUnified: boolean;
|
||||
enableCrossUnreadView: boolean;
|
||||
enableCrossStarredView: boolean;
|
||||
enableCrossAllView: boolean;
|
||||
}): CrossView[] {
|
||||
if (opts.showUnified) return [...CROSS_VIEW_ORDER];
|
||||
const enabled: Record<CrossView, boolean> = {
|
||||
unread: opts.enableCrossUnreadView,
|
||||
starred: opts.enableCrossStarredView,
|
||||
all: opts.enableCrossAllView,
|
||||
};
|
||||
return CROSS_VIEW_ORDER.filter((view) => enabled[view]);
|
||||
}
|
||||
|
||||
@@ -217,6 +217,13 @@ export interface PersistedSettings {
|
||||
// Unified views span every logged-in account instead of just the active
|
||||
// one (own + its shared/group folders). Off by default like the webmail.
|
||||
unifiedCrossAccount: boolean;
|
||||
// Cross-folder entries of the unified mailbox (All unread / All starred /
|
||||
// All mail over the inbox and custom folders). They always come with the
|
||||
// unified section; these opt them in without it, e.g. for a single account
|
||||
// (parity with the webmail toggles of the same names, off by default).
|
||||
enableCrossUnreadView: boolean;
|
||||
enableCrossStarredView: boolean;
|
||||
enableCrossAllView: boolean;
|
||||
mailAttachmentAction: MailAttachmentAction;
|
||||
attachmentPosition: AttachmentPosition;
|
||||
// Reader body: font for text/plain bodies (#830), gutter around the body,
|
||||
@@ -414,6 +421,9 @@ const DEFAULT_PERSISTED: PersistedSettings = {
|
||||
showFolderTotalCount: true,
|
||||
clearSearchOnFolderChange: false,
|
||||
unifiedCrossAccount: false,
|
||||
enableCrossUnreadView: false,
|
||||
enableCrossStarredView: false,
|
||||
enableCrossAllView: false,
|
||||
mailAttachmentAction: 'preview',
|
||||
attachmentPosition: 'beside-sender',
|
||||
plainTextFont: 'sans',
|
||||
|
||||
Reference in New Issue
Block a user