From c8d047905e7abd58e603f208b359b6d520feb016 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Fri, 20 Nov 2026 16:50:42 +0100 Subject: [PATCH] feat: give the chat's deploy confirmation a card of its own (#12571) * feat: give the chat's deploy confirmation a card with editable fields and a diff * fix: refuse a picked deploy path that is already taken * fix: show the folder default user a first deploy will run as * fix: close the run-as picker once a user is chosen * fix: let Escape stop a turn in a drawer and seed the card from the staged path Co-Authored-By: Claude Opus 5.5 * fix: read a raw app's staged path before canonicalizing its unsaved draft Co-Authored-By: Claude Opus 5.5 * chore: drop the deploy card dev page Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .../lib/components/OnBehalfOfSelector.svelte | 10 +- .../copilot/chat/AIChatDisplay.svelte | 13 + .../components/copilot/chat/DeployCard.svelte | 137 +++++++++ .../copilot/chat/DeployCardView.svelte | 281 ++++++++++++++++++ .../copilot/chat/DeployDiffButton.svelte | 67 +++++ .../chat/ToolConfirmationFooter.svelte | 14 +- .../copilot/chat/ToolExecutionDisplay.svelte | 8 + .../copilot/chat/deployCardFacts.ts | 40 +++ .../components/copilot/chat/global/core.ts | 67 ++++- .../copilot/chat/global/deployDiff.ts | 90 ++++++ .../copilot/chat/global/deployEdits.test.ts | 30 ++ .../copilot/chat/global/deployEdits.ts | 67 +++++ .../copilot/chat/global/diffSnapshot.ts | 9 +- frontend/src/lib/utils_draft_deploy.ts | 31 +- 14 files changed, 837 insertions(+), 27 deletions(-) create mode 100644 frontend/src/lib/components/copilot/chat/DeployCard.svelte create mode 100644 frontend/src/lib/components/copilot/chat/DeployCardView.svelte create mode 100644 frontend/src/lib/components/copilot/chat/DeployDiffButton.svelte create mode 100644 frontend/src/lib/components/copilot/chat/deployCardFacts.ts create mode 100644 frontend/src/lib/components/copilot/chat/global/deployDiff.ts create mode 100644 frontend/src/lib/components/copilot/chat/global/deployEdits.test.ts create mode 100644 frontend/src/lib/components/copilot/chat/global/deployEdits.ts diff --git a/frontend/src/lib/components/OnBehalfOfSelector.svelte b/frontend/src/lib/components/OnBehalfOfSelector.svelte index 127e21a9e2..3c903ad424 100644 --- a/frontend/src/lib/components/OnBehalfOfSelector.svelte +++ b/frontend/src/lib/components/OnBehalfOfSelector.svelte @@ -230,7 +230,10 @@ ? 'opacity-50 cursor-not-allowed' : ''}" disabled={!canPreserve} - onclick={() => onSelect('target')} + onclick={() => { + onSelect('target') + closePopover() + }} > {targetDisplayName} @@ -240,7 +243,10 @@ + + + {/if} + + {#if appAccess && workspace && targetPath} + + {/if} + + {#if identity && workspace} + runAs?.email, (v) => (picked = { email: v, permissionedAs: runAs?.permissionedAs }) + } + bind:permissionedAs={ + () => runAs?.permissionedAs, (v) => (picked = { email: runAs?.email, permissionedAs: v }) + } + savedEmail={identity.saved.email} + savedPermissionedAs={identity.saved.permissionedAs} + targetWorkspace={workspace} + {isNew} + folderDefault={identity.folderDefault} + hideDescription + /> + {/if} + + + + + toolCallId && setDeployEdits(toolCallId, edits())} + > + {#snippet leading()} + + {/snippet} + + + +{#if access} + +
+

+ Once deployed, {targetPath} is reachable through its path by: +

+ {#if access.note !== undefined} +

{access.note}

+ {:else} +
    + {#each access.rows as accessRow (accessRow.name)} +
  • + + {accessRow.name}{accessRow.name === me ? ' (you)' : ''} + + {accessRow.write ? 'Can edit' : 'Can view'} +
  • + {/each} +
+ {/if} +

+ Workspace admins reach everything. To share it with more people, use Share once it is + deployed. +

+
+
+{/if} diff --git a/frontend/src/lib/components/copilot/chat/DeployDiffButton.svelte b/frontend/src/lib/components/copilot/chat/DeployDiffButton.svelte new file mode 100644 index 0000000000..2f0663c583 --- /dev/null +++ b/frontend/src/lib/components/copilot/chat/DeployDiffButton.svelte @@ -0,0 +1,67 @@ + + + + + + +{#if diffDrawerModule.current} + {@const LoadedDiffDrawer = diffDrawerModule.current.default} + +{/if} diff --git a/frontend/src/lib/components/copilot/chat/ToolConfirmationFooter.svelte b/frontend/src/lib/components/copilot/chat/ToolConfirmationFooter.svelte index 5e3d4048dc..ca690f4763 100644 --- a/frontend/src/lib/components/copilot/chat/ToolConfirmationFooter.svelte +++ b/frontend/src/lib/components/copilot/chat/ToolConfirmationFooter.svelte @@ -1,5 +1,6 @@