The best way to control Claude Code, Codex and more from any computer or phone
fix(mobile): snooze menu times advance with the clock (#26043)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 27, 2026 at 12:16 UTC
a56ecdafa7c944286f3b45aa51486be4ffe079fd
3 files changed
+35
-7
apps/mobile/src/features/threads/thread-list-v2-items.tsx
+6
-7
@@ -26,7 +26,7 @@ import {
26
resolveThreadWorkingStartedAt,
27
} from "@t3tools/client-runtime/state/models";
28
import { AuthOrchestrationOperateScope, type EnvironmentMachineKind } from "@t3tools/contracts";
29
-import { canSnooze, resolveSnoozePresets } from "@t3tools/client-runtime/state/thread-settled";
29
+import { canSnooze } from "@t3tools/client-runtime/state/thread-settled";
30
import type { MenuAction } from "@react-native-menu/menu";
31
import { memo, useCallback, useMemo, useState, type ComponentProps } from "react";
32
import { Pressable, useWindowDimensions, View } from "react-native";
@@ -63,6 +63,7 @@ import {
63
THREAD_LIST_V2_SETTLED_PAGE_COUNT,
64
resolveThreadListV2SnoozeGateExpiryMs,
65
resolveThreadListV2SnoozeMenuSelection,
66
+ resolveThreadListV2SnoozePresets,
67
threadHasUnseenCompletion,
68
resolveThreadListV2Status,
69
resolveThreadListV2ProviderDrivers,
@@ -756,12 +757,10 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
757
snoozable: canSnooze(thread, { now: snoozeGateNow }),
758
snoozed: snoozedRow,
759
});
759
- const snoozePresets = useMemo(
760
- // oxlint-disable-next-line react/purity -- The memo recomputes on the snoozePresetMinute tick, so preset times refresh every minute.
761
- () => (swipeActions.secondary === "snooze" ? resolveSnoozePresets(new Date()) : ([] as const)),
762
- // oxlint-disable-next-line react/memo-dependencies -- The minute tick refreshes relative snooze times while the row remains mounted.
763
- [props.snoozePresetMinute, swipeActions.secondary],
764
- );
760
+ const snoozePresets = resolveThreadListV2SnoozePresets({
761
+ secondary: swipeActions.secondary,
762
+ now: props.snoozePresetMinute || snoozeGateNow,
763
+ });
764
const snoozePresetActions = useMemo<MenuAction[]>(
765
() => [
766
...snoozePresets.map((preset) => ({
apps/mobile/src/features/threads/threadListV2.test.ts
+17
@@ -35,6 +35,7 @@ import {
35
buildThreadListV2ListItems,
36
getThreadListV2OrderedSection,
37
resolveThreadListV2SnoozeMenuSelection,
38
+ resolveThreadListV2SnoozePresets,
39
resolveThreadListV2Status,
40
resolveThreadListV2WokeAt,
41
sortThreadsForListV2,
@@ -76,6 +77,22 @@ describe("resolveThreadListV2SnoozeMenuSelection", () => {
77
});
78
});
79
80
+describe("resolveThreadListV2SnoozePresets", () => {
81
+ it("reads preset times from the list minute, not the clock at first render", () => {
82
+ using _timers = { [Symbol.dispose]: () => vi.useRealTimers() };
83
+ vi.useFakeTimers({ now: new Date(2026, 4, 8, 10) });
84
+ const laterMinute = new Date(2026, 4, 8, 19, 15).toISOString();
85
+
86
+ const presets = resolveThreadListV2SnoozePresets({ secondary: "snooze", now: laterMinute });
87
+
88
+ expect(presets.find((preset) => preset.id === "hour")?.snoozedUntil).toBe(
89
+ new Date(2026, 4, 8, 20, 15).toISOString(),
90
+ );
91
+ // The evening preset is gone by 19:15; a reading from 10:00 would still offer it.
92
+ expect(presets.map((preset) => preset.id)).not.toContain("evening");
93
+ });
94
+});
95
+
96
describe("resolveThreadListV2Status", () => {
97
it("presents decoded thread waits as Waiting while preserving requests and older servers", () => {
98
const raw = makeRawThreadShell({
apps/mobile/src/features/threads/threadListV2.ts
+12
@@ -72,6 +72,18 @@ export type ThreadListV2Status =
72
| "ready";
73
export type ThreadListV2SwipeAction = "archive" | "settle" | "unsettle" | "snooze" | "unsnooze";
74
75
+/**
76
+ * Presets for a row's snooze menu, read at the list's minute instead of the
77
+ * clock: the compiler keys a row's memo on its inputs, so a clock read inside
78
+ * it would keep the times from the row's first render.
79
+ */
80
+export function resolveThreadListV2SnoozePresets(input: {
81
+ readonly secondary: "snooze" | null;
82
+ readonly now: string;
83
+}): ReadonlyArray<SnoozePreset> {
84
+ return input.secondary === "snooze" ? resolveSnoozePresets(new Date(input.now)) : [];
85
+}
86
+
87
export function resolveThreadListV2SnoozeMenuSelection(input: {
88
readonly event: string;
89
readonly displayedPresets: ReadonlyArray<SnoozePreset>;