From e4c684ec26c533eaad8b17b36c41155e1b7a2405 Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 9 Jun 2026 23:23:21 +0000 Subject: [PATCH] fix(ui): tighten routine preview polish --- ui/src/components/EnvVarEditor.tsx | 15 +++++++-------- ui/src/lib/cron-fires.ts | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ui/src/components/EnvVarEditor.tsx b/ui/src/components/EnvVarEditor.tsx index 74e161d32ea..faabf9db09f 100644 --- a/ui/src/components/EnvVarEditor.tsx +++ b/ui/src/components/EnvVarEditor.tsx @@ -174,14 +174,13 @@ export function EnvVarEditor({ // Fill the trailing empty row (or append one) with this secret bound. const next = rows.map((row) => ({ ...row })); const trailing = next[next.length - 1]; - const target = - trailing && !trailing.key && !trailing.plainValue && !trailing.secretId - ? trailing - : (() => { - const fresh = emptyRow(); - next.push(fresh); - return fresh; - })(); + let target: Row; + if (trailing && !trailing.key && !trailing.plainValue && !trailing.secretId) { + target = trailing; + } else { + target = emptyRow(); + next.push(target); + } target.source = "secret"; target.secretId = secret.id; target.version = "latest"; diff --git a/ui/src/lib/cron-fires.ts b/ui/src/lib/cron-fires.ts index efaba78ebb2..dc0cb7400b3 100644 --- a/ui/src/lib/cron-fires.ts +++ b/ui/src/lib/cron-fires.ts @@ -198,8 +198,8 @@ export function nextCronFires( cursor.setUTCMinutes(cursor.getUTCMinutes() + 1); const fires: Date[] = []; - // Search window: 5 years of minutes is plenty and bounds impossible schedules. - const maxIterations = 5 * 366 * 24 * 60; + // Preview-only bound: cap sparse or impossible schedules before they can stall the UI. + const maxIterations = 2 * 366 * 24 * 60; for (let i = 0; i < maxIterations && fires.length < count; i++) { let parts: ZonedParts; try {