+
- {title}
-
{#if tag}
+
+ {emptyString(summary) ? (path ?? '') : summary}
+
+ {#if !emptyString(summary)}
+
{path}
+ {/if}
+
+ {#if tag}
tag: {tag}
{/if}
{@render children?.()}
diff --git a/frontend/src/lib/components/details/DetailPageLayout.svelte b/frontend/src/lib/components/details/DetailPageLayout.svelte
index f7a76c282e..c73e76b9f5 100644
--- a/frontend/src/lib/components/details/DetailPageLayout.svelte
+++ b/frontend/src/lib/components/details/DetailPageLayout.svelte
@@ -16,6 +16,7 @@
save_inputs?: import('svelte').Snippet
flow_step?: import('svelte').Snippet
triggers?: import('svelte').Snippet
+ flow_graph?: import('svelte').Snippet
}
let {
@@ -29,7 +30,8 @@
scriptRender: script,
save_inputs,
flow_step,
- triggers
+ triggers,
+ flow_graph
}: Props = $props()
let mobileTab: 'form' | 'detail' = $state('form')
@@ -40,6 +42,7 @@
const save_inputs_render = $derived(save_inputs)
const flow_step_render = $derived(flow_step)
const triggers_render = $derived(triggers)
+ const flow_graph_render = $derived(flow_graph)
const useDesktopLayout = $derived(clientWidth >= 768 && !forceSmallScreen)
@@ -81,6 +84,9 @@
{#if !isChatMode}
{/if}
+ {#if isChatMode && flow_json}
+
+ {/if}
{#if !isOperator}
{/if}
@@ -102,6 +108,11 @@
{@render triggers?.()}
+ {#if isChatMode && flow_json}
+
+ {@render flow_graph_render?.()}
+
+ {/if}
{#if flow_json}
diff --git a/frontend/src/lib/components/graph/FlowGraphV2.svelte b/frontend/src/lib/components/graph/FlowGraphV2.svelte
index 292ab58dc5..d57aab0b65 100644
--- a/frontend/src/lib/components/graph/FlowGraphV2.svelte
+++ b/frontend/src/lib/components/graph/FlowGraphV2.svelte
@@ -256,7 +256,6 @@
// Function to calculate extra gap needed for notes below the lowest flow nodes
function calculateNoteGap(notes: FlowNote[] | undefined): number {
- console.log('calculateNoteGap', notes)
if (!notes || notes.length === 0) {
return 0
}
@@ -650,6 +649,10 @@
]
await tick()
+ updateHeight()
+ }
+
+ function updateHeight() {
if (nodes.length === 0) {
height = minHeight
} else {
@@ -659,6 +662,11 @@
}
}
+ $effect(() => {
+ minHeight
+ untrack(() => updateHeight())
+ })
+
const nodeTypes = {
input2: InputNode,
module: ModuleNode,
diff --git a/frontend/src/routes/(root)/(logged)/flows/get/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/flows/get/[...path]/+page.svelte
index 59a6a963c7..074016e696 100644
--- a/frontend/src/routes/(root)/(logged)/flows/get/[...path]/+page.svelte
+++ b/frontend/src/routes/(root)/(logged)/flows/get/[...path]/+page.svelte
@@ -64,6 +64,7 @@
} from '$lib/components/flows/FlowAssetsHandler.svelte'
import { page } from '$app/state'
import FlowChat from '$lib/components/flows/conversations/FlowChat.svelte'
+ import { slide } from 'svelte/transition'
let flow: Flow | undefined = $state()
let can_write = false
@@ -202,7 +203,11 @@
}
}
- async function runFlowForChat(userMessage: string, conversationId: string, additionalInputs?: Record): Promise {
+ async function runFlowForChat(
+ userMessage: string,
+ conversationId: string,
+ additionalInputs?: Record
+ ): Promise {
const run = await JobService.runFlowByPath({
workspace: $workspaceStore!,
path,
@@ -400,6 +405,16 @@
let flowHistory: FlowHistory | undefined = $state(undefined)
let path = $derived(page.params.path ?? '')
+ let topSectionHeight = $state(0)
+ let paneHeight = $state(0)
+ let flowGraphHeight = $state(0)
+
+ let graphMinHeight = $derived.by(() => {
+ if (!topSectionHeight || !paneHeight) return 400
+ const availableHeight = paneHeight - topSectionHeight - 1 // Account for the separator between the top section and the graph
+ return Math.max(400, availableHeight)
+ })
+
$effect(() => {
const cliTrigger = triggersState.triggers.find((t) => t.type === 'cli')
if (cliTrigger) {
@@ -466,7 +481,6 @@
}}
{mainButtons}
menuItems={getMenuItems(flow, deployUiSettings)}
- title={defaultIfEmptyString(flow?.summary, flow?.path ?? '')}
bind:errorHandlerMuted={
() => flow?.ws_error_handler_muted ?? false,
(v) => {
@@ -476,6 +490,8 @@
scriptOrFlowPath={flow?.path ?? ''}
errorHandlerKind="flow"
tag={flow?.tag ?? ''}
+ summary={flow?.summary}
+ path={flow?.path}
>
{#snippet trigger_badges()}
@@ -523,41 +539,47 @@
{/snippet}
{#snippet form()}
{#if flow}
-
+
{#if !chatInputEnabled}
-
+
{
if (e.detail) {
stepDetail = e.detail
@@ -652,6 +678,7 @@
on:triggerDetail={(e) => {
rightPaneSelected = 'triggers'
}}
+ noBorder={true}
/>
{/if}
@@ -701,6 +728,33 @@
/>
{/if}
{/snippet}
+
+ {#snippet flow_graph()}
+ {#if flow}
+
+ {
+ if (e.detail) {
+ stepDetail = e.detail
+ rightPaneSelected = 'flow_step'
+ } else {
+ stepDetail = undefined
+ rightPaneSelected = 'saved_inputs'
+ }
+ }}
+ on:triggerDetail={(e) => {
+ rightPaneSelected = 'triggers'
+ }}
+ />
+
+ {/if}
+ {/snippet}
script?.ws_error_handler_muted ?? false,
(v) => {
@@ -580,6 +580,8 @@
on:seeTriggers={() => {
rightPaneSelected = 'triggers'
}}
+ summary={script?.summary}
+ path={script?.path}
>
{#snippet trigger_badges()}
{#if script.lock_error_logs}
-
-
Error deploying this script
+
This script has not been deployed successfully because of the following
errors:
-
+
{/if}
{#if topHash}
@@ -671,57 +669,70 @@
This path was archived
{/if}
{#if script.deleted}
-
-
Deleted
+
The content of this script was deleted (by an admin, no less)
-
+
{/if}
{/if}
{#if !emptyString(script.description)}
-
+
+
+
+
{/if}
{#if deploymentInProgress}
-
-
- Deployment in progress
- {#if deploymentJobId}
- view job
- {/if}
-
+
+
+
+ Deployment in progress
+ {#if deploymentJobId}
+ view job
+ {/if}
+
+
{/if}
-
- {
- savedInputsV2?.resetSelected()
- }}
- {inputSelected}
- />
- {
- runForm?.setCode(JSON.stringify(args ?? {}, null, '\t'))
- }}
- />
-
+ {#if (script.schema && Object.keys(script.schema.properties ?? {}).length > 0) || inputSelected}
+ {@const hasSchema =
+ script.schema && Object.keys(script.schema.properties ?? {}).length > 0}
+
+ {
+ savedInputsV2?.resetSelected()
+ }}
+ {inputSelected}
+ />
+ {#if hasSchema}
+ {
+ runForm?.setCode(JSON.stringify(args ?? {}, null, '\t'))
+ }}
+ />
+ {/if}
+
+ {/if}
{#if script?.schema?.prompt_for_ai !== undefined}
-
- {#if !emptyString(script.summary)}
-
- {script.path}
-
- {/if}
-
+
Edited by {script.created_by || 'unknown'}
-
- {truncateHash(script?.hash ?? '')}
-
- {#if script?.is_template}
-
Template
- {/if}
- {#if script && script.kind !== 'script'}
-
- {script?.kind}
+
+
+ {truncateHash(script?.hash ?? '')}
- {/if}
+ {#if script?.is_template}
+ Template
+ {/if}
+ {#if script && script.kind !== 'script'}
+
+ {script?.kind}
+
+ {/if}
-
+
+
{/if}