The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 14:00 UTC
fix(web,mobile): snooze menu no longer offers the same wake time twice (#8741)
Vitaly Iegorov committed
Aug 30, 2026 at 22:02 UTC
7980dfddb193864e07a5bcc013b0ccb93fb4300c
2 files changed
+24
-7
packages/client-runtime/src/state/threadSettled.ts
+11
-7
@@ -394,7 +394,9 @@ function addSnoozeDays(base: Date, days: number): Date {
394
/**
395
* Shared "snooze until" choices for every client. "This evening" only
396
* appears while it is meaningfully before evening; after that the calendar
397
- * choices start at "Tomorrow".
397
+ * choices start at "Tomorrow". Calendar presets that land on the same
398
+ * instant collapse: on Sundays "Tomorrow" and "Next week" are both Monday
399
+ * morning, so only "Tomorrow" is offered.
400
*/
401
export function resolveSnoozePresets(now: Date): ReadonlyArray<SnoozePreset> {
402
const inAnHour = new Date(now.getTime() + HOUR_MS);
@@ -434,12 +436,14 @@ export function resolveSnoozePresets(now: Date): ReadonlyArray<SnoozePreset> {
436
437
const daysUntilMonday = (1 - now.getDay() + 7) % 7 || 7;
438
const nextWeek = snoozeAtHour(addSnoozeDays(now, daysUntilMonday), MORNING_HOUR);
437
- presets.push({
438
- id: "next-week",
439
- label: "Next week",
440
- whenLabel: `${nextWeek.toLocaleDateString(undefined, { weekday: "short" })} ${snoozeTimeOfDayLabel(nextWeek)}`,
441
- snoozedUntil: nextWeek.toISOString(),
442
- });
439
+ if (nextWeek.getTime() !== tomorrow.getTime()) {
440
+ presets.push({
441
+ id: "next-week",
442
+ label: "Next week",
443
+ whenLabel: `${nextWeek.toLocaleDateString(undefined, { weekday: "short" })} ${snoozeTimeOfDayLabel(nextWeek)}`,
444
+ snoozedUntil: nextWeek.toISOString(),
445
+ });
446
+ }
447
448
return presets;
449
}
packages/client-runtime/src/state/threadSnoozed.test.ts
+13
@@ -297,4 +297,17 @@ describe("resolveSnoozePresets", () => {
297
expect(nextWeek.getDay()).toBe(1);
298
expect(nextWeek.getDate()).toBe(13);
299
});
300
+
301
+ it("drops next week on Sundays, when it lands on the same Monday as tomorrow", () => {
302
+ // Sunday 2026-08-30 07:01: "Tomorrow" and "Next week" are both Monday 9:00.
303
+ const presets = resolveSnoozePresets(localDate(2026, 8, 30, 7, 1));
304
+ expect(presets.map((preset) => preset.id)).toEqual([
305
+ "hour",
306
+ "three-hours",
307
+ "evening",
308
+ "tomorrow",
309
+ ]);
310
+ const tomorrow = new Date(presets.find((preset) => preset.id === "tomorrow")!.snoozedUntil);
311
+ expect(tomorrow.getDay()).toBe(1);
312
+ });
313
});