From 9e180b65a26ba818bc91113d1656b720d7e39a43 Mon Sep 17 00:00:00 2001 From: yiekheng Date: Sat, 9 May 2026 18:10:44 +0800 Subject: [PATCH] feat(bot): Custom day & time goes straight to year/month/day picker The preset day list (Today/Tomorrow/+1 week/etc.) was redundant with the top-level time-quick options (Now / Tomorrow 9 AM / Next Mon 9 AM) and added an extra step for the operator's actual use case (specific dates). Tapping "Custom day & time" now opens the year picker directly. Back from the year picker returns to the time menu (Now / Tomorrow / etc.) instead of looping into itself. --- apps/bot/src/telegram/callbacks.ts | 12 ++++-------- apps/bot/src/telegram/menus.ts | 6 ++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/bot/src/telegram/callbacks.ts b/apps/bot/src/telegram/callbacks.ts index a02f473..2414803 100644 --- a/apps/bot/src/telegram/callbacks.ts +++ b/apps/bot/src/telegram/callbacks.ts @@ -372,14 +372,10 @@ export async function wizardSetTimeQuick(ctx: Context, quick: Quick): Promise { - await ctx.answerCallbackQuery(); - const userId = ctx.from?.id; - if (!userId) return; - updateWizard(userId, { step: "set_time" }); - const op = await findOperator(ctx); - const tz = op?.defaultTimezone ?? DEFAULT_TIMEZONE; - const { reminderPickDayMenu } = await import("./menus.js"); - await showMenu(ctx, reminderPickDayMenu(tz)); + // "Custom day & time" goes straight to the year/month/day picker now. + // The Now / Tomorrow / Next-Mon quick options at the time menu already + // cover the near-term shortcuts, so the preset-day list was redundant. + await wizardPickYearStart(ctx); } export async function wizardBackToTimeMenu(ctx: Context): Promise { diff --git a/apps/bot/src/telegram/menus.ts b/apps/bot/src/telegram/menus.ts index 59e3b22..934b652 100644 --- a/apps/bot/src/telegram/menus.ts +++ b/apps/bot/src/telegram/menus.ts @@ -423,9 +423,11 @@ export function reminderPickYearMenu(currentYear: number): MenuView { } keyboard.row(); } - keyboard.text("⬅ Back", "rm_t:custom"); + // Back goes to the time menu (Now / Tomorrow / Next Mon / Custom) — not + // back to the Custom prompt, which would just re-open this same screen. + keyboard.text("⬅ Back", "rm_t:back"); return { - text: "📅 Exact date — Step A / D\n\nPick a year:", + text: "📅 Pick a year:", keyboard, parseMode: undefined, };