diff --git a/frontend/src/lib/components/VariableEditor.svelte b/frontend/src/lib/components/VariableEditor.svelte index 163a37aabb..7b78bd2216 100644 --- a/frontend/src/lib/components/VariableEditor.svelte +++ b/frontend/src/lib/components/VariableEditor.svelte @@ -338,16 +338,16 @@ initialStates[ws] = s existedInitially[ws] = true } - // The just-saved state is the new deployed baseline; `settleDraftAfterWrite` - // resets the handle to it via `discard` (not `remove` — blanking the cell - // to `undefined` reads as dirty), and keeps an edit made mid-request. Each - // workspace settles against the path its own write used, not the reported one. if (ws === fromWs) actingCommitted = true // Per workspace, as each write lands. Each carries its own workspace and // the path it wrote there, so a linked workspace's rename moves the tabs // acting on it and no others — and a workspace written before a later one // threw is still reported, because it is deployed. onSaved?.(s.path, from, ws) + // The just-saved state is the new deployed baseline; this resets the handle + // to it via `discard` (not `remove` — blanking the cell to `undefined` reads + // as dirty) and keeps an edit made mid-request. Each workspace settles + // against the path its own write used, not the reported one. settleDraftAfterWrite('variable', s, states[ws]?.draft, from ?? '', s.path, { workspace: ws }) diff --git a/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte b/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte index a553480f51..25fa955259 100644 --- a/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte +++ b/frontend/src/lib/components/triggers/schedules/ScheduleEditorInner.svelte @@ -621,9 +621,17 @@ // `labels` alias live state, so an edit made while the request is in flight // would read back as part of what was sent. const scheduleCfg = $state.snapshot(getScheduleCfg()) as Record + const wasCreate = !edit deploymentLoading = true const isSaved = await saveScheduleFromCfg(scheduleCfg, edit, wsId!) if (isSaved) { + // A create deploys the schedule enabled whatever the form said (see + // saveScheduleFromCfg), so both the form and what counts as written adopt it + // — otherwise the baseline below records a state the server does not have. + if (wasCreate) { + enabled = true + scheduleCfg.enabled = true + } // What was sent is the deployed value now. Adopted here rather than by // remounting: the form stays editable during the write, and a remount would // re-read over an edit made then — which `settleDraftAfterWrite` keeps.