From e3c0f532ffe2e7c47ff1fd5832e2840f3e25f9e2 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Sun, 6 Sep 2026 16:08:36 +0200 Subject: [PATCH] fix(schedules): record the deployed enabled state however the editor opened MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reading sat inside the branch that captures a baseline, so a schedule opened with a config handed in — the trigger panel of a script or flow — never took one, and a save there settled against whatever the last open had left. Both ways in hold the deployed state on the form at that point, which is what the reading is about. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01KcyBRxE8j3ujCYkum9KrC4 --- .../triggers/schedules/ScheduleEditorInner.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte b/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte index e38255439a..e1814d67bb 100644 --- a/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte +++ b/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte @@ -198,12 +198,12 @@ draftOnly = noDeployed if (!defaultCfg) { // Form holds DEPLOYED here; capture it as `initialConfig` so the - // dirty check / banner fires whenever a saved draft exists. This is also - // the only point where the deployed `enabled` is on the form — the draft - // overlay below can carry one of its own, which the server has not taken. + // dirty check / banner fires whenever a saved draft exists. initialConfig = structuredClone($state.snapshot(getScheduleCfg())) - deployedEnabled = enabled } + // Whichever way this opened, the form holds the deployed state until the + // overlay below — which can carry an `enabled` the server has not taken. + deployedEnabled = enabled if (draftOverlay) await loadScheduleCfg(draftOverlay) await draftSync.maybeRestore() } finally {