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:
Shuki Vaknin
2026-06-24 02:23:57 +02:00
committed by Linus Rath
parent d671c606a1
commit acc61db6f2
22 changed files with 93 additions and 4 deletions
+6 -4
View File
@@ -3101,11 +3101,13 @@ export default function Home() {
onForward={handleForward}
onDelete={() => {
// Deleting the open message returns to the list (Gmail-style),
// not the next email. Deselect first so the store's
// remove-and-advance sees no selection and doesn't auto-open
// the next message; then delete the captured email.
// not the next email — unless the user turned the setting off.
// Deselect first so the store's remove-and-advance sees no
// selection and doesn't auto-open the next message.
const target = selectedEmail;
handleMobileBack();
if (useSettingsStore.getState().returnToListAfterAction) {
handleMobileBack();
}
handleDelete(target);
}}
onArchive={() => handleArchive()}