diff --git a/tools/server/public/index.html.gz b/tools/server/public/index.html.gz index f68e50ef30..5e7326a584 100644 Binary files a/tools/server/public/index.html.gz and b/tools/server/public/index.html.gz differ diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte index b51dd682e0..95c3c5da1f 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte @@ -10,9 +10,9 @@ ModelsSelector, ModelsSelectorSheet } from '$lib/components/app'; - import { DialogChatSettings } from '$lib/components/app/dialogs'; import { SETTINGS_SECTION_TITLES } from '$lib/constants'; import { mcpStore } from '$lib/stores/mcp.svelte'; + import { getChatSettingsDialogContext } from '$lib/contexts'; import { FileTypeCategory } from '$lib/enums'; import { getFileTypeCategory } from '$lib/utils'; import { config } from '$lib/stores/settings.svelte'; @@ -169,7 +169,7 @@ selectorModelRef?.open(); } - let showChatSettingsDialogWithMcpSection = $state(false); + const chatSettingsDialog = getChatSettingsDialogContext(); let hasMcpPromptsSupport = $derived.by(() => { const perChatOverrides = conversationsStore.getAllMcpServerOverrides(); @@ -197,7 +197,7 @@ {onSystemPromptClick} {onMcpPromptClick} {onMcpResourcesClick} - onMcpSettingsClick={() => (showChatSettingsDialogWithMcpSection = true)} + onMcpSettingsClick={() => chatSettingsDialog.open(SETTINGS_SECTION_TITLES.MCP)} /> {:else} (showChatSettingsDialogWithMcpSection = true)} + onMcpSettingsClick={() => chatSettingsDialog.open(SETTINGS_SECTION_TITLES.MCP)} /> {/if} (showChatSettingsDialogWithMcpSection = true)} + onSettingsClick={() => chatSettingsDialog.open(SETTINGS_SECTION_TITLES.MCP)} /> @@ -265,9 +265,3 @@ /> {/if} - - (showChatSettingsDialogWithMcpSection = open)} - initialSection={SETTINGS_SECTION_TITLES.MCP} -/> diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte index 52a9355104..b48c71aec1 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte @@ -180,6 +180,10 @@ chatActions.continueAssistantMessage(message); } + function handleForkConversation(options: { name: string; includeAttachments: boolean }) { + chatActions.forkConversation(message, options); + } + function handleNavigateToSibling(siblingId: string) { chatActions.navigateToSibling(siblingId); } @@ -285,6 +289,7 @@ onCopy={handleCopy} onDelete={handleDelete} onEdit={handleEdit} + onForkConversation={handleForkConversation} onNavigateToSibling={handleNavigateToSibling} onShowDeleteDialogChange={handleShowDeleteDialogChange} {showDeleteDialog} @@ -303,6 +308,7 @@ onCopy={handleCopy} onDelete={handleDelete} onEdit={handleEdit} + onForkConversation={handleForkConversation} onNavigateToSibling={handleNavigateToSibling} onRegenerate={handleRegenerate} onShowDeleteDialogChange={handleShowDeleteDialogChange} diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageActions.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageActions.svelte index 97b34e92cc..fec1a506eb 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageActions.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageActions.svelte @@ -1,12 +1,16 @@
@@ -86,6 +109,10 @@ {/if} + {#if onForkConversation} + + {/if} +
@@ -116,3 +143,42 @@ onConfirm={handleConfirmDelete} onCancel={() => onShowDeleteDialogChange(false)} /> + + (showForkDialog = false)} +> +
+
+ + + +
+ +
+ { + forkIncludeAttachments = checked === true; + }} + /> + + +
+
+
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageAssistant.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageAssistant.svelte index 8b07b385fb..97aee03008 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageAssistant.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageAssistant.svelte @@ -39,6 +39,7 @@ onContinue?: () => void; onDelete: () => void; onEdit?: () => void; + onForkConversation?: (options: { name: string; includeAttachments: boolean }) => void; onNavigateToSibling?: (siblingId: string) => void; onRegenerate: (modelOverride?: string) => void; onShowDeleteDialogChange: (show: boolean) => void; @@ -58,6 +59,7 @@ onCopy, onDelete, onEdit, + onForkConversation, onNavigateToSibling, onRegenerate, onShowDeleteDialogChange, @@ -345,6 +347,7 @@ onContinue={currentConfig.enableContinueGeneration && !hasReasoningMarkers ? onContinue : undefined} + {onForkConversation} {onDelete} {onConfirmDelete} {onNavigateToSibling} diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageUser.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageUser.svelte index 9b9d9a3e99..f2f6288d68 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageUser.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageUser.svelte @@ -21,6 +21,7 @@ onEdit: () => void; onDelete: () => void; onConfirmDelete: () => void; + onForkConversation?: (options: { name: string; includeAttachments: boolean }) => void; onShowDeleteDialogChange: (show: boolean) => void; onNavigateToSibling?: (siblingId: string) => void; onCopy: () => void; @@ -35,6 +36,7 @@ onEdit, onDelete, onConfirmDelete, + onForkConversation, onShowDeleteDialogChange, onNavigateToSibling, onCopy @@ -114,6 +116,7 @@ {onCopy} {onDelete} {onEdit} + {onForkConversation} {onNavigateToSibling} {onShowDeleteDialogChange} {siblingInfo} diff --git a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessages.svelte b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessages.svelte index 439e8adb38..5ff53644ca 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessages.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessages.svelte @@ -79,6 +79,13 @@ onUserAction?.(); await chatStore.continueAssistantMessage(message.id); refreshAllMessages(); + }, + + forkConversation: async ( + message: DatabaseMessage, + options: { name: string; includeAttachments: boolean } + ) => { + await conversationsStore.forkConversation(message.id, options); } }); diff --git a/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreenHeader.svelte b/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreenHeader.svelte index 2730d5e738..0a920be6fa 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreenHeader.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreenHeader.svelte @@ -1,16 +1,11 @@
chatSettingsDialog.open()} class="rounded-full backdrop-blur-lg" >
- - (settingsOpen = open)} /> diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebar.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebar.svelte index 970394baa4..751406b3e3 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebar.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebar.svelte @@ -1,13 +1,18 @@ - +

