From f10093dcf537c340577aac5edd6f0720b79e40df Mon Sep 17 00:00:00 2001 From: "Can K." Date: Sat, 10 Oct 2026 22:27:31 +0300 Subject: [PATCH] Make "Move to Inbox" work from Snoozed and custom folders (#90) Moving a snoozed message to the Inbox only set its status to received, which it already was, and left snoozedUntil alone. The Snoozed list keeps showing messages whose snooze has not run out, and the Inbox hides them, so nothing visible happened. Moving to the Inbox now clears the snooze. The toolbar also left "Inbox" out of the move menu whenever it did not know the folder, which is always the case in a custom folder, so mail could not be moved back to the Inbox from there. It is only hidden in the Inbox itself now. Co-authored-by: Can Kirca <9063990+cankirca@users.noreply.github.com> --- src/app/api/messages/bulk/route.ts | 1 + src/components/messages/bulk-message-toolbar.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/api/messages/bulk/route.ts b/src/app/api/messages/bulk/route.ts index 27a400f..78b65b1 100644 --- a/src/app/api/messages/bulk/route.ts +++ b/src/app/api/messages/bulk/route.ts @@ -59,6 +59,7 @@ export async function POST(request: Request) { ...(status ? { status } : {}), ...(read !== null ? { read } : {}), ...(folderId !== undefined ? { folderId } : {}), + ...(payload.action === "inbox" ? { snoozedUntil: null } : {}), }; if (payload.action !== "delete" && Object.keys(values).length === 0) { diff --git a/src/components/messages/bulk-message-toolbar.tsx b/src/components/messages/bulk-message-toolbar.tsx index a6fea01..7d7fde2 100644 --- a/src/components/messages/bulk-message-toolbar.tsx +++ b/src/components/messages/bulk-message-toolbar.tsx @@ -38,7 +38,7 @@ export function BulkMessageToolbar({ // Trash and Spam also offer the irreversible delete; the page confirms before running it. const canDeleteForever = supportsPermanentDelete(folder); const moveOptions = [ - { value: "inbox", label: t("navigation.inbox"), Icon: Inbox, hidden: !folder || folder === "inbox" }, + { value: "inbox", label: t("navigation.inbox"), Icon: Inbox, hidden: folder === "inbox" }, { value: "archive", label: t("navigation.archived"), Icon: Archive, hidden: folder === "archived" }, { value: "spam", label: t("navigation.spam"), Icon: ShieldAlert, hidden: folder === "spam" }, { value: "trash", label: t("navigation.trash"), Icon: Trash2, hidden: folder === "trash" },