From 75e3e7ea419d1ec6c69280ba2ec4d82367263b10 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Tue, 27 Oct 2026 23:52:02 +0100 Subject: [PATCH] feat: confirm run-as on flow and script deploy, mute from editor menu (#12015) * refactor: harmonize flow and script settings layout Co-Authored-By: Claude Opus 5.5 (1M context) * fix: keep the priority input open while it is edited Co-Authored-By: Claude Opus 5.5 (1M context) * feat: confirm run-as on flow and script deploy, mute from editor menu Co-Authored-By: Claude Opus 5.5 (1M context) * fix: keep settings rows open while edited and name the deploying user for non-admins Co-Authored-By: Claude Opus 5.5 (1M context) * fix: reread the deployed run-as user after a deploy that keeps the editor open Co-Authored-By: Claude Opus 5.5 (1M context) * fix: write a setting before its row opens and show its real state while edited Co-Authored-By: Claude Opus 5.5 (1M context) * fix: slide settings rows open to their full height Co-Authored-By: Claude Opus 5.5 (1M context) * fix: send the popover's deployment message when Deploy is clicked Co-Authored-By: Claude Opus 5.5 (1M context) * fix: remount a settings row's fields when its toggle turns it on Co-Authored-By: Claude Opus 5.5 (1M context) * fix: send the popover's deployment message from Deploy & Stay here Co-Authored-By: Claude Opus 5.5 (1M context) * fix: clear the deployment message after a successful deploy Co-Authored-By: Claude Opus 5.5 (1M context) * fix: read the deployed row before muting from the menu, title Deploy only when icon-only Co-Authored-By: Claude Opus 5.5 (1M context) --------- Co-authored-by: Claude Opus 5.5 (1M context) --- .../src/lib/components/DeployButton.svelte | 35 +++- frontend/src/lib/components/Dev.svelte | 1 - .../src/lib/components/FlowBuilder.svelte | 126 +++++++++++-- .../src/lib/components/ScriptBuilder.svelte | 166 ++++++++++++----- .../components/details/deployedItem.svelte.ts | 65 +++++++ .../components/details/errorHandlerToggle.ts | 27 +++ .../flows/content/AgentEditorHost.svelte | 1 - .../flows/content/FlowSettings.svelte | 43 +---- frontend/src/lib/components/flows/types.ts | 1 - .../DeployOnBehalfOfDialog.svelte | 143 +++++++++++++++ .../MuteErrorHandlerSetting.svelte | 43 ----- .../itemSettings/RunOnBehalfOfSetting.svelte | 168 +++++++++++++----- .../itemSettings/onBehalfOf.test.ts | 56 ++++-- .../lib/components/itemSettings/onBehalfOf.ts | 54 ++++-- .../useFolderDefaultPermissionedAs.svelte.ts | 38 ++-- frontend/src/lib/utils_draft_deploy.test.ts | 34 ++++ frontend/src/lib/utils_draft_deploy.ts | 9 +- .../routes/(styled)/flows/dev/+page.svelte | 1 - 18 files changed, 750 insertions(+), 261 deletions(-) create mode 100644 frontend/src/lib/components/details/deployedItem.svelte.ts create mode 100644 frontend/src/lib/components/itemSettings/DeployOnBehalfOfDialog.svelte delete mode 100644 frontend/src/lib/components/itemSettings/MuteErrorHandlerSetting.svelte diff --git a/frontend/src/lib/components/DeployButton.svelte b/frontend/src/lib/components/DeployButton.svelte index da1ba5dd42..9547ebf389 100644 --- a/frontend/src/lib/components/DeployButton.svelte +++ b/frontend/src/lib/components/DeployButton.svelte @@ -3,19 +3,24 @@ import { Save, CornerDownLeft } from 'lucide-svelte' import { createEventDispatcher } from 'svelte' + type DropdownItem = { + label: string + /** Gets the message typed in the hover popover, for items that deploy. */ + onClick: (deploymentMsg: string) => void + } + const { loading = false, loadingSave = false, dropdownItems = [], - unifiedSize = 'md' + unifiedSize = 'md', + iconOnly = false }: { loading?: boolean loadingSave?: boolean - dropdownItems?: Array<{ - label: string - onClick: () => void - }> + dropdownItems?: DropdownItem[] | (() => DropdownItem[]) | undefined unifiedSize?: 'sm' | 'md' | 'lg' + iconOnly?: boolean } = $props() const dispatch = createEventDispatcher() @@ -24,6 +29,20 @@ let hideDropdown = $state(false) let deploymentMsg = $state('') let dropdownOpen = $state(false) + + /** Call after a successful deploy: the next deploy from the same editor would store it again. */ + export function clearMessage() { + deploymentMsg = '' + } + + function withMessage(items: DropdownItem[]) { + return items.map((item) => ({ ...item, onClick: () => item.onClick(deploymentMsg) })) + } + let items = $derived( + typeof dropdownItems === 'function' + ? () => withMessage(dropdownItems()) + : dropdownItems && withMessage(dropdownItems) + )