diff --git a/src/lib/components/workspace/Knowledge/Collection.svelte b/src/lib/components/workspace/Knowledge/Collection.svelte index ea93e8b38..bbc03f051 100644 --- a/src/lib/components/workspace/Knowledge/Collection.svelte +++ b/src/lib/components/workspace/Knowledge/Collection.svelte @@ -38,8 +38,17 @@ let knowledge: Knowledge | null = null; let query = ''; + let selectedFile = null; let selectedFileId = null; + $: if (selectedFileId) { + const file = knowledge.files.find((file) => file.id === selectedFileId); + if (file) { + file.data = file.data ?? { content: '' }; + selectedFile = file; + } + } + let debounceTimeout = null; let mediaQuery; let dragged = false; @@ -271,7 +280,7 @@
{ changeDebounceHandler(); @@ -321,7 +330,16 @@ {#if (knowledge?.files ?? []).length > 0}
- + { + selectedFileId = e.detail; + }} + on:delete={(e) => { + console.log(e.detail); + }} + />
{:else}
No content found
@@ -331,9 +349,23 @@
{#if largeScreen} -
- {#if selectedFileId} -