From a3cea5184f8261d0daa347d46df2b8c3a2ee47d1 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 14 Sep 2026 16:22:56 +0200 Subject: [PATCH] fix: look up a script's head at its row path, and show flow and app version ids bare Co-Authored-By: Claude Opus 5 (1M context) --- frontend/src/lib/components/ScriptBuilder.svelte | 5 ++++- .../common/confirmationModal/StaleDraftModal.svelte | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/ScriptBuilder.svelte b/frontend/src/lib/components/ScriptBuilder.svelte index c05a69d1d9..a26c0a8cc9 100644 --- a/frontend/src/lib/components/ScriptBuilder.svelte +++ b/frontend/src/lib/components/ScriptBuilder.svelte @@ -559,10 +559,13 @@ try { if (initialPath && initialPath != '') { + // The row's path, not `initialPath`: that is the typed path, where a + // staged rename has nothing deployed, and a missing head would deploy + // on a base that already has a child. actual_parent_hash = ( await ScriptService.getScriptLatestVersion({ workspace: opWorkspace!, - path: initialPath + path: userDraftPath || initialPath }) )?.script_hash } diff --git a/frontend/src/lib/components/common/confirmationModal/StaleDraftModal.svelte b/frontend/src/lib/components/common/confirmationModal/StaleDraftModal.svelte index bf1b3f4c0a..9f4939eb2b 100644 --- a/frontend/src/lib/components/common/confirmationModal/StaleDraftModal.svelte +++ b/frontend/src/lib/components/common/confirmationModal/StaleDraftModal.svelte @@ -58,7 +58,7 @@ // Scripts are versioned by hash, the other kinds by a numeric version id; // the diff picker renders them the same way. function formatVersion(v: string): string { - return itemKind === 'script' ? v.slice(0, 8) : `v${v}` + return itemKind === 'script' ? v.slice(0, 8) : v } async function loadLatestDeploy() {