feat(settings): make return-to-list-after-action configurable (default on)
Per review: gate the return-to-list behaviour behind a setting, returnToListAfterAction, defaulting to true (the Gmail/Yahoo default). When off, deleting the open message keeps the previous auto-advance-to-next behaviour. Adds the setting to the store (persisted), a toggle under Reading settings, and i18n keys across all locales (English; non-English need translation). The same setting will govern mark-as-unread (#468).
This commit is contained in:
@@ -3101,11 +3101,13 @@ export default function Home() {
|
|||||||
onForward={handleForward}
|
onForward={handleForward}
|
||||||
onDelete={() => {
|
onDelete={() => {
|
||||||
// Deleting the open message returns to the list (Gmail-style),
|
// Deleting the open message returns to the list (Gmail-style),
|
||||||
// not the next email. Deselect first so the store's
|
// not the next email — unless the user turned the setting off.
|
||||||
// remove-and-advance sees no selection and doesn't auto-open
|
// Deselect first so the store's remove-and-advance sees no
|
||||||
// the next message; then delete the captured email.
|
// selection and doesn't auto-open the next message.
|
||||||
const target = selectedEmail;
|
const target = selectedEmail;
|
||||||
|
if (useSettingsStore.getState().returnToListAfterAction) {
|
||||||
handleMobileBack();
|
handleMobileBack();
|
||||||
|
}
|
||||||
handleDelete(target);
|
handleDelete(target);
|
||||||
}}
|
}}
|
||||||
onArchive={() => handleArchive()}
|
onArchive={() => handleArchive()}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export function ReadingSettings() {
|
|||||||
markAsReadDelay,
|
markAsReadDelay,
|
||||||
deleteAction,
|
deleteAction,
|
||||||
permanentlyDeleteJunk,
|
permanentlyDeleteJunk,
|
||||||
|
returnToListAfterAction,
|
||||||
showPreview,
|
showPreview,
|
||||||
mailLayout,
|
mailLayout,
|
||||||
disableThreading,
|
disableThreading,
|
||||||
@@ -176,6 +177,13 @@ export function ReadingSettings() {
|
|||||||
/>
|
/>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
|
|
||||||
|
<SettingItem label={t('return_to_list_after_action.label')} description={t('return_to_list_after_action.description')}>
|
||||||
|
<ToggleSwitch
|
||||||
|
checked={returnToListAfterAction}
|
||||||
|
onChange={(checked) => updateSetting('returnToListAfterAction', checked)}
|
||||||
|
/>
|
||||||
|
</SettingItem>
|
||||||
|
|
||||||
{!isSettingHidden('showPreview') && (
|
{!isSettingHidden('showPreview') && (
|
||||||
<SettingItem
|
<SettingItem
|
||||||
label={t('show_preview.label')}
|
label={t('show_preview.label')}
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Vypnuto",
|
"off": "Vypnuto",
|
||||||
"seconds": "{seconds} sekund",
|
"seconds": "{seconds} sekund",
|
||||||
"unsupported": "Aktuální účet neoznamuje podporu odloženého odeslání. Nastavení zůstane uloženo pro jiné účty."
|
"unsupported": "Aktuální účet neoznamuje podporu odloženého odeslání. Nastavení zůstane uloženo pro jiné účty."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1229,6 +1229,10 @@
|
|||||||
"off": "Fra",
|
"off": "Fra",
|
||||||
"seconds": "{seconds} sekunder",
|
"seconds": "{seconds} sekunder",
|
||||||
"unsupported": "Den aktuelle konto annoncerer ikke understøttelse af forsinket afsendelse. Indstillingen gemmes stadig for andre konti."
|
"unsupported": "Den aktuelle konto annoncerer ikke understøttelse af forsinket afsendelse. Indstillingen gemmes stadig for andre konti."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Aus",
|
"off": "Aus",
|
||||||
"seconds": "{seconds} Sekunden",
|
"seconds": "{seconds} Sekunden",
|
||||||
"unsupported": "Das aktuelle Konto meldet keine Unterstützung für verzögertes Senden. Die Einstellung bleibt für andere Konten gespeichert."
|
"unsupported": "Das aktuelle Konto meldet keine Unterstützung für verzögertes Senden. Die Einstellung bleibt für andere Konten gespeichert."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1229,6 +1229,10 @@
|
|||||||
"off": "Off",
|
"off": "Off",
|
||||||
"seconds": "{seconds} seconds",
|
"seconds": "{seconds} seconds",
|
||||||
"unsupported": "The current account does not advertise delayed-send support. The setting is still saved for other accounts."
|
"unsupported": "The current account does not advertise delayed-send support. The setting is still saved for other accounts."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Desactivado",
|
"off": "Desactivado",
|
||||||
"seconds": "{seconds} segundos",
|
"seconds": "{seconds} segundos",
|
||||||
"unsupported": "La cuenta actual no anuncia compatibilidad con envío demorado. La opción seguirá guardada para otras cuentas."
|
"unsupported": "La cuenta actual no anuncia compatibilidad con envío demorado. La opción seguirá guardada para otras cuentas."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Désactivé",
|
"off": "Désactivé",
|
||||||
"seconds": "{seconds} secondes",
|
"seconds": "{seconds} secondes",
|
||||||
"unsupported": "Le compte actuel n’annonce pas la prise en charge de l’envoi différé. Le réglage reste enregistré pour d’autres comptes."
|
"unsupported": "Le compte actuel n’annonce pas la prise en charge de l’envoi différé. Le réglage reste enregistré pour d’autres comptes."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1229,6 +1229,10 @@
|
|||||||
"off": "Kikapcsolva",
|
"off": "Kikapcsolva",
|
||||||
"seconds": "{seconds} másodperc",
|
"seconds": "{seconds} másodperc",
|
||||||
"unsupported": "A jelenlegi fiók nem támogatja a késleltetett küldést. A beállítás más fiókokhoz elmentésre kerül."
|
"unsupported": "A jelenlegi fiók nem támogatja a késleltetett küldést. A beállítás más fiókokhoz elmentésre kerül."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Disattivato",
|
"off": "Disattivato",
|
||||||
"seconds": "{seconds} secondi",
|
"seconds": "{seconds} secondi",
|
||||||
"unsupported": "L’account corrente non dichiara il supporto all’invio ritardato. L’impostazione resta salvata per altri account."
|
"unsupported": "L’account corrente non dichiara il supporto all’invio ritardato. L’impostazione resta salvata per altri account."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "オフ",
|
"off": "オフ",
|
||||||
"seconds": "{seconds} 秒",
|
"seconds": "{seconds} 秒",
|
||||||
"unsupported": "現在のアカウントは遅延送信のサポートを通知していません。この設定は他のアカウント用に保存されます。"
|
"unsupported": "現在のアカウントは遅延送信のサポートを通知していません。この設定は他のアカウント用に保存されます。"
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "끔",
|
"off": "끔",
|
||||||
"seconds": "{seconds}초",
|
"seconds": "{seconds}초",
|
||||||
"unsupported": "현재 계정은 지연 보내기 지원을 알리지 않습니다. 설정은 다른 계정을 위해 계속 저장됩니다."
|
"unsupported": "현재 계정은 지연 보내기 지원을 알리지 않습니다. 설정은 다른 계정을 위해 계속 저장됩니다."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Izslēgts",
|
"off": "Izslēgts",
|
||||||
"seconds": "{seconds} sekundes",
|
"seconds": "{seconds} sekundes",
|
||||||
"unsupported": "Pašreizējais konts neziņo par aizturētas sūtīšanas atbalstu. Iestatījums joprojām tiks saglabāts citiem kontiem."
|
"unsupported": "Pašreizējais konts neziņo par aizturētas sūtīšanas atbalstu. Iestatījums joprojām tiks saglabāts citiem kontiem."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Uit",
|
"off": "Uit",
|
||||||
"seconds": "{seconds} seconden",
|
"seconds": "{seconds} seconden",
|
||||||
"unsupported": "Het huidige account meldt geen ondersteuning voor vertraagd verzenden. De instelling blijft opgeslagen voor andere accounts."
|
"unsupported": "Het huidige account meldt geen ondersteuning voor vertraagd verzenden. De instelling blijft opgeslagen voor andere accounts."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Wyłączone",
|
"off": "Wyłączone",
|
||||||
"seconds": "{seconds} sekund",
|
"seconds": "{seconds} sekund",
|
||||||
"unsupported": "Bieżące konto nie zgłasza obsługi opóźnionej wysyłki. Ustawienie pozostanie zapisane dla innych kont."
|
"unsupported": "Bieżące konto nie zgłasza obsługi opóźnionej wysyłki. Ustawienie pozostanie zapisane dla innych kont."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Desativado",
|
"off": "Desativado",
|
||||||
"seconds": "{seconds} segundos",
|
"seconds": "{seconds} segundos",
|
||||||
"unsupported": "A conta atual não anuncia suporte a envio atrasado. A configuração continuará salva para outras contas."
|
"unsupported": "A conta atual não anuncia suporte a envio atrasado. A configuração continuará salva para outras contas."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1229,6 +1229,10 @@
|
|||||||
"off": "Oprit",
|
"off": "Oprit",
|
||||||
"seconds": "{seconds} secunde",
|
"seconds": "{seconds} secunde",
|
||||||
"unsupported": "Contul curent nu indică faptul că acceptă trimiterea amânată. Setarea este totuși salvată pentru alte conturi."
|
"unsupported": "Contul curent nu indică faptul că acceptă trimiterea amânată. Setarea este totuși salvată pentru alte conturi."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Выкл.",
|
"off": "Выкл.",
|
||||||
"seconds": "{seconds} сек.",
|
"seconds": "{seconds} сек.",
|
||||||
"unsupported": "Текущая учетная запись не заявляет поддержку отложенной отправки. Настройка сохранится для других учетных записей."
|
"unsupported": "Текущая учетная запись не заявляет поддержку отложенной отправки. Настройка сохранится для других учетных записей."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Kapalı",
|
"off": "Kapalı",
|
||||||
"seconds": "{seconds} saniye",
|
"seconds": "{seconds} saniye",
|
||||||
"unsupported": "Geçerli hesap gecikmeli gönderim desteği bildirmiyor. Ayar diğer hesaplar için kaydedilmeye devam eder."
|
"unsupported": "Geçerli hesap gecikmeli gönderim desteği bildirmiyor. Ayar diğer hesaplar için kaydedilmeye devam eder."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "Вимкнено",
|
"off": "Вимкнено",
|
||||||
"seconds": "{seconds} с",
|
"seconds": "{seconds} с",
|
||||||
"unsupported": "Поточний обліковий запис не повідомляє про підтримку відкладеного надсилання. Налаштування залишиться збереженим для інших облікових записів."
|
"unsupported": "Поточний обліковий запис не повідомляє про підтримку відкладеного надсилання. Налаштування залишиться збереженим для інших облікових записів."
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -1226,6 +1226,10 @@
|
|||||||
"off": "关闭",
|
"off": "关闭",
|
||||||
"seconds": "{seconds} 秒",
|
"seconds": "{seconds} 秒",
|
||||||
"unsupported": "当前账户未声明支持延迟发送。该设置仍会为其他账户保存。"
|
"unsupported": "当前账户未声明支持延迟发送。该设置仍会为其他账户保存。"
|
||||||
|
},
|
||||||
|
"return_to_list_after_action": {
|
||||||
|
"label": "Return to list after delete or mark unread",
|
||||||
|
"description": "After deleting or marking the open message unread, go back to the message list instead of opening the next message."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ interface SettingsState {
|
|||||||
markAsReadDelay: number; // milliseconds (0 = instant, -1 = never)
|
markAsReadDelay: number; // milliseconds (0 = instant, -1 = never)
|
||||||
deleteAction: DeleteAction;
|
deleteAction: DeleteAction;
|
||||||
permanentlyDeleteJunk: boolean; // Permanently delete emails from junk/spam instead of moving to trash
|
permanentlyDeleteJunk: boolean; // Permanently delete emails from junk/spam instead of moving to trash
|
||||||
|
returnToListAfterAction: boolean; // After delete / mark-unread in an open message, return to the list instead of opening the next message
|
||||||
showPreview: boolean;
|
showPreview: boolean;
|
||||||
mailLayout: MailLayout;
|
mailLayout: MailLayout;
|
||||||
emailsPerPage: number;
|
emailsPerPage: number;
|
||||||
@@ -330,6 +331,7 @@ const DEFAULT_SETTINGS = {
|
|||||||
markAsReadDelay: 0, // Instant
|
markAsReadDelay: 0, // Instant
|
||||||
deleteAction: 'trash' as DeleteAction,
|
deleteAction: 'trash' as DeleteAction,
|
||||||
permanentlyDeleteJunk: false,
|
permanentlyDeleteJunk: false,
|
||||||
|
returnToListAfterAction: true,
|
||||||
showPreview: true,
|
showPreview: true,
|
||||||
mailLayout: 'split' as MailLayout,
|
mailLayout: 'split' as MailLayout,
|
||||||
emailsPerPage: 50,
|
emailsPerPage: 50,
|
||||||
@@ -533,6 +535,7 @@ export const useSettingsStore = create<SettingsState>()(
|
|||||||
firstDayOfWeek: state.firstDayOfWeek,
|
firstDayOfWeek: state.firstDayOfWeek,
|
||||||
markAsReadDelay: state.markAsReadDelay,
|
markAsReadDelay: state.markAsReadDelay,
|
||||||
deleteAction: state.deleteAction,
|
deleteAction: state.deleteAction,
|
||||||
|
returnToListAfterAction: state.returnToListAfterAction,
|
||||||
showPreview: state.showPreview,
|
showPreview: state.showPreview,
|
||||||
mailLayout: state.mailLayout,
|
mailLayout: state.mailLayout,
|
||||||
emailsPerPage: state.emailsPerPage,
|
emailsPerPage: state.emailsPerPage,
|
||||||
|
|||||||
Reference in New Issue
Block a user