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.
This commit is contained in:
yiekheng 2026-05-09 18:10:44 +08:00
parent 45fcc11e7b
commit 9e180b65a2
2 changed files with 8 additions and 10 deletions

View File

@ -372,14 +372,10 @@ export async function wizardSetTimeQuick(ctx: Context, quick: Quick): Promise<vo
} }
export async function wizardSetTimeCustomPrompt(ctx: Context): Promise<void> { export async function wizardSetTimeCustomPrompt(ctx: Context): Promise<void> {
await ctx.answerCallbackQuery(); // "Custom day & time" goes straight to the year/month/day picker now.
const userId = ctx.from?.id; // The Now / Tomorrow / Next-Mon quick options at the time menu already
if (!userId) return; // cover the near-term shortcuts, so the preset-day list was redundant.
updateWizard(userId, { step: "set_time" }); await wizardPickYearStart(ctx);
const op = await findOperator(ctx);
const tz = op?.defaultTimezone ?? DEFAULT_TIMEZONE;
const { reminderPickDayMenu } = await import("./menus.js");
await showMenu(ctx, reminderPickDayMenu(tz));
} }
export async function wizardBackToTimeMenu(ctx: Context): Promise<void> { export async function wizardBackToTimeMenu(ctx: Context): Promise<void> {

View File

@ -423,9 +423,11 @@ export function reminderPickYearMenu(currentYear: number): MenuView {
} }
keyboard.row(); 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 { return {
text: "📅 Exact date — Step A / D\n\nPick a year:", text: "📅 Pick a year:",
keyboard, keyboard,
parseMode: undefined, parseMode: undefined,
}; };