diff --git a/frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.svelte index 203773d30b..ddf58cda89 100644 --- a/frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.svelte @@ -641,6 +641,8 @@ parentVersion = head if (deployedBaseline) deployedBaseline = { ...deployedBaseline, parent_version: head } draftBaseVersion = String(head) + // See /scripts/edit: the head this page knows moves with the base. + deployedHeadVersion = String(head) // Persisted explicitly, as the script and flow routes do: the reactive // bundle mirror is parked while auto-save is off, and a parked write is // dropped on pagehide, so the new base would not survive a reload. diff --git a/frontend/src/routes/(root)/(logged)/flows/edit/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/flows/edit/[...path]/+page.svelte index a97113fd12..0a7eb66067 100644 --- a/frontend/src/routes/(root)/(logged)/flows/edit/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/flows/edit/[...path]/+page.svelte @@ -558,6 +558,8 @@ if (!draftSync.draft || head == null || !$workspaceStore) return draftSync.draft = { ...draftSync.draft, version_id: head } draftBaseVersion = String(head) + // See /scripts/edit: the head this page knows moves with the base. + version = head await UserDraft.forcePersist('flow', flowDraftPath, { workspace: $workspaceStore }) } : undefined} diff --git a/frontend/src/routes/(root)/(logged)/scripts/edit/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/scripts/edit/[...path]/+page.svelte index 4757c11a21..e9baaa79aa 100644 --- a/frontend/src/routes/(root)/(logged)/scripts/edit/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/scripts/edit/[...path]/+page.svelte @@ -543,6 +543,9 @@ // compares equal and the autosave can discard it. if (deployedBaseline) deployedBaseline = { ...deployedBaseline, parent_hash: head } draftBaseHash = head + // The head this page knows moves with it, or the prompt reopens comparing + // the fresh base against the stale head, the two the wrong way round. + deployedHeadHash = head await UserDraft.forcePersist('script', draftPath, { workspace: $workspaceStore }) } : undefined}