diff --git a/src/lib/components/chat/MessageInput/InputMenu.svelte b/src/lib/components/chat/MessageInput/InputMenu.svelte index b15bf49588..c72d0048bb 100644 --- a/src/lib/components/chat/MessageInput/InputMenu.svelte +++ b/src/lib/components/chat/MessageInput/InputMenu.svelte @@ -74,6 +74,9 @@ 'directory' ].includes(tab); + $: showImageCapture = visionCapableModels.length > 0 && $visibleControls['chat.capture']; + $: showCapture = showImageCapture || !!recordActions; + let showAttachWebpageModal = false; $: showAddContext = $visibleControls['chat.attach_webpage'] || @@ -268,7 +271,55 @@ - {#if visionCapableModels.length > 0 && $visibleControls['chat.capture']} + {#if showCapture} + + {/if} + + {#if showAddContext} + + {/if} + + {:else if tab === 'capture' && showCapture} +
+ + + {#if showImageCapture} - -
{$i18n.t('Capture')}
+ +
+ {detectMobile() ? $i18n.t('Camera') : $i18n.t('Screenshot')} +
{/if} {#if recordActions} - + + + {#each [{ label: 'Record', icon: Mic, action: recordActions.record }, { label: 'Capture Audio', icon: CursorArrowRays, action: recordActions.captureAudio }] as item} + + {/each} {/if} - - {#if showAddContext} - - {/if} -
- {:else if tab === 'record' && recordActions} -
- - - - - {#each [{ label: 'Record', icon: Mic, action: recordActions.record }, { label: 'Capture Audio', icon: CursorArrowRays, action: recordActions.captureAudio }] as item} - - {/each}
{:else if tab === 'attachments'}
diff --git a/src/lib/components/comments/CommentsDropdown.svelte b/src/lib/components/comments/CommentsDropdown.svelte new file mode 100644 index 0000000000..95be8abd2d --- /dev/null +++ b/src/lib/components/comments/CommentsDropdown.svelte @@ -0,0 +1,81 @@ + + +{#if enabled} + { + if (!state) { + if (open) view = null; + } else if (!open) view = { ...resource }; + }} + > + (view = open ? null : request)} + /> +
+ {#if open && view} + {#key `${$user?.id}:${resource.resource_type}:${resource.resource_id}:${view.comment_id ?? ''}`} + (view = null)} /> + {/key} + {/if} +
+
+{/if} diff --git a/src/lib/components/workspace/Knowledge.svelte b/src/lib/components/workspace/Knowledge.svelte index f0d426cd9e..d99aa044a6 100644 --- a/src/lib/components/workspace/Knowledge.svelte +++ b/src/lib/components/workspace/Knowledge.svelte @@ -3,10 +3,9 @@ import { getPageContext } from '$lib/utils/page'; const { goto } = getPageContext(); - import Comments from '$lib/components/comments/Comments.svelte'; + import CommentsDropdown from '$lib/components/comments/CommentsDropdown.svelte'; import type { CommentsRequest } from '$lib/components/comments/CommentsPanel.svelte'; let comments: CommentsRequest | null = null; - import CommentButton from '$lib/components/comments/CommentButton.svelte'; import WorkspaceAccessModal from './common/WorkspaceAccessModal.svelte'; let accessModal: WorkspaceAccessModal; import dayjs from 'dayjs'; @@ -318,299 +317,293 @@

{$i18n.t('Knowledge')}

- - {#if loaded && items !== null && total !== null} - { - deleteHandler(selectedItem); +{#if loaded && items !== null && total !== null} + { + deleteHandler(selectedItem); + }} + /> + + + { + closeCreateModal(); }} /> + - - { - closeCreateModal(); - }} - /> - - -
-
-
-
- -
- - {#if query} -
- -
- {/if} +
+
+
+
+
- -
{ - if (e.deltaY !== 0) { - e.preventDefault(); - e.currentTarget.scrollLeft += e.deltaY; - } - }} - > -
- { - localStorage.workspaceViewOption = value; - - await tick(); + + {#if query} +
+
-
+ {/if}
- {#if items !== null && total !== null} - {#if (items ?? []).length !== 0} -
-
{ + if (e.deltaY !== 0) { + e.preventDefault(); + e.currentTarget.scrollLeft += e.deltaY; + } + }} + > +
+ { + localStorage.workspaceViewOption = value; + + await tick(); + }} + /> + + { + localStorage.workspaceKnowledgeSourceOption = sourceOption; + await tick(); + }} + /> +
+
+
+ + {#if items !== null && total !== null} + {#if (items ?? []).length !== 0} +
+
+ + {/if} + -
{$i18n.t('Owner')}
+
{$i18n.t('Owner')}
- - {$i18n.t('Actions')} -
+ {/if} + + {$i18n.t('Actions')} +
-
- {#each items as item} - {@const metaPreview = getKnowledgeMetaPreview(item)} -