nit closing flowgraph

This commit is contained in:
Ruben Fiszel
2024-10-13 01:30:01 +02:00
parent 288dfe7c70
commit 34c39ce0ab
3 changed files with 17 additions and 3 deletions
@@ -5,7 +5,7 @@
import { Wand2, Loader2 } from 'lucide-svelte'
import SearchItems from '../SearchItems.svelte'
import { emptyString } from '$lib/utils'
import { onMount } from 'svelte'
import { createEventDispatcher, onMount } from 'svelte'
export let funcDesc: string
export let trigger = false
@@ -17,6 +17,8 @@
export let filteredItems: (Script & { marked?: string })[] | (Item & { marked?: string })[] = []
$: prefilteredItems = scripts ?? []
const dispatch = createEventDispatcher()
async function loadScripts(): Promise<void> {
const loadedScripts = await ScriptService.listScripts({
workspace: $workspaceStore!,
@@ -53,6 +55,11 @@
<input
bind:this={input}
type="text"
on:keydown={(e) => {
if (e.key === 'Escape') {
dispatch('escape')
}
}}
bind:value={funcDesc}
placeholder="Search {trigger ? 'triggers' : 'scripts'} {disableAi ? '' : 'or AI gen'}"
/>
@@ -95,7 +95,14 @@ shouldUsePortal={true} -->
role="none"
>
<div class="flex flex-row items-center gap-2">
<StepGenQuick {disableAi} on:insert bind:funcDesc {preFilter} {loading} />
<StepGenQuick
on:escape={() => close(null)}
{disableAi}
on:insert
bind:funcDesc
{preFilter}
{loading}
/>
{#if selectedKind != 'preprocessor' && selectedKind != 'flow'}
<ToggleHubWorkspaceQuick bind:selected={preFilter} />
{/if}
@@ -267,7 +267,7 @@
{:else}
<SvelteFlow
on:paneclick={(e) => {
window.dispatchEvent(new Event('focus'))
document.dispatchEvent(new Event('focus'))
}}
{nodes}
{edges}