llama.cpp

@@ -118,7 +147,7 @@
- + {#if (filteredConversations.length > 0 && isSearchModeActive) || !isSearchModeActive} {isSearchModeActive ? 'Search results' : 'Conversations'} @@ -127,15 +156,17 @@ - {#each filteredConversations as conversation (conversation.id)} - + {#each conversationTree as { conversation, depth } (conversation.id)} + {/each} - {#if filteredConversations.length === 0} + {#if conversationTree.length === 0}

{searchQuery.length > 0 @@ -177,35 +208,40 @@ showDeleteDialog = false; selectedConversation = null; }} -/> +> + {#if selectedConversationHasDescendants} +

+ - - - - Edit Conversation Name - - { - if (e.key === 'Enter') { - e.preventDefault(); - handleConfirmEdit(); - } - }} - placeholder="Enter a new name" - type="text" - bind:value={editedName} - /> - - - - { - showEditDialog = false; - selectedConversation = null; - }}>Cancel - Save - - - + +
+ {/if} + + + { + showEditDialog = false; + selectedConversation = null; + }} + onKeydown={(e) => { + if (e.key === 'Enter') { + e.preventDefault(); + e.stopImmediatePropagation(); + handleConfirmEdit(); + } + }} +> + + diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarActions.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarActions.svelte index 30d1f9d4b7..e0d379f6df 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarActions.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarActions.svelte @@ -3,6 +3,9 @@ import { KeyboardShortcutInfo } from '$lib/components/app'; import { Button } from '$lib/components/ui/button'; import { Input } from '$lib/components/ui/input'; + import { McpLogo } from '$lib/components/app'; + import { SETTINGS_SECTION_TITLES } from '$lib/constants'; + import { getChatSettingsDialogContext } from '$lib/contexts'; interface Props { handleMobileSidebarItemClick: () => void; @@ -18,6 +21,8 @@ let searchInput: HTMLInputElement | null = $state(null); + const chatSettingsDialog = getChatSettingsDialogContext(); + function handleSearchModeDeactivate() { isSearchModeActive = false; searchQuery = ''; @@ -30,7 +35,7 @@ }); -
+
{#if isSearchModeActive}
@@ -50,13 +55,14 @@
{:else} + + {/if}
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarConversationItem.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarConversationItem.svelte index 5c48909cd8..e22cb4f829 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarConversationItem.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarConversationItem.svelte @@ -1,13 +1,23 @@