diff --git a/frontend/src/lib/components/FlowPreviewContent.svelte b/frontend/src/lib/components/FlowPreviewContent.svelte index e9cba15af9..99c180d0a6 100644 --- a/frontend/src/lib/components/FlowPreviewContent.svelte +++ b/frontend/src/lib/components/FlowPreviewContent.svelte @@ -52,6 +52,7 @@ flowStore, pathStore, initialPathStore, + fakeInitialPath, customUi, executionCount } = getContext('FlowEditorContext') @@ -373,7 +374,8 @@
{ dispatch('select', { payload: e.detail, type: 'captures' }) }} diff --git a/frontend/src/lib/components/ScriptBuilder.svelte b/frontend/src/lib/components/ScriptBuilder.svelte index 1dcf21bbdc..93f40cc104 100644 --- a/frontend/src/lib/components/ScriptBuilder.svelte +++ b/frontend/src/lib/components/ScriptBuilder.svelte @@ -109,9 +109,9 @@ } // used for new scripts for captures - let fakeInitialPath = + const fakeInitialPath = 'u/' + - ($userStore?.username?.includes('@') + ($userStore!.username?.includes('@') ? $userStore!.username.split('@')[0].replace(/[^a-zA-Z0-9_]/g, '') : $userStore!.username!) + '/' + @@ -1625,6 +1625,7 @@ bind:this={scriptEditor} bind:schema={script.schema} path={script.path} + stablePathForCaptures={initialPath || fakeInitialPath} bind:code={script.content} lang={script.language} {initialArgs} diff --git a/frontend/src/lib/components/ScriptEditor.svelte b/frontend/src/lib/components/ScriptEditor.svelte index 2dacb88b8f..a7ab798684 100644 --- a/frontend/src/lib/components/ScriptEditor.svelte +++ b/frontend/src/lib/components/ScriptEditor.svelte @@ -56,6 +56,8 @@ export let selectedTab: 'main' | 'preprocessor' = 'main' export let hasPreprocessor = false export let captureTable: CaptureTable | undefined = undefined + export let showCaptures: boolean = true + export let stablePathForCaptures: string = '' let jobProgressReset: () => void @@ -64,7 +66,7 @@ deno: false, go: false, ruff: false, - shellcheck: false, + shellcheck: false } const dispatch = createEventDispatcher() @@ -495,7 +497,7 @@ {editor} {diffEditor} {args} - showCaptures={true} + {showCaptures} customUi={customUi?.previewPanel} > {#if scriptProgress} @@ -514,7 +516,7 @@ {hasPreprocessor} canHavePreprocessor={lang === 'bun' || lang === 'deno' || lang === 'python3'} isFlow={false} - path={path ?? ''} + path={stablePathForCaptures} canEdit={true} on:applyArgs on:updateSchema diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte index a4a15ec34c..6b59a972c2 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte @@ -27,6 +27,7 @@ > {#if inlineScript && inlineScript.language != 'frontend'} ('FlowEditorContext') + const { + flowStore, + previewArgs, + pathStore, + initialPathStore, + fakeInitialPath, + flowInputEditorState + } = getContext('FlowEditorContext') let addProperty: AddPropertyV2 | undefined = undefined let previewSchema: Record | undefined = undefined @@ -505,7 +511,7 @@
{ updatePreviewSchemaAndArgs(e.detail ?? undefined) }} diff --git a/frontend/src/lib/components/flows/content/ScriptEditorDrawer.svelte b/frontend/src/lib/components/flows/content/ScriptEditorDrawer.svelte index fc436571d1..ff61d83618 100644 --- a/frontend/src/lib/components/flows/content/ScriptEditorDrawer.svelte +++ b/frontend/src/lib/components/flows/content/ScriptEditorDrawer.svelte @@ -129,7 +129,6 @@ } - { saveScript() }} diff --git a/frontend/src/lib/components/triggers/CaptureButton.svelte b/frontend/src/lib/components/triggers/CaptureButton.svelte index 3925c916ab..bfa34cf908 100644 --- a/frontend/src/lib/components/triggers/CaptureButton.svelte +++ b/frontend/src/lib/components/triggers/CaptureButton.svelte @@ -94,7 +94,7 @@ {:else}