diff --git a/apps/mobile/src/features/home/ThreadUndoNotice.tsx b/apps/mobile/src/features/home/ThreadUndoNotice.tsx index 633946c18bee5..46e819d3bfd84 100644 --- a/apps/mobile/src/features/home/ThreadUndoNotice.tsx +++ b/apps/mobile/src/features/home/ThreadUndoNotice.tsx @@ -89,7 +89,9 @@ export function ThreadUndoNotice(props: { readonly visible: boolean }) { ? gt("Settled thread") : notice.action === "Snoozed" ? gt("Snoozed thread") - : gt("Unpinned thread") + : notice.action === "Rescheduled" + ? gt("Rescheduled thread") + : gt("Unpinned thread") } action={{ label: gt("Undo"), diff --git a/apps/mobile/src/features/home/thread-undo-notice.ts b/apps/mobile/src/features/home/thread-undo-notice.ts index 5fa1385297af1..ce5089bcd6263 100644 --- a/apps/mobile/src/features/home/thread-undo-notice.ts +++ b/apps/mobile/src/features/home/thread-undo-notice.ts @@ -2,7 +2,7 @@ import * as ThreadUndo from "@t3tools/client-runtime/state/thread-undo"; import { useSyncExternalStore } from "react"; type UndoNotice = { - readonly action: "Settled" | "Snoozed" | "Unpinned"; + readonly action: "Settled" | "Snoozed" | "Rescheduled" | "Unpinned"; readonly claim: ReturnType; readonly undo: () => Promise; }; diff --git a/apps/mobile/src/features/home/useThreadListActions.test.ts b/apps/mobile/src/features/home/useThreadListActions.test.ts index 135cf4e1d85a7..02ac1ad58dc10 100644 --- a/apps/mobile/src/features/home/useThreadListActions.test.ts +++ b/apps/mobile/src/features/home/useThreadListActions.test.ts @@ -517,6 +517,21 @@ describe("thread action undo", () => { }); }); + it("restores the previous wake time when undoing a reschedule", async () => { + const thread = makeThread({ + snoozedAt: "2026-09-02T00:00:00.000Z", + snoozedUntil: "2099-01-01T09:00:00.000Z", + }); + await useThreadListActions().snoozeThread(thread, "2099-01-02T09:00:00.000Z"); + expect(readThreadUndoNotice()?.action).toBe("Rescheduled"); + await readThreadUndoNotice()!.undo(); + expect(state.requests.map(({ action }) => action)).toEqual(["snooze", "snooze"]); + expect(state.requests[1]?.input).toEqual({ + threadId: thread.id, + snoozedUntil: "2099-01-01T09:00:00.000Z", + }); + }); + it.each([null, "2099-01-01T09:00:00.000Z", "2000-01-01T09:00:00.000Z"])( "restores an unpinned thread's previous position and unexpired snooze (%s)", async (snoozedUntil) => { diff --git a/apps/mobile/src/features/home/useThreadListActions.ts b/apps/mobile/src/features/home/useThreadListActions.ts index 8a70854e5b2c3..a01003d9ec23e 100644 --- a/apps/mobile/src/features/home/useThreadListActions.ts +++ b/apps/mobile/src/features/home/useThreadListActions.ts @@ -3,7 +3,7 @@ import type { ThreadMoveDestination } from "../threads/threadOrder"; import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell"; import * as ThreadUndo from "@t3tools/client-runtime/state/thread-undo"; import { showThreadUndoNotice } from "./thread-undo-notice"; -import { canSnooze } from "@t3tools/client-runtime/state/thread-settled"; +import { canSnooze, effectiveSnoozed } from "@t3tools/client-runtime/state/thread-settled"; import { AuthOrchestrationOperateScope } from "@t3tools/contracts"; import * as Cause from "effect/Cause"; import * as Haptics from "expo-haptics"; @@ -267,7 +267,7 @@ export function useThreadListActions(): { const archiveThread = (thread: EnvironmentThreadShell) => executeAction("archive", thread); const offerUndo = ( thread: EnvironmentThreadShell, - action: "Settled" | "Snoozed" | "Unpinned", + action: "Settled" | "Snoozed" | "Rescheduled" | "Unpinned", claim: ReturnType, plan: ThreadUndo.ThreadUndoPlan, ) => @@ -295,10 +295,12 @@ export function useThreadListActions(): { return true; } case "snooze": { - const failureTitle = - action === "Unpinned" - ? m(msg("Could not undo unpin")) - : m(msg("Could not undo settle")); + const failureTitle = { + Settled: m(msg("Could not undo settle")), + Snoozed: m(msg("Could not undo snooze")), + Rescheduled: m(msg("Could not undo reschedule")), + Unpinned: m(msg("Could not undo unpin")), + }[action]; if (!checkThreadOperationPermission(thread, failureTitle)) return false; const result = await snoozeMutation({ environmentId: thread.environmentId, @@ -380,30 +382,37 @@ export function useThreadListActions(): { selectionHaptic(); const claim = ThreadUndo.begin("snooze", key); - const result = await withThreadDismissal( - key, - () => - snoozeMutation({ - environmentId: thread.environmentId, - input: { - threadId: thread.id, - snoozedUntil, - }, - }), - (result) => result._tag === "Success", - ); + const snooze = () => + snoozeMutation({ + environmentId: thread.environmentId, + input: { + threadId: thread.id, + snoozedUntil, + }, + }); + // A reschedule keeps the row on the snoozed shelf, so it must not + // play the exit animation that a fresh snooze uses. + const rescheduling = effectiveSnoozed(thread, { now: new Date().toISOString() }); + const result = rescheduling + ? await snooze() + : await withThreadDismissal(key, snooze, (result) => result._tag === "Success"); if (result._tag === "Failure") { claim.finish(); const error = Cause.squash(result.cause); Dialog.alert( - m(msg("Could not snooze thread")), + rescheduling ? m(msg("Could not reschedule thread")) : m(msg("Could not snooze thread")), error instanceof Error && errorDisplayMessage(error, m) !== null ? (errorDisplayMessage(error, m) ?? error.message) : m(msg("The thread could not be snoozed.")), ); return false; } - offerUndo(thread, "Snoozed", claim, ThreadUndo.planThreadUndo("snooze")); + offerUndo( + thread, + rescheduling ? "Rescheduled" : "Snoozed", + claim, + ThreadUndo.planThreadUndo("snooze", rescheduling ? thread : null), + ); return true; })(); snoozeInFlightThreadKeys.current.delete(key); diff --git a/apps/mobile/src/features/threads/thread-list-v2-items.tsx b/apps/mobile/src/features/threads/thread-list-v2-items.tsx index 7a18e1429934e..16a1e055f9cd2 100644 --- a/apps/mobile/src/features/threads/thread-list-v2-items.tsx +++ b/apps/mobile/src/features/threads/thread-list-v2-items.tsx @@ -209,7 +209,7 @@ const SLIM_MENU_ACTIONS: MenuAction[] = [ ]; const SNOOZED_MENU_ACTIONS: MenuAction[] = [ - { id: "unsnooze", title: msg("Wake thread"), image: "clock" }, + { id: "unsnooze", title: msg("Wake thread"), image: "bell.badge" }, { id: "delete", title: msg("Delete", { $context: "verb, thread action" }), @@ -982,6 +982,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { const snoozePresets = resolveThreadListV2SnoozePresets( { secondary: swipeActions.secondary, + snoozed: snoozedRow, now: props.snoozePresetMinute || snoozeGateNow, presets: props.snoozePresets, }, @@ -1118,7 +1119,16 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { return layoutThreadListV2RowMenuActions( { nested, - direct: [...direct, localized(SNOOZED_MENU_ACTIONS[0]!)], + direct: [ + ...direct, + localized(SNOOZED_MENU_ACTIONS[0]!), + { + id: "snooze", + title: gt("Reschedule"), + image: "clock", + subactions: snoozePresetActions, + }, + ], reorder: [], pin: [], secondary: [ @@ -1307,7 +1317,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: { if (swipeActions.primary === "unsnooze") { return { accessibilityLabel: gt("Wake {title} now", { title: thread.title }), - icon: "clock" as const, + icon: "bell.badge" as const, label: gt("Wake", { $context: "verb, thread action" }), swipeHint: gt("Opens the thread. Swipe left to wake."), swipeSnoozeHint: gt("Opens the thread. Swipe left for wake and snooze actions."), diff --git a/apps/mobile/src/features/threads/threadListV2.test.ts b/apps/mobile/src/features/threads/threadListV2.test.ts index 16ef19a32993f..24c3fd7f721e2 100644 --- a/apps/mobile/src/features/threads/threadListV2.test.ts +++ b/apps/mobile/src/features/threads/threadListV2.test.ts @@ -92,6 +92,7 @@ describe("resolveThreadListV2SnoozePresets", () => { const presets = resolveThreadListV2SnoozePresets({ secondary: "snooze", + snoozed: false, now: laterMinute, presets: undefined, }); @@ -1467,6 +1468,8 @@ describe("threadListV2ListItemsAreEqual", () => { }; expect(rows(earlier).snoozeWakeLabelText).toBe("2h"); expect(rows(later).snoozeWakeLabelText).toBe("1h"); + // Snoozed rows show the snooze presets under Reschedule, so they keep the minute clock. + expect(rows(later).snoozePresetMinute).toBe(isoAt(BASE_MS + MINUTE_MS)); expect(threadListV2ListItemsAreEqual(rows(earlier), rows(later))).toBe(false); }); diff --git a/apps/mobile/src/features/threads/threadListV2.ts b/apps/mobile/src/features/threads/threadListV2.ts index b8029d3b0b189..0c17340e2e992 100644 --- a/apps/mobile/src/features/threads/threadListV2.ts +++ b/apps/mobile/src/features/threads/threadListV2.ts @@ -87,12 +87,13 @@ export type ThreadListV2SwipeAction = "archive" | "settle" | "unsettle" | "snooz export function resolveThreadListV2SnoozePresets( input: { readonly secondary: "snooze" | null; + readonly snoozed: boolean; readonly now: string; readonly presets: ReadonlyArray | undefined; }, resolve: MessageResolver = m, ): ReadonlyArray { - return input.secondary === "snooze" + return input.secondary === "snooze" || input.snoozed ? resolveSnoozePresets(new Date(input.now), presetOptions(input.presets), resolve) : []; } @@ -605,11 +606,11 @@ export function buildThreadListV2ListItems(input: { ? snoozeWakeLabel(item.thread.snoozedUntil, { now: input.snoozeLabelNow }, resolve) : undefined; // Put the clock on items so recycler equality limits ticks to rows displaying snooze preset times. + // Snoozed rows show the same presets under Reschedule. const snoozePresetMinute = - !item.snoozed && input.snoozeLabelNow !== undefined && (input.snoozeEnvironmentIds?.has(item.thread.environmentId) ?? true) && - canSnooze(item.thread, { now: input.snoozeLabelNow }) + (item.snoozed || canSnooze(item.thread, { now: input.snoozeLabelNow })) ? input.snoozeLabelNow : undefined; const move = diff --git a/apps/mobile/src/i18n/translations/de.json b/apps/mobile/src/i18n/translations/de.json index 8905e6a7dfa57..de89fd1d28cd3 100644 --- a/apps/mobile/src/i18n/translations/de.json +++ b/apps/mobile/src/i18n/translations/de.json @@ -2269,6 +2269,7 @@ "32a8bfef83ff2d97": "Thread-Filter zurücksetzen", "c395d6d5b8e3b1c3": "Erledigter Thread", "364216d868acbcb8": "Zurückgestellter Thread", + "9b5a1047f965ac6f": "Thread neu geplant", "96c28451c4aae602": "Losgelöster Thread", "33b29a0f59128a96": "Rückgängig", "0fb95f74fce8584e": "Öffnet die Umgebungseinstellungen", @@ -2313,8 +2314,10 @@ "3e36eba09bae8803": "Thread löschen?", "f648c00c1c86f594": "„{title}“ wird endgültig gelöscht, einschließlich seines Terminal-Verlaufs.", "7089864a172bd9e3": "Löschen", - "4ef62b5dbba907d2": "Loslösen konnte nicht rückgängig gemacht werden", "f8b89d159e44c512": "Erledigen konnte nicht rückgängig gemacht werden", + "1ec80b5eb4cdbae5": "Zurückstellen konnte nicht rückgängig gemacht werden", + "3defb1664921b0a5": "Neuplanung konnte nicht rückgängig gemacht werden", + "4ef62b5dbba907d2": "Loslösen konnte nicht rückgängig gemacht werden", "807dd1b1a6ebd721": "Zurückstellen konnte nicht wiederhergestellt werden", "fe3a91464aed32c8": "Der Thread konnte nicht zurückgestellt werden.", "142a179fc1d6bf3b": "Thread-Aktion konnte nicht rückgängig gemacht werden", @@ -2322,6 +2325,7 @@ "876b987471f908d4": "Der Server dieser Umgebung unterstützt das Zurückstellen noch nicht. Aktualisiere den Server, um „Zurückstellen“ zu nutzen.", "d308bfc93992408b": "Dieser Thread wartet auf dich. Beantworte die ausstehende Anfrage, bevor du ihn zurückstellst.", "af6f4b448ec34fbd": "Dieser Thread startet noch eine Runde. Versuch es erneut, sobald er läuft.", + "5ad183fe6af8884e": "Thread konnte nicht neu geplant werden", "e9682864e49df67a": "Thread konnte nicht aufgeweckt werden", "ac30839c3687c496": "Der Server dieser Umgebung unterstützt das Zurückstellen noch nicht. Aktualisiere den Server, um diesen Thread aufzuwecken.", "f1bcc9682d9f46e7": "Der Thread konnte nicht aufgeweckt werden.", @@ -4781,6 +4785,7 @@ "1385e2d8bd696370": "In Projekt umwandeln", "a1fcc064a5cece14": "Thread kopieren", "7b24be8e29a2efc5": "Thread-ID kopieren", + "0f6758106a241c35": "Neu planen", "4205928193aec525": "Zurückstellen", "618aa0a6bf093a70": "Versuch erneut, diesen Thread zu kopieren.", "b2332fb96c0a55fb": "Dieser Zeitpunkt ist bereits vorbei. Wähle einen anderen.", diff --git a/apps/mobile/src/i18n/translations/en.json b/apps/mobile/src/i18n/translations/en.json index 326854441f2cf..c5c427b5e24fc 100644 --- a/apps/mobile/src/i18n/translations/en.json +++ b/apps/mobile/src/i18n/translations/en.json @@ -2269,6 +2269,7 @@ "32a8bfef83ff2d97": "Reset thread filters", "c395d6d5b8e3b1c3": "Settled thread", "364216d868acbcb8": "Snoozed thread", + "9b5a1047f965ac6f": "Rescheduled thread", "96c28451c4aae602": "Unpinned thread", "33b29a0f59128a96": "Undo", "0fb95f74fce8584e": "Opens environment settings", @@ -2313,8 +2314,10 @@ "3e36eba09bae8803": "Delete thread?", "f648c00c1c86f594": "“{title}” will be permanently deleted, including its terminal history.", "7089864a172bd9e3": "Delete", - "4ef62b5dbba907d2": "Could not undo unpin", "f8b89d159e44c512": "Could not undo settle", + "1ec80b5eb4cdbae5": "Could not undo snooze", + "3defb1664921b0a5": "Could not undo reschedule", + "4ef62b5dbba907d2": "Could not undo unpin", "807dd1b1a6ebd721": "Could not restore snooze", "fe3a91464aed32c8": "The thread could not be snoozed.", "142a179fc1d6bf3b": "Could not undo thread action", @@ -2322,6 +2325,7 @@ "876b987471f908d4": "This environment's server does not support snoozing yet. Update the server to use Snooze.", "d308bfc93992408b": "This thread is waiting on you. Respond to the pending request before snoozing it.", "af6f4b448ec34fbd": "This thread is still starting a turn. Try again once it's running.", + "5ad183fe6af8884e": "Could not reschedule thread", "e9682864e49df67a": "Could not wake thread", "ac30839c3687c496": "This environment's server does not support snoozing yet. Update the server to wake this thread.", "f1bcc9682d9f46e7": "The thread could not be woken.", @@ -4782,6 +4786,7 @@ "1385e2d8bd696370": "Turn into project", "a1fcc064a5cece14": "Copy thread", "7b24be8e29a2efc5": "Copy thread ID", + "0f6758106a241c35": "Reschedule", "4205928193aec525": "Snooze", "618aa0a6bf093a70": "Try copying this thread again.", "b2332fb96c0a55fb": "That snooze time has passed. Choose another time.", diff --git a/apps/mobile/src/i18n/translations/es.json b/apps/mobile/src/i18n/translations/es.json index b06c7cde064e3..2079f01852408 100644 --- a/apps/mobile/src/i18n/translations/es.json +++ b/apps/mobile/src/i18n/translations/es.json @@ -2269,6 +2269,7 @@ "32a8bfef83ff2d97": "Restablecer filtros de hilos", "c395d6d5b8e3b1c3": "Hilo resuelto", "364216d868acbcb8": "Hilo pospuesto", + "9b5a1047f965ac6f": "Hilo reprogramado", "96c28451c4aae602": "Hilo desfijado", "33b29a0f59128a96": "Deshacer", "0fb95f74fce8584e": "Abre los ajustes del entorno", @@ -2313,8 +2314,10 @@ "3e36eba09bae8803": "¿Eliminar el hilo?", "f648c00c1c86f594": "«{title}» se eliminará de forma permanente, incluido su historial de terminal.", "7089864a172bd9e3": "Eliminar", - "4ef62b5dbba907d2": "No se pudo deshacer el desfijado", "f8b89d159e44c512": "No se pudo deshacer la resolución", + "1ec80b5eb4cdbae5": "No se pudo deshacer la posposición", + "3defb1664921b0a5": "No se pudo deshacer la reprogramación", + "4ef62b5dbba907d2": "No se pudo deshacer el desfijado", "807dd1b1a6ebd721": "No se pudo restaurar el pospuesto", "fe3a91464aed32c8": "No se pudo posponer el hilo.", "142a179fc1d6bf3b": "No se pudo deshacer la acción del hilo", @@ -2322,6 +2325,7 @@ "876b987471f908d4": "El servidor de este entorno aún no permite posponer hilos. Actualiza el servidor para usar Posponer.", "d308bfc93992408b": "Este hilo está esperando tu respuesta. Responde a la solicitud pendiente antes de posponerlo.", "af6f4b448ec34fbd": "Este hilo aún está iniciando un turno. Vuelve a intentarlo cuando esté en ejecución.", + "5ad183fe6af8884e": "No se pudo reprogramar el hilo", "e9682864e49df67a": "No se pudo reactivar el hilo", "ac30839c3687c496": "El servidor de este entorno aún no admite posponer. Actualiza el servidor para reactivar este hilo.", "f1bcc9682d9f46e7": "No se pudo reactivar el hilo.", @@ -4774,6 +4778,7 @@ "1385e2d8bd696370": "Convertir en proyecto", "a1fcc064a5cece14": "Copiar hilo", "7b24be8e29a2efc5": "Copiar ID del hilo", + "0f6758106a241c35": "Reprogramar", "4205928193aec525": "Posponer", "618aa0a6bf093a70": "Prueba a copiar este hilo de nuevo.", "b2332fb96c0a55fb": "Esa hora para posponer ya pasó. Elige otra.", diff --git a/apps/mobile/src/i18n/translations/fr.json b/apps/mobile/src/i18n/translations/fr.json index a55be9448f37a..f8efb62d6aa81 100644 --- a/apps/mobile/src/i18n/translations/fr.json +++ b/apps/mobile/src/i18n/translations/fr.json @@ -2269,6 +2269,7 @@ "32a8bfef83ff2d97": "Réinitialiser les filtres de fils", "c395d6d5b8e3b1c3": "Fil clos", "364216d868acbcb8": "Fil reporté", + "9b5a1047f965ac6f": "Fil replanifié", "96c28451c4aae602": "Fil désépinglé", "33b29a0f59128a96": "Annuler", "0fb95f74fce8584e": "Ouvre les paramètres de l’environnement", @@ -2313,8 +2314,10 @@ "3e36eba09bae8803": "Supprimer le fil ?", "f648c00c1c86f594": "« {title} » sera définitivement supprimé, y compris l’historique de son terminal.", "7089864a172bd9e3": "Supprimer", - "4ef62b5dbba907d2": "Impossible d’annuler le désépinglage", "f8b89d159e44c512": "Impossible d’annuler la clôture", + "1ec80b5eb4cdbae5": "Impossible d’annuler la mise en veille", + "3defb1664921b0a5": "Impossible d’annuler la replanification", + "4ef62b5dbba907d2": "Impossible d’annuler le désépinglage", "807dd1b1a6ebd721": "Impossible de rétablir le report", "fe3a91464aed32c8": "Le fil n’a pas pu être reporté.", "142a179fc1d6bf3b": "Impossible d’annuler l’action sur le fil", @@ -2322,6 +2325,7 @@ "876b987471f908d4": "Le serveur de cet environnement ne permet pas encore de reporter les fils. Mettez à jour le serveur pour utiliser Reporter.", "d308bfc93992408b": "Ce fil attend votre réponse. Répondez à la demande en attente avant de le reporter.", "af6f4b448ec34fbd": "Ce fil est encore en train de démarrer un tour. Réessayez une fois qu’il est en cours.", + "5ad183fe6af8884e": "Impossible de replanifier le fil", "e9682864e49df67a": "Impossible de réveiller le fil", "ac30839c3687c496": "Le serveur de cet environnement ne prend pas encore en charge le report. Mettez à jour le serveur pour réveiller ce fil.", "f1bcc9682d9f46e7": "Le fil n’a pas pu être réveillé.", @@ -4775,6 +4779,7 @@ "1385e2d8bd696370": "Transformer en projet", "a1fcc064a5cece14": "Copier le fil", "7b24be8e29a2efc5": "Copier l’ID du fil", + "0f6758106a241c35": "Replanifier", "4205928193aec525": "Reporter", "618aa0a6bf093a70": "Essayez de copier à nouveau ce fil.", "b2332fb96c0a55fb": "Cette heure de report est passée. Choisissez-en une autre.", diff --git a/apps/mobile/src/i18n/translations/ja.json b/apps/mobile/src/i18n/translations/ja.json index a2baf76668ee6..ad1112d32892c 100644 --- a/apps/mobile/src/i18n/translations/ja.json +++ b/apps/mobile/src/i18n/translations/ja.json @@ -2268,6 +2268,7 @@ "32a8bfef83ff2d97": "スレッドのフィルターをリセット", "c395d6d5b8e3b1c3": "スレッドを対応済みにしました", "364216d868acbcb8": "スレッドをスヌーズしました", + "9b5a1047f965ac6f": "スレッドの再開時刻を再設定しました", "96c28451c4aae602": "スレッドのピン留めを解除しました", "33b29a0f59128a96": "元に戻す", "0fb95f74fce8584e": "環境の設定を開きます", @@ -2312,8 +2313,10 @@ "3e36eba09bae8803": "スレッドを削除しますか?", "f648c00c1c86f594": "「{title}」はターミナルの履歴を含めて完全に削除されます。", "7089864a172bd9e3": "削除", - "4ef62b5dbba907d2": "ピン留めの解除を元に戻せませんでした", "f8b89d159e44c512": "対応済みを元に戻せませんでした", + "1ec80b5eb4cdbae5": "スヌーズを取り消せませんでした", + "3defb1664921b0a5": "再設定を取り消せませんでした", + "4ef62b5dbba907d2": "ピン留めの解除を元に戻せませんでした", "807dd1b1a6ebd721": "スヌーズを元に戻せませんでした", "fe3a91464aed32c8": "スレッドをスヌーズできませんでした。", "142a179fc1d6bf3b": "スレッドの操作を元に戻せませんでした", @@ -2321,6 +2324,7 @@ "876b987471f908d4": "この環境のサーバーはまだスヌーズをサポートしていません。スヌーズを使うにはサーバーを更新してください。", "d308bfc93992408b": "このスレッドはあなたの対応を待っています。スヌーズする前に保留中のリクエストに応答してください。", "af6f4b448ec34fbd": "このスレッドはまだターンを開始中です。実行が始まってからもう一度お試しください。", + "5ad183fe6af8884e": "スレッドの再開時刻を再設定できませんでした", "e9682864e49df67a": "スレッドを再開できませんでした", "ac30839c3687c496": "この環境のサーバーはまだスヌーズに対応していません。このスレッドを再開するにはサーバーを更新してください。", "f1bcc9682d9f46e7": "スレッドを再開できませんでした。", @@ -4756,6 +4760,7 @@ "1385e2d8bd696370": "プロジェクトに変換", "a1fcc064a5cece14": "スレッドをコピー", "7b24be8e29a2efc5": "スレッド ID をコピー", + "0f6758106a241c35": "再設定", "4205928193aec525": "スヌーズ", "618aa0a6bf093a70": "このスレッドをもう一度コピーしてください。", "b2332fb96c0a55fb": "そのスヌーズ時刻は過ぎています。別の時刻を選択してください。", diff --git a/apps/mobile/src/i18n/translations/ko.json b/apps/mobile/src/i18n/translations/ko.json index 73b5fba192e03..5155b91dacd18 100644 --- a/apps/mobile/src/i18n/translations/ko.json +++ b/apps/mobile/src/i18n/translations/ko.json @@ -2270,6 +2270,7 @@ "32a8bfef83ff2d97": "스레드 필터 재설정", "c395d6d5b8e3b1c3": "스레드가 정리됨", "364216d868acbcb8": "스레드에 다시 알림 설정됨", + "9b5a1047f965ac6f": "스레드 다시 열기 시간을 변경했습니다", "96c28451c4aae602": "스레드 고정 해제됨", "33b29a0f59128a96": "실행 취소", "0fb95f74fce8584e": "환경 설정을 엽니다", @@ -2314,8 +2315,10 @@ "3e36eba09bae8803": "스레드를 삭제할까요?", "f648c00c1c86f594": "“{title}”이(가) 터미널 기록을 포함해 영구적으로 삭제됩니다.", "7089864a172bd9e3": "삭제", - "4ef62b5dbba907d2": "고정 해제를 실행 취소할 수 없습니다", "f8b89d159e44c512": "정리를 실행 취소할 수 없습니다", + "1ec80b5eb4cdbae5": "스누즈를 취소하지 못했습니다", + "3defb1664921b0a5": "시간 변경을 취소하지 못했습니다", + "4ef62b5dbba907d2": "고정 해제를 실행 취소할 수 없습니다", "807dd1b1a6ebd721": "다시 알림을 복원할 수 없습니다", "fe3a91464aed32c8": "스레드를 미룰 수 없습니다.", "142a179fc1d6bf3b": "스레드 작업을 실행 취소할 수 없습니다", @@ -2323,6 +2326,7 @@ "876b987471f908d4": "이 환경의 서버는 아직 다시 알림을 지원하지 않습니다. 다시 알림을 사용하려면 서버를 업데이트하세요.", "d308bfc93992408b": "이 스레드는 응답을 기다리고 있습니다. 다시 알림을 설정하기 전에 대기 중인 요청에 응답하세요.", "af6f4b448ec34fbd": "이 스레드는 아직 턴을 시작하는 중입니다. 실행되면 다시 시도하세요.", + "5ad183fe6af8884e": "스레드 다시 열기 시간을 변경하지 못했습니다", "e9682864e49df67a": "스레드를 깨울 수 없습니다", "ac30839c3687c496": "이 환경의 서버는 아직 다시 알림을 지원하지 않습니다. 이 스레드를 깨우려면 서버를 업데이트하세요.", "f1bcc9682d9f46e7": "스레드를 깨울 수 없습니다.", @@ -4761,6 +4765,7 @@ "1385e2d8bd696370": "프로젝트로 전환", "a1fcc064a5cece14": "스레드 복사", "7b24be8e29a2efc5": "스레드 ID 복사", + "0f6758106a241c35": "시간 변경", "4205928193aec525": "다시 알림", "618aa0a6bf093a70": "이 스레드를 다시 복사해 보세요.", "b2332fb96c0a55fb": "해당 다시 알림 시간이 지났습니다. 다른 시간을 선택하세요.", diff --git a/apps/mobile/src/i18n/translations/pt-BR.json b/apps/mobile/src/i18n/translations/pt-BR.json index 57f75b3a0737d..4fead940e14bf 100644 --- a/apps/mobile/src/i18n/translations/pt-BR.json +++ b/apps/mobile/src/i18n/translations/pt-BR.json @@ -2269,6 +2269,7 @@ "32a8bfef83ff2d97": "Redefinir filtros de threads", "c395d6d5b8e3b1c3": "Thread concluída", "364216d868acbcb8": "Thread adiada", + "9b5a1047f965ac6f": "Conversa reagendada", "96c28451c4aae602": "Thread desafixada", "33b29a0f59128a96": "Desfazer", "0fb95f74fce8584e": "Abre as configurações do ambiente", @@ -2313,8 +2314,10 @@ "3e36eba09bae8803": "Excluir thread?", "f648c00c1c86f594": "“{title}” será excluída permanentemente, incluindo o histórico do terminal.", "7089864a172bd9e3": "Excluir", - "4ef62b5dbba907d2": "Não foi possível desfazer o desafixar", "f8b89d159e44c512": "Não foi possível desfazer a conclusão", + "1ec80b5eb4cdbae5": "Não foi possível desfazer o adiamento", + "3defb1664921b0a5": "Não foi possível desfazer o reagendamento", + "4ef62b5dbba907d2": "Não foi possível desfazer o desafixar", "807dd1b1a6ebd721": "Não foi possível restaurar o adiamento", "fe3a91464aed32c8": "Não foi possível adiar a thread.", "142a179fc1d6bf3b": "Não foi possível desfazer a ação na thread", @@ -2322,6 +2325,7 @@ "876b987471f908d4": "O servidor deste ambiente ainda não permite adiar threads. Atualize o servidor para usar Adiar.", "d308bfc93992408b": "Esta thread está aguardando você. Responda à solicitação pendente antes de adiá-la.", "af6f4b448ec34fbd": "Esta thread ainda está iniciando um turno. Tente novamente quando ela estiver em execução.", + "5ad183fe6af8884e": "Não foi possível reagendar a conversa", "e9682864e49df67a": "Não foi possível despertar a thread", "ac30839c3687c496": "O servidor deste ambiente ainda não suporta adiar. Atualize o servidor para despertar esta thread.", "f1bcc9682d9f46e7": "Não foi possível despertar a thread.", @@ -4775,6 +4779,7 @@ "1385e2d8bd696370": "Transformar em projeto", "a1fcc064a5cece14": "Copiar thread", "7b24be8e29a2efc5": "Copiar ID da thread", + "0f6758106a241c35": "Reagendar", "4205928193aec525": "Adiar", "618aa0a6bf093a70": "Tente copiar esta thread novamente.", "b2332fb96c0a55fb": "Esse horário já passou. Escolha outro horário.", diff --git a/apps/mobile/src/i18n/translations/ru.json b/apps/mobile/src/i18n/translations/ru.json index 0b519fd61c51e..f548fae240bbf 100644 --- a/apps/mobile/src/i18n/translations/ru.json +++ b/apps/mobile/src/i18n/translations/ru.json @@ -2317,6 +2317,7 @@ "32a8bfef83ff2d97": "Сбросить фильтры тредов", "c395d6d5b8e3b1c3": "Тред разобран", "364216d868acbcb8": "Тред отложен", + "9b5a1047f965ac6f": "Время возврата ветки изменено", "96c28451c4aae602": "Тред откреплён", "33b29a0f59128a96": "Отменить", "0fb95f74fce8584e": "Открывает настройки окружения", @@ -2361,8 +2362,10 @@ "3e36eba09bae8803": "Удалить тред?", "f648c00c1c86f594": "«{title}» будет удалён без возможности восстановления, включая историю терминала.", "7089864a172bd9e3": "Удалить", - "4ef62b5dbba907d2": "Не удалось отменить открепление", "f8b89d159e44c512": "Не удалось отменить разбор", + "1ec80b5eb4cdbae5": "Не удалось отменить откладывание", + "3defb1664921b0a5": "Не удалось отменить перенос", + "4ef62b5dbba907d2": "Не удалось отменить открепление", "807dd1b1a6ebd721": "Не удалось восстановить откладывание", "fe3a91464aed32c8": "Не удалось отложить тред.", "142a179fc1d6bf3b": "Не удалось отменить действие с тредом", @@ -2370,6 +2373,7 @@ "876b987471f908d4": "Сервер этого окружения пока не поддерживает откладывание. Обновите сервер, чтобы использовать «Отложить».", "d308bfc93992408b": "Этот тред ждёт вас. Ответьте на ожидающий запрос, прежде чем откладывать его.", "af6f4b448ec34fbd": "Этот тред ещё начинает ход. Попробуйте снова, когда он запустится.", + "5ad183fe6af8884e": "Не удалось перенести время возврата ветки", "e9682864e49df67a": "Не удалось разбудить тред", "ac30839c3687c496": "Сервер этого окружения пока не поддерживает откладывание. Обновите сервер, чтобы разбудить этот тред.", "f1bcc9682d9f46e7": "Не удалось разбудить тред.", @@ -4853,6 +4857,7 @@ "1385e2d8bd696370": "Превратить в проект", "a1fcc064a5cece14": "Копировать тред", "7b24be8e29a2efc5": "Копировать ID треда", + "0f6758106a241c35": "Перенести", "4205928193aec525": "Отложить", "618aa0a6bf093a70": "Попробуйте скопировать этот тред ещё раз.", "b2332fb96c0a55fb": "Это время уже прошло. Выберите другое.", diff --git a/apps/mobile/src/i18n/translations/sv.json b/apps/mobile/src/i18n/translations/sv.json index 73a0edbbad7e2..f9a2272e18c30 100644 --- a/apps/mobile/src/i18n/translations/sv.json +++ b/apps/mobile/src/i18n/translations/sv.json @@ -2269,6 +2269,7 @@ "32a8bfef83ff2d97": "Återställ trådfilter", "c395d6d5b8e3b1c3": "Klar tråd", "364216d868acbcb8": "Snoozad tråd", + "9b5a1047f965ac6f": "Trådens tid har ändrats", "96c28451c4aae602": "Lossad tråd", "33b29a0f59128a96": "Ångra", "0fb95f74fce8584e": "Öppnar miljöinställningar", @@ -2313,8 +2314,10 @@ "3e36eba09bae8803": "Ta bort tråden?", "f648c00c1c86f594": "”{title}” tas bort permanent, inklusive dess terminalhistorik.", "7089864a172bd9e3": "Ta bort", - "4ef62b5dbba907d2": "Kunde inte ångra lossningen", "f8b89d159e44c512": "Kunde inte ångra markeringen som klar", + "1ec80b5eb4cdbae5": "Det gick inte att ångra senareläggningen", + "3defb1664921b0a5": "Det gick inte att ångra tidsändringen", + "4ef62b5dbba907d2": "Kunde inte ångra lossningen", "807dd1b1a6ebd721": "Kunde inte återställa snoozen", "fe3a91464aed32c8": "Tråden kunde inte snoozas.", "142a179fc1d6bf3b": "Kunde inte ångra trådåtgärden", @@ -2322,6 +2325,7 @@ "876b987471f908d4": "Den här miljöns server stöder inte snooze än. Uppdatera servern för att använda Snooza.", "d308bfc93992408b": "Den här tråden väntar på dig. Svara på den väntande begäran innan du snoozar den.", "af6f4b448ec34fbd": "Tråden håller fortfarande på att starta en omgång. Försök igen när den körs.", + "5ad183fe6af8884e": "Det gick inte att ändra tiden för tråden", "e9682864e49df67a": "Kunde inte väcka tråden", "ac30839c3687c496": "Miljöns server stöder inte snooze än. Uppdatera servern för att väcka tråden.", "f1bcc9682d9f46e7": "Tråden kunde inte väckas.", @@ -4781,6 +4785,7 @@ "1385e2d8bd696370": "Gör om till projekt", "a1fcc064a5cece14": "Kopiera tråd", "7b24be8e29a2efc5": "Kopiera tråd-id", + "0f6758106a241c35": "Ändra tid", "4205928193aec525": "Snooza", "618aa0a6bf093a70": "Försök kopiera tråden igen.", "b2332fb96c0a55fb": "Den snooze-tiden har passerat. Välj en annan tid.", diff --git a/apps/mobile/src/i18n/translations/zh.json b/apps/mobile/src/i18n/translations/zh.json index 763019979640b..f91508273ec6f 100644 --- a/apps/mobile/src/i18n/translations/zh.json +++ b/apps/mobile/src/i18n/translations/zh.json @@ -2272,6 +2272,7 @@ "32a8bfef83ff2d97": "重置会话筛选", "c395d6d5b8e3b1c3": "已收尾的会话", "364216d868acbcb8": "已暂缓的会话", + "9b5a1047f965ac6f": "已重新安排会话", "96c28451c4aae602": "已取消置顶的会话", "33b29a0f59128a96": "撤销", "0fb95f74fce8584e": "打开环境设置", @@ -2316,8 +2317,10 @@ "3e36eba09bae8803": "删除会话?", "f648c00c1c86f594": "“{title}”将被永久删除,包括其终端历史记录。", "7089864a172bd9e3": "删除", - "4ef62b5dbba907d2": "无法撤销取消置顶", "f8b89d159e44c512": "无法撤销收尾", + "1ec80b5eb4cdbae5": "无法撤销暂缓", + "3defb1664921b0a5": "无法撤销重新安排", + "4ef62b5dbba907d2": "无法撤销取消置顶", "807dd1b1a6ebd721": "无法恢复暂缓", "fe3a91464aed32c8": "无法暂缓该会话。", "142a179fc1d6bf3b": "无法撤销会话操作", @@ -2325,6 +2328,7 @@ "876b987471f908d4": "此环境的服务器尚不支持暂缓。请更新服务器后再使用“暂缓”。", "d308bfc93992408b": "此会话正在等你处理。请先回复待处理的请求,再暂缓它。", "af6f4b448ec34fbd": "此会话仍在开始轮次。请在它运行后重试。", + "5ad183fe6af8884e": "无法重新安排会话", "e9682864e49df67a": "无法唤醒会话", "ac30839c3687c496": "此环境的服务器尚不支持暂缓。请更新服务器以唤醒此会话。", "f1bcc9682d9f46e7": "无法唤醒该会话。", @@ -4764,6 +4768,7 @@ "1385e2d8bd696370": "转换为项目", "a1fcc064a5cece14": "复制会话", "7b24be8e29a2efc5": "复制会话 ID", + "0f6758106a241c35": "重新安排", "4205928193aec525": "暂缓", "618aa0a6bf093a70": "请尝试重新复制此会话。", "b2332fb96c0a55fb": "该暂缓时间已过,请选择其他时间。", diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 86a2d04c53eef..e1ed7c3df7dd5 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -2255,7 +2255,10 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve return { status: "skipped" } as const; } snoozingThreadKeysRef.current.add(threadKey); - const navigateAfterSnooze = planForwardNavigation(threadKey, opts.coSnoozingKeys); + // Rescheduling an already-snoozed thread parks nothing new, so you stay put. + const navigateAfterSnooze = snoozedThreadKeysRef.current.has(threadKey) + ? null + : planForwardNavigation(threadKey, opts.coSnoozingKeys); const result = await snoozeThread(threadRef, preset.snoozedUntil); snoozingThreadKeysRef.current.delete(threadKey); if (result._tag === "Failure") { diff --git a/apps/web/src/components/sidebar/SidebarThreadUndoNotice.tsx b/apps/web/src/components/sidebar/SidebarThreadUndoNotice.tsx index 0629825bd8094..7b968589fb4e1 100644 --- a/apps/web/src/components/sidebar/SidebarThreadUndoNotice.tsx +++ b/apps/web/src/components/sidebar/SidebarThreadUndoNotice.tsx @@ -16,6 +16,7 @@ import { SidebarMenuItem } from "../ui/sidebar"; const SHORT_SUMMARY = { Settled: msg("{count, plural, =1 {Settled,} other {Settled {count},}}"), Snoozed: msg("{count, plural, =1 {Snoozed,} other {Snoozed {count},}}"), + Rescheduled: msg("{count, plural, =1 {Rescheduled,} other {Rescheduled {count},}}"), Unpinned: msg("{count, plural, =1 {Unpinned,} other {Unpinned {count},}}"), Archived: msg("{count, plural, =1 {Archived,} other {Archived {count},}}"), Discarded: msg("{count, plural, =1 {Discarded,} other {Discarded {count},}}"), diff --git a/apps/web/src/components/threadActionMenu.logic.test.ts b/apps/web/src/components/threadActionMenu.logic.test.ts index 0c13e765131cc..af1cee20aa630 100644 --- a/apps/web/src/components/threadActionMenu.logic.test.ts +++ b/apps/web/src/components/threadActionMenu.logic.test.ts @@ -41,6 +41,7 @@ describe("buildThreadActionMenuItems", () => { "unpin", "unsettle", "unsnooze", + "snooze", "rename", "regenerate-title", "auto-settle", @@ -65,6 +66,18 @@ describe("buildThreadActionMenuItems", () => { }, ); + it("offers reschedule beside wake on a snoozed thread, with the same presets", () => { + const items = buildThreadActionMenuItems({ ...baseState, isSnoozed: true }); + const wakeIndex = items.findIndex((item) => item.id === "unsnooze"); + expect(items[wakeIndex]).toMatchObject({ label: "Wake thread" }); + expect(items[wakeIndex + 1]).toMatchObject({ id: "snooze", label: "Reschedule" }); + expect(items[wakeIndex + 1]?.children?.map((child) => child.id)).toEqual([ + "snooze:hour", + "snooze:custom", + ]); + expect(buildThreadActionMenuItems(baseState).map((item) => item.id)).not.toContain("unsnooze"); + }); + it("disables archive and turning into a project while the thread is running", () => { const items = buildThreadActionMenuItems({ ...baseState, diff --git a/apps/web/src/components/threadActionMenu.logic.ts b/apps/web/src/components/threadActionMenu.logic.ts index dc2d7687a2be6..128d96801e3a5 100644 --- a/apps/web/src/components/threadActionMenu.logic.ts +++ b/apps/web/src/components/threadActionMenu.logic.ts @@ -176,28 +176,33 @@ export function buildThreadActionMenuItems( : { id: "settle" as const, label: resolve(msg("Settle thread")), icon: "circle-check" }, ] : []), + // A snoozed thread keeps the preset submenu as "Reschedule" so the wake + // time can move without waking the thread first. ...(state.supports.snooze ? [ - state.isSnoozed - ? { id: "unsnooze" as const, label: resolve(msg("Wake thread")), icon: "clock" } - : { - id: "snooze" as const, - label: resolve(msg("Snooze", { $context: "verb, snooze the thread" })), - icon: "clock", - disabled: !state.canSnoozeNow, - children: [ - ...state.snoozePresets.map((preset) => ({ - id: `snooze:${preset.id}` as const, - label: preset.label, - detail: preset.whenLabel, - })), - { - id: "snooze:custom" as const, - label: resolve(msg("Custom…")), - separatorBefore: state.snoozePresets.length > 0, - }, - ], + ...(state.isSnoozed + ? [{ id: "unsnooze" as const, label: resolve(msg("Wake thread")), icon: "bell-ring" }] + : []), + { + id: "snooze" as const, + label: state.isSnoozed + ? resolve(msg("Reschedule")) + : resolve(msg("Snooze", { $context: "verb, snooze the thread" })), + icon: "clock", + disabled: !state.canSnoozeNow, + children: [ + ...state.snoozePresets.map((preset) => ({ + id: `snooze:${preset.id}` as const, + label: preset.label, + detail: preset.whenLabel, + })), + { + id: "snooze:custom" as const, + label: resolve(msg("Custom…")), + separatorBefore: state.snoozePresets.length > 0, }, + ], + }, ] : []), { diff --git a/apps/web/src/contextMenuFallback.ts b/apps/web/src/contextMenuFallback.ts index f4abe911aa72a..2cef2c0585b5d 100644 --- a/apps/web/src/contextMenuFallback.ts +++ b/apps/web/src/contextMenuFallback.ts @@ -17,6 +17,17 @@ const ICON_PATHS: Record Promise>; failureTitle: string; claim: ReturnType; @@ -34,6 +34,7 @@ export const useThreadUndoNotice = create<{ notice: UndoNotice | null }>(() => ( const SUMMARY = { Settled: msg("Settled {count, plural, one {{count} thread} other {{count} threads}}"), Snoozed: msg("Snoozed {count, plural, one {{count} thread} other {{count} threads}}"), + Rescheduled: msg("Rescheduled {count, plural, one {{count} thread} other {{count} threads}}"), Unpinned: msg("Unpinned {count, plural, one {{count} thread} other {{count} threads}}"), Archived: msg("Archived {count, plural, one {{count} thread} other {{count} threads}}"), Discarded: msg("Discarded {count, plural, one {{count} draft} other {{count} drafts}}"), @@ -42,6 +43,9 @@ const SUMMARY = { const UNDONE = { Settled: msg("Undid settle of {count, plural, one {{count} thread} other {{count} threads}}"), Snoozed: msg("Undid snooze of {count, plural, one {{count} thread} other {{count} threads}}"), + Rescheduled: msg( + "Undid reschedule of {count, plural, one {{count} thread} other {{count} threads}}", + ), Unpinned: msg("Undid unpin of {count, plural, one {{count} thread} other {{count} threads}}"), Archived: msg("Undid archive of {count, plural, one {{count} thread} other {{count} threads}}"), Discarded: msg("Undid discard of {count, plural, one {{count} draft} other {{count} drafts}}"), diff --git a/apps/web/src/hooks/useThreadActions.ts b/apps/web/src/hooks/useThreadActions.ts index 2a591127044d1..0113a31abde44 100644 --- a/apps/web/src/hooks/useThreadActions.ts +++ b/apps/web/src/hooks/useThreadActions.ts @@ -6,7 +6,11 @@ import { scopedThreadKey, } from "@t3tools/client-runtime/environment"; import { settlePromise, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime"; -import { canSnooze, threadWokeAt } from "@t3tools/client-runtime/state/thread-settled"; +import { + canSnooze, + effectiveSnoozed, + threadWokeAt, +} from "@t3tools/client-runtime/state/thread-settled"; import { threadRuntimeCanArchive } from "@t3tools/client-runtime/state/models"; import { AuthOrchestrationOperateScope, @@ -964,7 +968,8 @@ export function useThreadActions() { } const resolved = resolveThreadTarget(target); // oxlint-disable-next-line react/purity -- runs in an event handler (oxc#27309) - if (resolved && !canSnooze(resolved.thread, { now: new Date().toISOString() })) { + const now = new Date(); + if (resolved && !canSnooze(resolved.thread, { now: now.toISOString() })) { return AsyncResult.failure( Cause.fail( new ThreadSnoozeBlockedError({ @@ -974,6 +979,10 @@ export function useThreadActions() { ), ); } + const previousWake = + resolved && effectiveSnoozed(resolved.thread, { now: now.toISOString() }) + ? resolved.thread.snoozedUntil + : null; const action = ThreadUndo.begin("snooze", scopedThreadKey(target)); const result = await snoozeThreadMutation({ environmentId: target.environmentId, @@ -983,11 +992,14 @@ export function useThreadActions() { action.finish(); return result; } + const undoPlan = ThreadUndo.planThreadUndo("snooze", { snoozedUntil: previousWake }); showThreadUndoNotice({ - action: "Snoozed", + action: previousWake ? "Rescheduled" : "Snoozed", claim: action, - undo: () => runUndoPlan(target, ThreadUndo.planThreadUndo("snooze")), - failureTitle: m(msg("Failed to wake thread")), + undo: () => runUndoPlan(target, undoPlan), + failureTitle: previousWake + ? m(msg("Failed to restore the previous wake time")) + : m(msg("Failed to wake thread")), }); return result; }; diff --git a/apps/web/src/hooks/useThreadActions.undo.test.ts b/apps/web/src/hooks/useThreadActions.undo.test.ts index aa6bb76437c2c..36a5edc258a7e 100644 --- a/apps/web/src/hooks/useThreadActions.undo.test.ts +++ b/apps/web/src/hooks/useThreadActions.undo.test.ts @@ -109,6 +109,9 @@ const target = { environmentId: EnvironmentId.make("undo-env"), threadId: ThreadId.make("thread"), }; +const RESCHEDULE_NOW_MS = Date.parse("2026-04-08T10:00:00.000Z"); +const wakeIn = (offsetMs: number) => new Date(RESCHEDULE_NOW_MS + offsetMs).toISOString(); + function currentUndo() { const notice = useThreadUndoNotice.getState().notice; expect(notice).not.toBeNull(); @@ -381,6 +384,42 @@ describe("settle and snooze Undo", () => { input: { threadId: target.threadId, reason: "user" }, }); }); + + it("restores the previous wake time when undoing a reschedule", async () => { + vi.setSystemTime(RESCHEDULE_NOW_MS); + const previousWake = wakeIn(60_000); + const nextWake = wakeIn(120_000); + threadShell.snoozedUntil = previousWake; + const actions = useThreadActions(); + await actions.snoozeThread(target, nextWake); + expect(useThreadUndoNotice.getState().notice).toMatchObject({ + action: "Rescheduled", + count: 1, + }); + await currentUndo()(); + expect(commands.unsnooze).not.toHaveBeenCalled(); + expect(commands.snooze).toHaveBeenLastCalledWith({ + environmentId: target.environmentId, + input: { threadId: target.threadId, snoozedUntil: previousWake }, + }); + }); + + it("wakes the thread when undoing a reschedule after the previous wake time passed", async () => { + vi.setSystemTime(RESCHEDULE_NOW_MS); + const previousWake = wakeIn(60_000); + threadShell.snoozedUntil = previousWake; + const actions = useThreadActions(); + await actions.snoozeThread(target, wakeIn(3_600_000)); + const undo = currentUndo(); + commands.snooze.mockClear(); + vi.setSystemTime(RESCHEDULE_NOW_MS + 120_000); + await undo(); + expect(commands.snooze).not.toHaveBeenCalled(); + expect(commands.unsnooze).toHaveBeenCalledExactlyOnceWith({ + environmentId: target.environmentId, + input: { threadId: target.threadId, reason: "user" }, + }); + }); }); describe("archive and delete Undo expiry", () => { diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 08294d6583996..adb36b50c0674 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -2731,6 +2731,7 @@ "0b75d1fefd7710fe": "Erledigt aufheben", "56198134d0174861": "Thread erledigen", "0d36d1316d4fc58a": "Thread wecken", + "0f6758106a241c35": "Neu planen", "760b0829c8381b1a": "Zurückstellen", "d1259290b8c63577": "Thread umbenennen", "6dd1f458bcd6a2ea": "Wird neu erzeugt…", @@ -2801,11 +2802,13 @@ "5b6a217023d4c958": "Der sichere Desktop-Speicher ist in diesem Systemkontext nicht verfügbar.", "4d71697ed52788cd": "{count, plural, one {{count} Thread} other {{count} Threads}} erledigt", "96f74e61e5e2394a": "{count, plural, one {{count} Thread} other {{count} Threads}} zurückgestellt", + "a9a7487632c4afe9": "Neu geplante Threads: {count}", "158d77e7a872186e": "{count, plural, one {{count} Thread} other {{count} Threads}} losgelöst", "5d38c668c52bc915": "{count, plural, one {{count} Thread} other {{count} Threads}} archiviert", "6789de8d4ecec9f8": "{count, plural, one {{count} Entwurf} other {{count} Entwürfe}} verworfen", "1a8ee983ab8119c7": "Erledigen von {count, plural, one {{count} Thread} other {{count} Threads}} rückgängig gemacht", "c57355fdd247fcb3": "Zurückstellen von {count, plural, one {{count} Thread} other {{count} Threads}} rückgängig gemacht", + "41fbe9c41ca6f981": "Threads mit rückgängig gemachter Neuplanung: {count}", "711d9195c6ef078d": "Loslösen von {count, plural, one {{count} Thread} other {{count} Threads}} rückgängig gemacht", "2d8200d842d811b6": "Archivieren von {count, plural, one {{count} Thread} other {{count} Threads}} rückgängig gemacht", "9dd1db0ec5544c22": "Verwerfen von {count, plural, one {{count} Entwurf} other {{count} Entwürfen}} rückgängig gemacht", @@ -2883,6 +2886,7 @@ "16cad9e0c52c40d2": "1 Thread angeheftet", "6c7cf4790065f7ed": "Loslösen konnte nicht rückgängig gemacht werden", "43073cef5cd7321c": "Erledigen konnte nicht rückgängig gemacht werden", + "112876c0732ba76d": "Die vorherige Aufwachzeit konnte nicht wiederhergestellt werden", "61b715e068806a25": "Thread „dieser Thread“ löschen?", "4fa610c76542a4c0": "Seitenleiste eingeblendet", "9dddd0641bbf697d": "Seitenleiste ausgeblendet", @@ -11941,6 +11945,7 @@ "9e8470dfcf1004d6": "Thread erledigen", "a75fb28f41e65d1d": "{count, plural, =1 {Erledigt,} other {{count} erledigt,}}", "0186f474fc350897": "{count, plural, =1 {Zurückgestellt,} other {{count} zurückgestellt,}}", + "0016b7f7cbe03821": "Neu geplant {count},", "1bc189242bfa159d": "{count, plural, =1 {Losgelöst,} other {{count} losgelöst,}}", "0cb1701d57cffefc": "{count, plural, =1 {Archiviert,} other {{count} archiviert,}}", "3cb98bdea58716bf": "{count, plural, =1 {Verworfen,} other {{count} verworfen,}}", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index 490aab5d7897a..e63c1dbdd050a 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -2730,6 +2730,7 @@ "0b75d1fefd7710fe": "Un-settle thread", "56198134d0174861": "Settle thread", "0d36d1316d4fc58a": "Wake thread", + "0f6758106a241c35": "Reschedule", "760b0829c8381b1a": "Snooze", "d1259290b8c63577": "Rename thread", "6dd1f458bcd6a2ea": "Regenerating…", @@ -2800,11 +2801,13 @@ "5b6a217023d4c958": "Desktop secure storage is unavailable in this system context.", "4d71697ed52788cd": "Settled {count, plural, one {{count} thread} other {{count} threads}}", "96f74e61e5e2394a": "Snoozed {count, plural, one {{count} thread} other {{count} threads}}", + "a9a7487632c4afe9": "Rescheduled {count, plural, one {{count} thread} other {{count} threads}}", "158d77e7a872186e": "Unpinned {count, plural, one {{count} thread} other {{count} threads}}", "5d38c668c52bc915": "Archived {count, plural, one {{count} thread} other {{count} threads}}", "6789de8d4ecec9f8": "Discarded {count, plural, one {{count} draft} other {{count} drafts}}", "1a8ee983ab8119c7": "Undid settle of {count, plural, one {{count} thread} other {{count} threads}}", "c57355fdd247fcb3": "Undid snooze of {count, plural, one {{count} thread} other {{count} threads}}", + "41fbe9c41ca6f981": "Undid reschedule of {count, plural, one {{count} thread} other {{count} threads}}", "711d9195c6ef078d": "Undid unpin of {count, plural, one {{count} thread} other {{count} threads}}", "2d8200d842d811b6": "Undid archive of {count, plural, one {{count} thread} other {{count} threads}}", "9dd1db0ec5544c22": "Undid discard of {count, plural, one {{count} draft} other {{count} drafts}}", @@ -2882,6 +2885,7 @@ "16cad9e0c52c40d2": "Pinned 1 thread", "6c7cf4790065f7ed": "Failed to undo unpin", "43073cef5cd7321c": "Failed to undo settle", + "112876c0732ba76d": "Failed to restore the previous wake time", "61b715e068806a25": "Delete thread \"this thread\"?", "4fa610c76542a4c0": "Sidebar shown", "9dddd0641bbf697d": "Sidebar hidden", @@ -11949,6 +11953,7 @@ "9e8470dfcf1004d6": "Settle thread", "a75fb28f41e65d1d": "{count, plural, =1 {Settled,} other {Settled {count},}}", "0186f474fc350897": "{count, plural, =1 {Snoozed,} other {Snoozed {count},}}", + "0016b7f7cbe03821": "{count, plural, =1 {Rescheduled,} other {Rescheduled {count},}}", "1bc189242bfa159d": "{count, plural, =1 {Unpinned,} other {Unpinned {count},}}", "0cb1701d57cffefc": "{count, plural, =1 {Archived,} other {Archived {count},}}", "3cb98bdea58716bf": "{count, plural, =1 {Discarded,} other {Discarded {count},}}", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index d09c34ee915e3..bc3fddc32cd1f 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -2730,6 +2730,7 @@ "0b75d1fefd7710fe": "Quitar hilo de resueltos", "56198134d0174861": "Resolver hilo", "0d36d1316d4fc58a": "Reactivar hilo", + "0f6758106a241c35": "Reprogramar", "760b0829c8381b1a": "Posponer", "d1259290b8c63577": "Cambiar nombre del hilo", "6dd1f458bcd6a2ea": "Regenerando…", @@ -2800,11 +2801,13 @@ "5b6a217023d4c958": "El almacenamiento seguro del escritorio no está disponible en este contexto del sistema.", "4d71697ed52788cd": "{count, plural, one {Se resolvió {count} hilo} other {Se resolvieron {count} hilos}}", "96f74e61e5e2394a": "{count, plural, one {Se pospuso {count} hilo} other {Se pospusieron {count} hilos}}", + "a9a7487632c4afe9": "Hilos reprogramados: {count}", "158d77e7a872186e": "{count, plural, one {Se desfijó {count} hilo} other {Se desfijaron {count} hilos}}", "5d38c668c52bc915": "{count, plural, one {Se archivó {count} hilo} other {Se archivaron {count} hilos}}", "6789de8d4ecec9f8": "{count, plural, one {Se descartó {count} borrador} other {Se descartaron {count} borradores}}", "1a8ee983ab8119c7": "{count, plural, one {Se deshizo la resolución de {count} hilo} other {Se deshizo la resolución de {count} hilos}}", "c57355fdd247fcb3": "{count, plural, one {Se deshizo el aplazamiento de {count} hilo} other {Se deshizo el aplazamiento de {count} hilos}}", + "41fbe9c41ca6f981": "Hilos cuya reprogramación se deshizo: {count}", "711d9195c6ef078d": "{count, plural, one {Se volvió a fijar {count} hilo} other {Se volvieron a fijar {count} hilos}}", "2d8200d842d811b6": "{count, plural, one {Se deshizo el archivado de {count} hilo} other {Se deshizo el archivado de {count} hilos}}", "9dd1db0ec5544c22": "{count, plural, one {Se recuperó {count} borrador} other {Se recuperaron {count} borradores}}", @@ -2882,6 +2885,7 @@ "16cad9e0c52c40d2": "Se fijó 1 hilo", "6c7cf4790065f7ed": "No se pudo deshacer el desfijado", "43073cef5cd7321c": "No se pudo deshacer la resolución", + "112876c0732ba76d": "No se pudo restaurar la hora de reactivación anterior", "61b715e068806a25": "¿Eliminar el hilo \"este hilo\"?", "4fa610c76542a4c0": "Barra lateral visible", "9dddd0641bbf697d": "Barra lateral oculta", @@ -11934,6 +11938,7 @@ "9e8470dfcf1004d6": "Resolver hilo", "a75fb28f41e65d1d": "{count, plural, =1 {Resuelto,} other {Resueltos {count},}}", "0186f474fc350897": "{count, plural, =1 {Pospuesto,} other {Pospuestos {count},}}", + "0016b7f7cbe03821": "Reprogramados {count},", "1bc189242bfa159d": "{count, plural, =1 {Desfijado,} other {Desfijados {count},}}", "0cb1701d57cffefc": "{count, plural, =1 {Archivado,} other {Archivados {count},}}", "3cb98bdea58716bf": "{count, plural, =1 {Descartado,} other {Descartados {count},}}", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index 496a0075ce751..81d0cee8633d7 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -2730,6 +2730,7 @@ "0b75d1fefd7710fe": "Rouvrir le fil", "56198134d0174861": "Clore le fil", "0d36d1316d4fc58a": "Réveiller le fil", + "0f6758106a241c35": "Replanifier", "760b0829c8381b1a": "Reporter", "d1259290b8c63577": "Renommer le fil", "6dd1f458bcd6a2ea": "Régénération…", @@ -2800,11 +2801,13 @@ "5b6a217023d4c958": "Le stockage sécurisé de l’app desktop n’est pas disponible dans ce contexte système.", "4d71697ed52788cd": "{count, plural, one {{count} fil clos} other {{count} fils clos}}", "96f74e61e5e2394a": "{count, plural, one {{count} fil reporté} other {{count} fils reportés}}", + "a9a7487632c4afe9": "Fils replanifiés : {count}", "158d77e7a872186e": "{count, plural, one {{count} fil désépinglé} other {{count} fils désépinglés}}", "5d38c668c52bc915": "{count, plural, one {{count} fil archivé} other {{count} fils archivés}}", "6789de8d4ecec9f8": "{count, plural, one {{count} brouillon abandonné} other {{count} brouillons abandonnés}}", "1a8ee983ab8119c7": "Clôture annulée pour {count, plural, one {{count} fil} other {{count} fils}}", "c57355fdd247fcb3": "Report annulé pour {count, plural, one {{count} fil} other {{count} fils}}", + "41fbe9c41ca6f981": "Fils dont la replanification a été annulée : {count}", "711d9195c6ef078d": "Désépinglage annulé pour {count, plural, one {{count} fil} other {{count} fils}}", "2d8200d842d811b6": "Archivage annulé pour {count, plural, one {{count} fil} other {{count} fils}}", "9dd1db0ec5544c22": "Abandon annulé pour {count, plural, one {{count} brouillon} other {{count} brouillons}}", @@ -2882,6 +2885,7 @@ "16cad9e0c52c40d2": "1 fil épinglé", "6c7cf4790065f7ed": "Échec de l’annulation du désépinglage", "43073cef5cd7321c": "Échec de l’annulation de la clôture", + "112876c0732ba76d": "Impossible de rétablir l’heure de réveil précédente", "61b715e068806a25": "Supprimer le fil « ce fil » ?", "4fa610c76542a4c0": "Barre latérale affichée", "9dddd0641bbf697d": "Barre latérale masquée", @@ -11939,6 +11943,7 @@ "9e8470dfcf1004d6": "Clore le fil", "a75fb28f41e65d1d": "{count, plural, =1 {Clos,} other {{count} clos,}}", "0186f474fc350897": "{count, plural, =1 {Reporté,} other {{count} reportés,}}", + "0016b7f7cbe03821": "Replanifiés {count},", "1bc189242bfa159d": "{count, plural, =1 {Désépinglé,} other {{count} désépinglés,}}", "0cb1701d57cffefc": "{count, plural, =1 {Archivé,} other {{count} archivés,}}", "3cb98bdea58716bf": "{count, plural, =1 {Abandonné,} other {{count} abandonnés,}}", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index c6295db2ad24e..cffa544a4db4c 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -2728,6 +2728,7 @@ "0b75d1fefd7710fe": "スレッドの対応済みを解除", "56198134d0174861": "スレッドを対応済みにする", "0d36d1316d4fc58a": "スヌーズを解除", + "0f6758106a241c35": "再設定", "760b0829c8381b1a": "スヌーズ", "d1259290b8c63577": "スレッドの名前を変更", "6dd1f458bcd6a2ea": "再生成しています…", @@ -2798,11 +2799,13 @@ "5b6a217023d4c958": "このシステムのコンテキストではデスクトップのセキュアストレージを利用できません。", "4d71697ed52788cd": "{count, plural, other {{count} 件のスレッド}}を対応済みにしました", "96f74e61e5e2394a": "{count, plural, other {{count} 件のスレッド}}をスヌーズしました", + "a9a7487632c4afe9": "{count} 件のスレッドの再開時刻を再設定しました", "158d77e7a872186e": "{count, plural, other {{count} 件のスレッド}}のピン留めを解除しました", "5d38c668c52bc915": "{count, plural, other {{count} 件のスレッド}}をアーカイブしました", "6789de8d4ecec9f8": "{count, plural, other {{count} 件の下書き}}を破棄しました", "1a8ee983ab8119c7": "{count, plural, other {{count} 件のスレッド}}の対応済みを元に戻しました", "c57355fdd247fcb3": "{count, plural, other {{count} 件のスレッド}}のスヌーズを元に戻しました", + "41fbe9c41ca6f981": "{count} 件のスレッドの再開時刻の再設定を取り消しました", "711d9195c6ef078d": "{count, plural, other {{count} 件のスレッド}}のピン留め解除を元に戻しました", "2d8200d842d811b6": "{count, plural, other {{count} 件のスレッド}}のアーカイブを元に戻しました", "9dd1db0ec5544c22": "{count, plural, other {{count} 件の下書き}}の破棄を元に戻しました", @@ -2880,6 +2883,7 @@ "16cad9e0c52c40d2": "1 件のスレッドをピン留めしました", "6c7cf4790065f7ed": "ピン留め解除を元に戻せませんでした", "43073cef5cd7321c": "対応済みを元に戻せませんでした", + "112876c0732ba76d": "以前の再開時刻を復元できませんでした", "61b715e068806a25": "スレッド「このスレッド」を削除しますか?", "4fa610c76542a4c0": "サイドバーを表示しました", "9dddd0641bbf697d": "サイドバーを非表示にしました", @@ -11889,6 +11893,7 @@ "9e8470dfcf1004d6": "スレッドを対応済みにする", "a75fb28f41e65d1d": "{count, plural, =1 {対応済み、} other {対応済み {count} 件、}}", "0186f474fc350897": "{count, plural, =1 {スヌーズ中、} other {スヌーズ中 {count} 件、}}", + "0016b7f7cbe03821": "再設定済み {count},", "1bc189242bfa159d": "{count, plural, =1 {ピン留めを解除、} other {ピン留めを解除 {count} 件、}}", "0cb1701d57cffefc": "{count, plural, =1 {アーカイブ済み、} other {アーカイブ済み {count} 件、}}", "3cb98bdea58716bf": "{count, plural, =1 {破棄、} other {破棄 {count} 件、}}", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index 84311b25cd463..eba23e5e066eb 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -2729,6 +2729,7 @@ "0b75d1fefd7710fe": "스레드 정리 취소", "56198134d0174861": "스레드 정리", "0d36d1316d4fc58a": "스레드 깨우기", + "0f6758106a241c35": "시간 변경", "760b0829c8381b1a": "다시 알림", "d1259290b8c63577": "스레드 이름 바꾸기", "6dd1f458bcd6a2ea": "다시 생성하는 중…", @@ -2799,11 +2800,13 @@ "5b6a217023d4c958": "이 시스템 컨텍스트에서는 데스크톱 보안 저장소를 사용할 수 없습니다.", "4d71697ed52788cd": "{count, plural, other {스레드 {count}개}} 정리함", "96f74e61e5e2394a": "{count, plural, other {스레드 {count}개}}에 다시 알림 설정함", + "a9a7487632c4afe9": "스레드 {count}개의 다시 열기 시간을 변경했습니다", "158d77e7a872186e": "{count, plural, other {스레드 {count}개}} 고정 해제함", "5d38c668c52bc915": "{count, plural, other {스레드 {count}개}} 보관함", "6789de8d4ecec9f8": "{count, plural, other {초안 {count}개}} 삭제함", "1a8ee983ab8119c7": "{count, plural, other {스레드 {count}개}} 정리 실행 취소함", "c57355fdd247fcb3": "{count, plural, other {스레드 {count}개}} 다시 알림 실행 취소함", + "41fbe9c41ca6f981": "스레드 {count}개의 다시 열기 시간 변경을 취소했습니다", "711d9195c6ef078d": "{count, plural, other {스레드 {count}개}} 고정 해제 실행 취소함", "2d8200d842d811b6": "{count, plural, other {스레드 {count}개}} 보관 실행 취소함", "9dd1db0ec5544c22": "{count, plural, other {초안 {count}개}} 삭제 실행 취소함", @@ -2881,6 +2884,7 @@ "16cad9e0c52c40d2": "스레드 1개 고정함", "6c7cf4790065f7ed": "고정 해제를 실행 취소하지 못했습니다", "43073cef5cd7321c": "정리를 실행 취소하지 못했습니다", + "112876c0732ba76d": "이전 다시 열기 시간을 복원하지 못했습니다", "61b715e068806a25": "\"이 스레드\"를 삭제할까요?", "4fa610c76542a4c0": "사이드바 표시됨", "9dddd0641bbf697d": "사이드바 숨겨짐", @@ -11886,6 +11890,7 @@ "9e8470dfcf1004d6": "스레드 정리", "a75fb28f41e65d1d": "{count, plural, =1 {정리됨,} other {{count}개 정리됨,}}", "0186f474fc350897": "{count, plural, =1 {다시 알림 설정됨,} other {{count}개 다시 알림 설정됨,}}", + "0016b7f7cbe03821": "시간 변경 완료 {count},", "1bc189242bfa159d": "{count, plural, =1 {고정 해제됨,} other {{count}개 고정 해제됨,}}", "0cb1701d57cffefc": "{count, plural, =1 {보관됨,} other {{count}개 보관됨,}}", "3cb98bdea58716bf": "{count, plural, =1 {삭제됨,} other {{count}개 삭제됨,}}", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index 0a566f1e7c18a..d92bc73640307 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -2730,6 +2730,7 @@ "0b75d1fefd7710fe": "Reabrir thread", "56198134d0174861": "Concluir thread", "0d36d1316d4fc58a": "Despertar thread", + "0f6758106a241c35": "Reagendar", "760b0829c8381b1a": "Adiar", "d1259290b8c63577": "Renomear thread", "6dd1f458bcd6a2ea": "Gerando novamente…", @@ -2800,11 +2801,13 @@ "5b6a217023d4c958": "O armazenamento seguro do desktop não está disponível neste contexto do sistema.", "4d71697ed52788cd": "{count, plural, one {{count} thread concluída} other {{count} threads concluídas}}", "96f74e61e5e2394a": "{count, plural, one {{count} thread adiada} other {{count} threads adiadas}}", + "a9a7487632c4afe9": "Conversas reagendadas: {count}", "158d77e7a872186e": "{count, plural, one {{count} thread desafixada} other {{count} threads desafixadas}}", "5d38c668c52bc915": "{count, plural, one {{count} thread arquivada} other {{count} threads arquivadas}}", "6789de8d4ecec9f8": "{count, plural, one {{count} rascunho descartado} other {{count} rascunhos descartados}}", "1a8ee983ab8119c7": "Conclusão desfeita em {count, plural, one {{count} thread} other {{count} threads}}", "c57355fdd247fcb3": "Adiamento desfeito em {count, plural, one {{count} thread} other {{count} threads}}", + "41fbe9c41ca6f981": "Conversas com reagendamento desfeito: {count}", "711d9195c6ef078d": "Desafixação desfeita em {count, plural, one {{count} thread} other {{count} threads}}", "2d8200d842d811b6": "Arquivamento desfeito em {count, plural, one {{count} thread} other {{count} threads}}", "9dd1db0ec5544c22": "Descarte desfeito em {count, plural, one {{count} rascunho} other {{count} rascunhos}}", @@ -2882,6 +2885,7 @@ "16cad9e0c52c40d2": "1 thread fixada", "6c7cf4790065f7ed": "Falha ao desfazer a desafixação", "43073cef5cd7321c": "Falha ao desfazer a conclusão", + "112876c0732ba76d": "Não foi possível restaurar o horário de reativação anterior", "61b715e068806a25": "Excluir a thread \"esta thread\"?", "4fa610c76542a4c0": "Barra lateral exibida", "9dddd0641bbf697d": "Barra lateral oculta", @@ -11938,6 +11942,7 @@ "9e8470dfcf1004d6": "Concluir thread", "a75fb28f41e65d1d": "{count, plural, =1 {Concluída,} other {{count} concluídas,}}", "0186f474fc350897": "{count, plural, =1 {Adiada,} other {{count} adiadas,}}", + "0016b7f7cbe03821": "Reagendadas {count},", "1bc189242bfa159d": "{count, plural, =1 {Desafixada,} other {{count} desafixadas,}}", "0cb1701d57cffefc": "{count, plural, =1 {Arquivada,} other {{count} arquivadas,}}", "3cb98bdea58716bf": "{count, plural, =1 {Descartada,} other {{count} descartadas,}}", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index c948f268338ce..30a733734aebd 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -2730,6 +2730,7 @@ "0b75d1fefd7710fe": "Вернуть тред из разобранных", "56198134d0174861": "Разобрать тред", "0d36d1316d4fc58a": "Разбудить тред", + "0f6758106a241c35": "Перенести", "760b0829c8381b1a": "Отложить", "d1259290b8c63577": "Переименовать тред", "6dd1f458bcd6a2ea": "Генерация…", @@ -2800,11 +2801,13 @@ "5b6a217023d4c958": "Защищённое хранилище десктопа недоступно в этом системном контексте.", "4d71697ed52788cd": "Разобрано: {count, plural, one {{count} тред} few {{count} треда} many {{count} тредов} other {{count} треда}}", "96f74e61e5e2394a": "Отложено: {count, plural, one {{count} тред} few {{count} треда} many {{count} тредов} other {{count} треда}}", + "a9a7487632c4afe9": "Веток с изменённым временем возврата: {count}", "158d77e7a872186e": "Откреплено: {count, plural, one {{count} тред} few {{count} треда} many {{count} тредов} other {{count} треда}}", "5d38c668c52bc915": "Архивировано: {count, plural, one {{count} тред} few {{count} треда} many {{count} тредов} other {{count} треда}}", "6789de8d4ecec9f8": "Удалено: {count, plural, one {{count} черновик} few {{count} черновика} many {{count} черновиков} other {{count} черновика}}", "1a8ee983ab8119c7": "Разбор отменён: {count, plural, one {{count} тред} few {{count} треда} many {{count} тредов} other {{count} треда}}", "c57355fdd247fcb3": "Откладывание отменено: {count, plural, one {{count} тред} few {{count} треда} many {{count} тредов} other {{count} треда}}", + "41fbe9c41ca6f981": "Веток с отменённым переносом: {count}", "711d9195c6ef078d": "Открепление отменено: {count, plural, one {{count} тред} few {{count} треда} many {{count} тредов} other {{count} треда}}", "2d8200d842d811b6": "Архивация отменена: {count, plural, one {{count} тред} few {{count} треда} many {{count} тредов} other {{count} треда}}", "9dd1db0ec5544c22": "Удаление отменено: {count, plural, one {{count} черновик} few {{count} черновика} many {{count} черновиков} other {{count} черновика}}", @@ -2882,6 +2885,7 @@ "16cad9e0c52c40d2": "Закреплён 1 тред", "6c7cf4790065f7ed": "Не удалось отменить открепление", "43073cef5cd7321c": "Не удалось отменить разбор", + "112876c0732ba76d": "Не удалось восстановить прежнее время возврата", "61b715e068806a25": "Удалить тред «этот тред»?", "4fa610c76542a4c0": "Боковая панель показана", "9dddd0641bbf697d": "Боковая панель скрыта", @@ -11939,6 +11943,7 @@ "9e8470dfcf1004d6": "Разобрать тред", "a75fb28f41e65d1d": "{count, plural, =1 {Разобран,} one {Разобрано: {count},} few {Разобрано: {count},} many {Разобрано: {count},} other {Разобрано: {count},}}", "0186f474fc350897": "{count, plural, =1 {Отложен,} one {Отложено: {count},} few {Отложено: {count},} many {Отложено: {count},} other {Отложено: {count},}}", + "0016b7f7cbe03821": "Перенесено {count},", "1bc189242bfa159d": "{count, plural, =1 {Откреплён,} one {Откреплено: {count},} few {Откреплено: {count},} many {Откреплено: {count},} other {Откреплено: {count},}}", "0cb1701d57cffefc": "{count, plural, =1 {Архивирован,} one {Архивировано: {count},} few {Архивировано: {count},} many {Архивировано: {count},} other {Архивировано: {count},}}", "3cb98bdea58716bf": "{count, plural, =1 {Отброшен,} one {Отброшено: {count},} few {Отброшено: {count},} many {Отброшено: {count},} other {Отброшено: {count},}}", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index 9e631e68a8c0e..ddf632018e0fc 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -2730,6 +2730,7 @@ "0b75d1fefd7710fe": "Markera tråden som ej klar", "56198134d0174861": "Markera tråden som klar", "0d36d1316d4fc58a": "Väck tråd", + "0f6758106a241c35": "Ändra tid", "760b0829c8381b1a": "Snooza", "d1259290b8c63577": "Byt namn på tråd", "6dd1f458bcd6a2ea": "Genererar om…", @@ -2800,11 +2801,13 @@ "5b6a217023d4c958": "Skrivbordsappens säkra lagring är inte tillgänglig i den här systemkontexten.", "4d71697ed52788cd": "Markerade {count, plural, one {{count} tråd som klar} other {{count} trådar som klara}}", "96f74e61e5e2394a": "Snoozade {count, plural, one {{count} tråd} other {{count} trådar}}", + "a9a7487632c4afe9": "Trådar med ändrad tid: {count}", "158d77e7a872186e": "Lossade {count, plural, one {{count} tråd} other {{count} trådar}}", "5d38c668c52bc915": "Arkiverade {count, plural, one {{count} tråd} other {{count} trådar}}", "6789de8d4ecec9f8": "Kastade {count, plural, one {{count} utkast} other {{count} utkast}}", "1a8ee983ab8119c7": "Ångrade markering som klar för {count, plural, one {{count} tråd} other {{count} trådar}}", "c57355fdd247fcb3": "Ångrade snooze av {count, plural, one {{count} tråd} other {{count} trådar}}", + "41fbe9c41ca6f981": "Trådar där tidsändringen ångrades: {count}", "711d9195c6ef078d": "Ångrade lossning av {count, plural, one {{count} tråd} other {{count} trådar}}", "2d8200d842d811b6": "Ångrade arkivering av {count, plural, one {{count} tråd} other {{count} trådar}}", "9dd1db0ec5544c22": "Återställde {count, plural, one {{count} utkast} other {{count} utkast}}", @@ -2882,6 +2885,7 @@ "16cad9e0c52c40d2": "Fäste 1 tråd", "6c7cf4790065f7ed": "Det gick inte att ångra lossningen", "43073cef5cd7321c": "Det gick inte att ångra markeringen som klar", + "112876c0732ba76d": "Det gick inte att återställa föregående väckningstid", "61b715e068806a25": "Ta bort tråden ”den här tråden”?", "4fa610c76542a4c0": "Sidofältet visas", "9dddd0641bbf697d": "Sidofältet är dolt", @@ -11947,6 +11951,7 @@ "9e8470dfcf1004d6": "Markera tråden som klar", "a75fb28f41e65d1d": "{count, plural, =1 {Klar,} other {Klara {count},}}", "0186f474fc350897": "{count, plural, =1 {Snoozad,} other {Snoozade {count},}}", + "0016b7f7cbe03821": "Tid ändrad {count},", "1bc189242bfa159d": "{count, plural, =1 {Lossad,} other {Lossade {count},}}", "0cb1701d57cffefc": "{count, plural, =1 {Arkiverad,} other {Arkiverade {count},}}", "3cb98bdea58716bf": "{count, plural, =1 {Kastad,} other {Kastade {count},}}", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index ac25c9237c4fe..1da550ab846bc 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -2734,6 +2734,7 @@ "0b75d1fefd7710fe": "取消会话收尾", "56198134d0174861": "收尾会话", "0d36d1316d4fc58a": "唤醒会话", + "0f6758106a241c35": "重新安排", "760b0829c8381b1a": "暂缓", "d1259290b8c63577": "重命名会话", "6dd1f458bcd6a2ea": "正在重新生成…", @@ -2804,11 +2805,13 @@ "5b6a217023d4c958": "此系统环境下无法使用桌面安全存储。", "4d71697ed52788cd": "已收尾 {count, plural, other {{count} 个会话}}", "96f74e61e5e2394a": "已暂缓 {count, plural, other {{count} 个会话}}", + "a9a7487632c4afe9": "已重新安排 {count} 个会话", "158d77e7a872186e": "已取消置顶 {count, plural, other {{count} 个会话}}", "5d38c668c52bc915": "已归档 {count, plural, other {{count} 个会话}}", "6789de8d4ecec9f8": "已丢弃 {count, plural, other {{count} 个草稿}}", "1a8ee983ab8119c7": "已撤销收尾 {count, plural, other {{count} 个会话}}", "c57355fdd247fcb3": "已撤销暂缓 {count, plural, other {{count} 个会话}}", + "41fbe9c41ca6f981": "已撤销 {count} 个会话的重新安排", "711d9195c6ef078d": "已撤销取消置顶 {count, plural, other {{count} 个会话}}", "2d8200d842d811b6": "已撤销归档 {count, plural, other {{count} 个会话}}", "9dd1db0ec5544c22": "已撤销丢弃 {count, plural, other {{count} 个草稿}}", @@ -2886,6 +2889,7 @@ "16cad9e0c52c40d2": "已置顶 1 个会话", "6c7cf4790065f7ed": "无法撤销取消置顶", "43073cef5cd7321c": "无法撤销收尾", + "112876c0732ba76d": "无法恢复之前的唤醒时间", "61b715e068806a25": "删除会话“此会话”?", "4fa610c76542a4c0": "侧边栏已显示", "9dddd0641bbf697d": "侧边栏已隐藏", @@ -11964,6 +11968,7 @@ "9e8470dfcf1004d6": "收尾会话", "a75fb28f41e65d1d": "{count, plural, =1 {已收尾,} other {已收尾 {count} 个,}}", "0186f474fc350897": "{count, plural, =1 {已暂缓,} other {已暂缓 {count} 个,}}", + "0016b7f7cbe03821": "已重新安排 {count},", "1bc189242bfa159d": "{count, plural, =1 {已取消置顶,} other {已取消置顶 {count} 个,}}", "0cb1701d57cffefc": "{count, plural, =1 {已归档,} other {已归档 {count} 个,}}", "3cb98bdea58716bf": "{count, plural, =1 {已丢弃,} other {已丢弃 {count} 个,}}", diff --git a/docs/user/thread-sidebar.md b/docs/user/thread-sidebar.md index 5950e152bd570..36d4c3fcba628 100644 --- a/docs/user/thread-sidebar.md +++ b/docs/user/thread-sidebar.md @@ -367,7 +367,8 @@ selected, the options apply to every connected environment, and the mobile app u Choose **Snooze → Custom…** from a thread's menu to pick a date and time in your local time zone, or a duration in minutes, hours, or days. Durations start when you confirm; one day means 24 hours. On web and desktop, you can also snooze -several selected threads together. Choose **Wake thread** to bring a thread back early. +several selected threads together. Choose **Wake thread** to bring a thread back early, or +**Reschedule** from a snoozed thread's menu to move its wake time without waking it. A snoozed thread keeps working and stays hidden until its wake time, even while its agent wakes itself for background work. It comes back early for an approval, diff --git a/packages/client-runtime/src/state/threadUndo.ts b/packages/client-runtime/src/state/threadUndo.ts index 20ea56400c284..b7899e280697d 100644 --- a/packages/client-runtime/src/state/threadUndo.ts +++ b/packages/client-runtime/src/state/threadUndo.ts @@ -54,7 +54,12 @@ export function planThreadUndo( readonly snoozedUntil?: string | null; } | null, ): ThreadUndoPlan { - if (action === "snooze") return [{ action: "unsnooze" }]; + if (action === "snooze") { + // Undoing a reschedule restores the previous wake time rather than waking. + return thread?.snoozedUntil != null + ? [{ action: "snooze", snoozedUntil: thread.snoozedUntil }] + : [{ action: "unsnooze" }]; + } const pin: ThreadUndoStep = { action: "pin", ...(thread?.pinOrderKey != null ? { orderKey: thread.pinOrderKey } : {}), @@ -84,12 +89,15 @@ export async function executeThreadUndo( execute: (step: ThreadUndoStep) => Promise, succeeded: (result: Result) => boolean, ): Promise { - let result = await execute(plan[0]); + // A snooze can expire before Undo runs, and the server rejects an expired restore. + const expired = (step: ThreadUndoStep) => + // @effect-diagnostics-next-line globalDate:off + step.action === "snooze" && Date.parse(step.snoozedUntil) <= Date.now(); + // A reschedule whose previous wake time passed would have woken the thread by now. + let result = await execute(expired(plan[0]) ? { action: "unsnooze" } : plan[0]); for (const step of plan.slice(1)) { if (!succeeded(result)) return result; - // A snooze can expire before Undo runs, and the server rejects an expired restore. - // @effect-diagnostics-next-line globalDate:off - if (step.action === "snooze" && Date.parse(step.snoozedUntil) <= Date.now()) continue; + if (expired(step)) continue; result = await execute(step); } return result;