fix: the deploy-override diff takes an opening its editor can hand back

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-09-15 14:23:39 +02:00
co-authored by Claude Opus 5
parent 03ec3fde2f
commit 8a05c7a8aa
5 changed files with 26 additions and 12 deletions
@@ -1463,6 +1463,7 @@
{confirmCallback}
bind:open
{diffDrawer}
claimOpening={() => (lastOpening = diffDrawer?.beginOpening())}
bind:deployedValue
currentValue={flowStore.val}
/>
@@ -1247,6 +1247,7 @@
{confirmCallback}
bind:open
{diffDrawer}
claimOpening={() => (lastOpening = diffDrawer?.beginOpening())}
bind:deployedValue
currentValue={script}
/>
@@ -742,6 +742,7 @@
{confirmCallback}
bind:open
{diffDrawer}
claimOpening={() => (lastOpening = diffDrawer?.beginOpening())}
bind:deployedValue
currentValue={{
summary: $summary,
@@ -11,6 +11,11 @@
confirmCallback: () => void
deployedBy?: string | undefined
open?: boolean
/** Takes a drawer opening on the host editor's behalf, so the diff below is one the
* editor can take back down. Override anyway deploys that editor's content: without
* this the drawer would outlive it (a relocation remounts the editor) and deploy it
* at a path it has left. Omit where the host cannot be remounted under the drawer. */
claimOpening?: () => number | undefined
}
let {
@@ -19,7 +24,8 @@
diffDrawer = undefined,
confirmCallback,
deployedBy = undefined,
open = $bindable(false)
open = $bindable(false),
claimOpening = undefined
}: Props = $props()
</script>
@@ -44,17 +50,21 @@
return
}
open = false
diffDrawer?.openDrawer()
diffDrawer?.setDiff({
mode: 'simple',
original: deployedValue,
current: currentValue,
title: 'Deployed <> Current',
button: {
text: 'Override anyway',
onClick: () => confirmCallback()
}
})
const opening = claimOpening?.()
diffDrawer?.openDrawer(opening)
diffDrawer?.setDiff(
{
mode: 'simple',
original: deployedValue,
current: currentValue,
title: 'Deployed <> Current',
button: {
text: 'Override anyway',
onClick: () => confirmCallback()
}
},
opening
)
}}
>Show diff
</Button>
@@ -691,6 +691,7 @@
{confirmCallback}
bind:open
{diffDrawer}
claimOpening={() => (lastOpening = diffDrawer?.beginOpening())}
bind:deployedValue
currentValue={currentDiffValue}
/>