From: Aleksander Grygier Date: Thu, 20 Nov 2025 13:07:31 +0000 (+0100) Subject: Improved file naming & structure for UI components (#17405) X-Git-Tag: upstream/0.0.7446~327 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=4c91f2633f29a51ac2dcaa1c462483ea0ef6de8a;p=pkg%2Fggml%2Fsources%2Fllama.cpp Improved file naming & structure for UI components (#17405) * refactor: Component iles naming & structure * chore: update webui build output * refactor: Dialog titles + components namig * chore: update webui build output * refactor: Imports * chore: update webui build output --- diff --git a/tools/server/public/index.html.gz b/tools/server/public/index.html.gz index 5ee68ece..097c9440 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/ChatAttachments/ChatAttachmentFilePreview.svelte b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentFilePreview.svelte deleted file mode 100644 index 46f0d000..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentFilePreview.svelte +++ /dev/null @@ -1,129 +0,0 @@ - - -{#if type === MimeTypeText.PLAIN || type === FileTypeCategory.TEXT} - {#if readonly} - - - {:else} - - - {/if} -{:else} - -{/if} diff --git a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentImagePreview.svelte b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentImagePreview.svelte deleted file mode 100644 index da9ceb63..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentImagePreview.svelte +++ /dev/null @@ -1,62 +0,0 @@ - - -
- {#if onClick} - - {:else} - {name} - {/if} - - {#if !readonly} -
- -
- {/if} -
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentPreview.svelte b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentPreview.svelte new file mode 100644 index 00000000..212b1fe8 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentPreview.svelte @@ -0,0 +1,273 @@ + + +
+
+ {#if isPdf} +
+ + + +
+ {/if} +
+ +
+ {#if isImage && displayPreview} +
+ {displayName} +
+ {:else if isPdf && pdfViewMode === 'pages'} + {#if pdfImagesLoading} +
+
+
+ +

Converting PDF to images...

+
+
+ {:else if pdfImagesError} +
+
+ + +

Failed to load PDF images

+ +

{pdfImagesError}

+ + +
+
+ {:else if pdfImages.length > 0} +
+ {#each pdfImages as image, index (image)} +
+

Page {index + 1}

+ + PDF Page {index + 1} +
+ {/each} +
+ {:else} +
+
+ + +

No PDF pages available

+
+
+ {/if} + {:else if (isText || (isPdf && pdfViewMode === 'text')) && displayTextContent} +
+ {displayTextContent} +
+ {:else if isAudio} +
+
+ + + {#if attachment?.type === 'audioFile'} + + {:else if uploadedFile?.preview} + + {:else} +

Audio preview not available

+ {/if} + +

+ {displayName} +

+
+
+ {:else} +
+
+ {#if IconComponent} + + {/if} + +

Preview not available for this file type

+
+
+ {/if} +
+
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentPreviewDialog.svelte b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentPreviewDialog.svelte deleted file mode 100644 index 8a3389b6..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentPreviewDialog.svelte +++ /dev/null @@ -1,314 +0,0 @@ - - - - - -
-
- {#if IconComponent} - - {/if} - -
- {displayName} - -
- {displayType} - - {#if displaySize} - • - - {formatFileSize(displaySize)} - {/if} -
-
-
- - {#if isPdf} -
- - - -
- {/if} -
-
- -
- {#if isImage && displayPreview} -
- {displayName} -
- {:else if isPdf && pdfViewMode === 'pages'} - {#if pdfImagesLoading} -
-
-
- -

Converting PDF to images...

-
-
- {:else if pdfImagesError} -
-
- - -

Failed to load PDF images

- -

{pdfImagesError}

- - -
-
- {:else if pdfImages.length > 0} -
- {#each pdfImages as image, index (image)} -
-

Page {index + 1}

- - PDF Page {index + 1} -
- {/each} -
- {:else} -
-
- - -

No PDF pages available

-
-
- {/if} - {:else if (isText || (isPdf && pdfViewMode === 'text')) && displayTextContent} -
- {displayTextContent} -
- {:else if isAudio} -
-
- - - {#if attachment?.type === 'audioFile'} - - {:else if uploadedFile?.preview} - - {:else} -

Audio preview not available

- {/if} - -

- {displayName} -

-
-
- {:else} -
-
- {#if IconComponent} - - {/if} - -

Preview not available for this file type

-
-
- {/if} -
-
-
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailFile.svelte b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailFile.svelte new file mode 100644 index 00000000..46f0d000 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailFile.svelte @@ -0,0 +1,129 @@ + + +{#if type === MimeTypeText.PLAIN || type === FileTypeCategory.TEXT} + {#if readonly} + + + {:else} + + + {/if} +{:else} + +{/if} diff --git a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailImage.svelte b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailImage.svelte new file mode 100644 index 00000000..da9ceb63 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentThumbnailImage.svelte @@ -0,0 +1,62 @@ + + +
+ {#if onClick} + + {:else} + {name} + {/if} + + {#if !readonly} +
+ +
+ {/if} +
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentsList.svelte b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentsList.svelte index a2aea023..050c7933 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentsList.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentsList.svelte @@ -1,11 +1,10 @@ + +
+
+ {#if fileItems.length > 0} +
+

Files ({fileItems.length})

+
+ {#each fileItems as item (item.id)} + openPreview(item, event)} + /> + {/each} +
+
+ {/if} + + {#if imageItems.length > 0} +
+

Images ({imageItems.length})

+
+ {#each imageItems as item (item.id)} + {#if item.preview} + openPreview(item, event)} + /> + {/if} + {/each} +
+
+ {/if} +
+
+ +{#if previewItem} + +{/if} diff --git a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentsViewAllDialog.svelte b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentsViewAllDialog.svelte deleted file mode 100644 index a56e2654..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentsViewAllDialog.svelte +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - All Attachments ({displayItems.length}) - - View and manage all attached files - - - -
- {#if fileItems.length > 0} -
-

Files ({fileItems.length})

-
- {#each fileItems as item (item.id)} - openPreview(item, event)} - /> - {/each} -
-
- {/if} - - {#if imageItems.length > 0} -
-

Images ({imageItems.length})

-
- {#each imageItems as item (item.id)} - {#if item.preview} - openPreview(item, event)} - /> - {/if} - {/each} -
-
- {/if} -
-
-
-
- -{#if previewItem} - -{/if} diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActionFileAttachments.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActionFileAttachments.svelte deleted file mode 100644 index 71cb88e8..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActionFileAttachments.svelte +++ /dev/null @@ -1,121 +0,0 @@ - - -
- - - - - - - - -

{fileUploadTooltipText}

-
-
-
- - - - - handleFileUpload(FileTypeCategory.IMAGE)} - > - - - Images - - - - {#if !supportsVision()} - -

Images require vision models to be processed

-
- {/if} -
- - - - handleFileUpload(FileTypeCategory.AUDIO)} - > - - - Audio Files - - - - {#if !supportsAudio()} - -

Audio files require audio models to be processed

-
- {/if} -
- - handleFileUpload(FileTypeCategory.TEXT)} - > - - - Text Files - - - - - handleFileUpload(FileTypeCategory.PDF)} - > - - - PDF Files - - - - {#if !supportsVision()} - -

PDFs will be converted to text. Image-based PDFs may not work properly.

-
- {/if} -
-
-
-
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActionRecord.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActionRecord.svelte deleted file mode 100644 index d08a6972..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActionRecord.svelte +++ /dev/null @@ -1,49 +0,0 @@ - - -
- - - - - - {#if !supportsAudio()} - -

Current model does not support audio

-
- {/if} -
-
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions.svelte deleted file mode 100644 index ef03f73f..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions.svelte +++ /dev/null @@ -1,63 +0,0 @@ - - -
- - - {#if currentConfig.modelSelectorEnabled} - - {/if} - - {#if isLoading} - - {:else} - - - - {/if} -
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionFileAttachments.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionFileAttachments.svelte new file mode 100644 index 00000000..71cb88e8 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionFileAttachments.svelte @@ -0,0 +1,121 @@ + + +
+ + + + + + + + +

{fileUploadTooltipText}

+
+
+
+ + + + + handleFileUpload(FileTypeCategory.IMAGE)} + > + + + Images + + + + {#if !supportsVision()} + +

Images require vision models to be processed

+
+ {/if} +
+ + + + handleFileUpload(FileTypeCategory.AUDIO)} + > + + + Audio Files + + + + {#if !supportsAudio()} + +

Audio files require audio models to be processed

+
+ {/if} +
+ + handleFileUpload(FileTypeCategory.TEXT)} + > + + + Text Files + + + + + handleFileUpload(FileTypeCategory.PDF)} + > + + + PDF Files + + + + {#if !supportsVision()} + +

PDFs will be converted to text. Image-based PDFs may not work properly.

+
+ {/if} +
+
+
+
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionRecord.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionRecord.svelte new file mode 100644 index 00000000..d08a6972 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionRecord.svelte @@ -0,0 +1,49 @@ + + +
+ + + + + + {#if !supportsAudio()} + +

Current model does not support audio

+
+ {/if} +
+
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 new file mode 100644 index 00000000..aa500423 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte @@ -0,0 +1,65 @@ + + +
+ + + {#if currentConfig.modelSelectorEnabled} + + {/if} + + {#if isLoading} + + {:else} + + + + {/if} +
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 d37d8065..ff335c32 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,7 +1,10 @@ - -
-
- {#each processingDetails as detail (detail)} - {detail} - {/each} -
-
- - diff --git a/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte b/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte index 0c754faa..e891f7ef 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte @@ -5,13 +5,13 @@ ChatScreenHeader, ChatScreenWarning, ChatMessages, - ChatProcessingInfo, - EmptyFileAlertDialog, - ChatErrorDialog, + ChatScreenProcessingInfo, + DialogEmptyFileAlert, + DialogChatError, ServerErrorSplash, ServerInfo, ServerLoadingSplash, - ConfirmationDialog + DialogConfirmation } from '$lib/components/app'; import * as AlertDialog from '$lib/components/ui/alert-dialog'; import { @@ -299,7 +299,7 @@ class="pointer-events-none sticky right-0 bottom-0 left-0 mt-auto" in:slide={{ duration: 150, axis: 'y' }} > - + {#if serverWarning()} @@ -432,7 +432,7 @@ - (showDeleteDialog = false)} /> - { @@ -454,7 +454,7 @@ }} /> - import { Settings } from '@lucide/svelte'; - import { ChatSettingsDialog } from '$lib/components/app'; + import { DialogChatSettings } from '$lib/components/app'; import { Button } from '$lib/components/ui/button'; let settingsOpen = $state(false); @@ -20,4 +20,4 @@ - (settingsOpen = open)} /> + (settingsOpen = open)} /> diff --git a/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreenProcessingInfo.svelte b/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreenProcessingInfo.svelte new file mode 100644 index 00000000..ecab2321 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreenProcessingInfo.svelte @@ -0,0 +1,136 @@ + + +
+
+ {#each processingDetails as detail (detail)} + {detail} + {/each} +
+
+ + diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettings.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettings.svelte new file mode 100644 index 00000000..d00ae128 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettings.svelte @@ -0,0 +1,493 @@ + + +
+ + + + +
+
+ +
+ + +
+
+ {#each settingSections as section (section.title)} + + {/each} +
+
+ + +
+
+
+ + +
+
+ + + {#if currentSection.title === 'Import/Export'} + + {:else} +
+ +
+ {/if} +
+ +
+

Settings are saved in browser's localStorage

+
+
+
+
+ + diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsDialog.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsDialog.svelte deleted file mode 100644 index 6734fc06..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsDialog.svelte +++ /dev/null @@ -1,518 +0,0 @@ - - - - -
- - - - -
-
- Settings - - -
- - -
-
- {#each settingSections as section (section.title)} - - {/each} -
-
- - -
-
-
- - -
-
- - - {#if currentSection.title === 'Import/Export'} - - {:else} -
- -
- {/if} -
- -
-

- Settings are saved in browser's localStorage -

-
-
-
-
- - -
-
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsFields.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsFields.svelte index 992075e9..8834e3e3 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsFields.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsFields.svelte @@ -9,7 +9,7 @@ import { supportsVision } from '$lib/stores/server.svelte'; import { getParameterInfo, resetParameterToServerDefault } from '$lib/stores/settings.svelte'; import { ParameterSyncService } from '$lib/services/parameter-sync'; - import ParameterSourceIndicator from './ParameterSourceIndicator.svelte'; + import { ChatSettingsParameterSourceIndicator } from '$lib/components/app'; import type { Component } from 'svelte'; interface Props { @@ -63,7 +63,7 @@ {/if} {#if isCustomRealTime} - + {/if} @@ -145,7 +145,7 @@ {/if} {#if isCustomRealTime} - + {/if} diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsImportExportTab.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsImportExportTab.svelte new file mode 100644 index 00000000..b2adf394 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsImportExportTab.svelte @@ -0,0 +1,255 @@ + + +
+
+
+

Export Conversations

+ +

+ Download all your conversations as a JSON file. This includes all messages, attachments, and + conversation history. +

+ + + + {#if showExportSummary && exportedConversations.length > 0} +
+
+ Exported {exportedConversations.length} conversation{exportedConversations.length === 1 + ? '' + : 's'} +
+ +
    + {#each exportedConversations.slice(0, 10) as conv (conv.id)} +
  • • {conv.name || 'Untitled conversation'}
  • + {/each} + + {#if exportedConversations.length > 10} +
  • + ... and {exportedConversations.length - 10} more +
  • + {/if} +
+
+ {/if} +
+ +
+

Import Conversations

+ +

+ Import one or more conversations from a previously exported JSON file. This will merge with + your existing conversations. +

+ + + + {#if showImportSummary && importedConversations.length > 0} +
+
+ Imported {importedConversations.length} conversation{importedConversations.length === 1 + ? '' + : 's'} +
+ +
    + {#each importedConversations.slice(0, 10) as conv (conv.id)} +
  • • {conv.name || 'Untitled conversation'}
  • + {/each} + + {#if importedConversations.length > 10} +
  • + ... and {importedConversations.length - 10} more +
  • + {/if} +
+
+ {/if} +
+
+
+ + (showExportDialog = false)} + onConfirm={handleExportConfirm} +/> + + (showImportDialog = false)} + onConfirm={handleImportConfirm} +/> diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsParameterSourceIndicator.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsParameterSourceIndicator.svelte new file mode 100644 index 00000000..b566985b --- /dev/null +++ b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsParameterSourceIndicator.svelte @@ -0,0 +1,18 @@ + + + + + Custom + diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ConversationSelectionDialog.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ConversationSelectionDialog.svelte deleted file mode 100644 index bc92a50a..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ConversationSelectionDialog.svelte +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - - - - - Select Conversations to {mode === 'export' ? 'Export' : 'Import'} - - - - {#if mode === 'export'} - Choose which conversations you want to export. Selected conversations will be downloaded - as a JSON file. - {:else} - Choose which conversations you want to import. Selected conversations will be merged - with your existing conversations. - {/if} - - - -
-
- - - - - {#if searchQuery} - - {/if} -
- -
- - {selectedIds.size} of {conversations.length} selected - {#if searchQuery} - ({filteredConversations.length} shown) - {/if} - -
- -
- - - - - - - - - - - - - {#if filteredConversations.length === 0} - - - - {:else} - {#each filteredConversations as conv (conv.id)} - toggleConversation(conv.id, e.shiftKey)} - > - - - - - - - {/each} - {/if} - -
- - Conversation NameMessages
- {#if searchQuery} - No conversations found matching "{searchQuery}" - {:else} - No conversations available - {/if} -
- { - e.preventDefault(); - e.stopPropagation(); - toggleConversation(conv.id, e.shiftKey); - }} - /> - -
- {conv.name || 'Untitled conversation'} -
-
- {messageCountMap.get(conv.id) ?? 0} -
-
-
-
- - - - - - -
-
-
diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ImportExportTab.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ImportExportTab.svelte deleted file mode 100644 index 19c982c7..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ImportExportTab.svelte +++ /dev/null @@ -1,255 +0,0 @@ - - -
-
-
-

Export Conversations

- -

- Download all your conversations as a JSON file. This includes all messages, attachments, and - conversation history. -

- - - - {#if showExportSummary && exportedConversations.length > 0} -
-
- Exported {exportedConversations.length} conversation{exportedConversations.length === 1 - ? '' - : 's'} -
- -
    - {#each exportedConversations.slice(0, 10) as conv (conv.id)} -
  • • {conv.name || 'Untitled conversation'}
  • - {/each} - - {#if exportedConversations.length > 10} -
  • - ... and {exportedConversations.length - 10} more -
  • - {/if} -
-
- {/if} -
- -
-

Import Conversations

- -

- Import one or more conversations from a previously exported JSON file. This will merge with - your existing conversations. -

- - - - {#if showImportSummary && importedConversations.length > 0} -
-
- Imported {importedConversations.length} conversation{importedConversations.length === 1 - ? '' - : 's'} -
- -
    - {#each importedConversations.slice(0, 10) as conv (conv.id)} -
  • • {conv.name || 'Untitled conversation'}
  • - {/each} - - {#if importedConversations.length > 10} -
  • - ... and {importedConversations.length - 10} more -
  • - {/if} -
-
- {/if} -
-
-
- - (showExportDialog = false)} - onConfirm={handleExportConfirm} -/> - - (showImportDialog = false)} - onConfirm={handleImportConfirm} -/> diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ParameterSourceIndicator.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ParameterSourceIndicator.svelte deleted file mode 100644 index b566985b..00000000 --- a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ParameterSourceIndicator.svelte +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Custom - 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 5976e5dd..34f3da53 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 @@ -2,7 +2,7 @@ import { goto } from '$app/navigation'; import { page } from '$app/state'; import { Trash2 } from '@lucide/svelte'; - import { ChatSidebarConversationItem, ConfirmationDialog } from '$lib/components/app'; + import { ChatSidebarConversationItem, DialogConfirmation } from '$lib/components/app'; import ScrollArea from '$lib/components/ui/scroll-area/scroll-area.svelte'; import * as Sidebar from '$lib/components/ui/sidebar'; import * as AlertDialog from '$lib/components/ui/alert-dialog'; @@ -158,7 +158,7 @@
- - import * as AlertDialog from '$lib/components/ui/alert-dialog'; - import { AlertTriangle, TimerOff } from '@lucide/svelte'; - - interface Props { - open: boolean; - type: 'timeout' | 'server'; - message: string; - onOpenChange?: (open: boolean) => void; - } - - let { open = $bindable(), type, message, onOpenChange }: Props = $props(); - - const isTimeout = $derived(type === 'timeout'); - const title = $derived(isTimeout ? 'TCP Timeout' : 'Server Error'); - const description = $derived( - isTimeout - ? 'The request did not receive a response from the server before timing out.' - : 'The server responded with an error message. Review the details below.' - ); - const iconClass = $derived(isTimeout ? 'text-destructive' : 'text-amber-500'); - const badgeClass = $derived( - isTimeout - ? 'border-destructive/40 bg-destructive/10 text-destructive' - : 'border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400' - ); - - function handleOpenChange(newOpen: boolean) { - open = newOpen; - onOpenChange?.(newOpen); - } - - - - - - - {#if isTimeout} - - {:else} - - {/if} - - {title} - - - - {description} - - - -
-

{message}

-
- - - handleOpenChange(false)}>Close - -
-
diff --git a/tools/server/webui/src/lib/components/app/dialogs/ConfirmationDialog.svelte b/tools/server/webui/src/lib/components/app/dialogs/ConfirmationDialog.svelte deleted file mode 100644 index b5175a99..00000000 --- a/tools/server/webui/src/lib/components/app/dialogs/ConfirmationDialog.svelte +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - {#if icon} - {@const IconComponent = icon} - - {/if} - {title} - - - - {description} - - - - - {cancelText} - - {confirmText} - - - - diff --git a/tools/server/webui/src/lib/components/app/dialogs/ConversationTitleUpdateDialog.svelte b/tools/server/webui/src/lib/components/app/dialogs/ConversationTitleUpdateDialog.svelte deleted file mode 100644 index 4a9eccef..00000000 --- a/tools/server/webui/src/lib/components/app/dialogs/ConversationTitleUpdateDialog.svelte +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Update Conversation Title? - - - Do you want to update the conversation title to match the first message content? - - - -
-
-

Current title:

- -

{currentTitle}

-
- -
-

New title would be:

- -

{newTitle}

-
-
- - - - - - -
-
diff --git a/tools/server/webui/src/lib/components/app/dialogs/DialogChatAttachmentPreview.svelte b/tools/server/webui/src/lib/components/app/dialogs/DialogChatAttachmentPreview.svelte new file mode 100644 index 00000000..ac70b8dc --- /dev/null +++ b/tools/server/webui/src/lib/components/app/dialogs/DialogChatAttachmentPreview.svelte @@ -0,0 +1,78 @@ + + + + + + {displayName} + + {displayType} + {#if displaySize} + • {formatFileSize(displaySize)} + {/if} + + + + + + diff --git a/tools/server/webui/src/lib/components/app/dialogs/DialogChatAttachmentsViewAll.svelte b/tools/server/webui/src/lib/components/app/dialogs/DialogChatAttachmentsViewAll.svelte new file mode 100644 index 00000000..8f6ca76d --- /dev/null +++ b/tools/server/webui/src/lib/components/app/dialogs/DialogChatAttachmentsViewAll.svelte @@ -0,0 +1,51 @@ + + + + + + + + + All Attachments ({totalCount}) + View and manage all attached files + + + + + + diff --git a/tools/server/webui/src/lib/components/app/dialogs/DialogChatError.svelte b/tools/server/webui/src/lib/components/app/dialogs/DialogChatError.svelte new file mode 100644 index 00000000..8ecb5890 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/dialogs/DialogChatError.svelte @@ -0,0 +1,60 @@ + + + + + + + {#if isTimeout} + + {:else} + + {/if} + + {title} + + + + {description} + + + +
+

{message}

+
+ + + handleOpenChange(false)}>Close + +
+
diff --git a/tools/server/webui/src/lib/components/app/dialogs/DialogChatSettings.svelte b/tools/server/webui/src/lib/components/app/dialogs/DialogChatSettings.svelte new file mode 100644 index 00000000..e9aaa100 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/dialogs/DialogChatSettings.svelte @@ -0,0 +1,37 @@ + + + + + + + diff --git a/tools/server/webui/src/lib/components/app/dialogs/DialogConfirmation.svelte b/tools/server/webui/src/lib/components/app/dialogs/DialogConfirmation.svelte new file mode 100644 index 00000000..b5175a99 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/dialogs/DialogConfirmation.svelte @@ -0,0 +1,72 @@ + + + + + + + {#if icon} + {@const IconComponent = icon} + + {/if} + {title} + + + + {description} + + + + + {cancelText} + + {confirmText} + + + + diff --git a/tools/server/webui/src/lib/components/app/dialogs/DialogConversationSelection.svelte b/tools/server/webui/src/lib/components/app/dialogs/DialogConversationSelection.svelte new file mode 100644 index 00000000..1f8ea64b --- /dev/null +++ b/tools/server/webui/src/lib/components/app/dialogs/DialogConversationSelection.svelte @@ -0,0 +1,68 @@ + + + + + + + + + + Select Conversations to {mode === 'export' ? 'Export' : 'Import'} + + + {#if mode === 'export'} + Choose which conversations you want to export. Selected conversations will be downloaded + as a JSON file. + {:else} + Choose which conversations you want to import. Selected conversations will be merged + with your existing conversations. + {/if} + + + + + + + diff --git a/tools/server/webui/src/lib/components/app/dialogs/DialogConversationTitleUpdate.svelte b/tools/server/webui/src/lib/components/app/dialogs/DialogConversationTitleUpdate.svelte new file mode 100644 index 00000000..4a9eccef --- /dev/null +++ b/tools/server/webui/src/lib/components/app/dialogs/DialogConversationTitleUpdate.svelte @@ -0,0 +1,46 @@ + + + + + + Update Conversation Title? + + + Do you want to update the conversation title to match the first message content? + + + +
+
+

Current title:

+ +

{currentTitle}

+
+ +
+

New title would be:

+ +

{newTitle}

+
+
+ + + + + + +
+
diff --git a/tools/server/webui/src/lib/components/app/dialogs/DialogEmptyFileAlert.svelte b/tools/server/webui/src/lib/components/app/dialogs/DialogEmptyFileAlert.svelte new file mode 100644 index 00000000..f875b0ab --- /dev/null +++ b/tools/server/webui/src/lib/components/app/dialogs/DialogEmptyFileAlert.svelte @@ -0,0 +1,61 @@ + + + + + + + + + Empty Files Detected + + + + The following files are empty and have been removed from your attachments: + + + +
+
+
Empty Files:
+ +
    + {#each emptyFiles as fileName (fileName)} +
  • {fileName}
  • + {/each} +
+
+ +
+
What happened:
+ +
    +
  • Empty files cannot be processed or sent to the AI model
  • + +
  • These files have been automatically removed from your attachments
  • + +
  • You can try uploading files with content instead
  • +
+
+
+ + + handleOpenChange(false)}>Got it + +
+
diff --git a/tools/server/webui/src/lib/components/app/dialogs/EmptyFileAlertDialog.svelte b/tools/server/webui/src/lib/components/app/dialogs/EmptyFileAlertDialog.svelte deleted file mode 100644 index f875b0ab..00000000 --- a/tools/server/webui/src/lib/components/app/dialogs/EmptyFileAlertDialog.svelte +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - Empty Files Detected - - - - The following files are empty and have been removed from your attachments: - - - -
-
-
Empty Files:
- -
    - {#each emptyFiles as fileName (fileName)} -
  • {fileName}
  • - {/each} -
-
- -
-
What happened:
- -
    -
  • Empty files cannot be processed or sent to the AI model
  • - -
  • These files have been automatically removed from your attachments
  • - -
  • You can try uploading files with content instead
  • -
-
-
- - - handleOpenChange(false)}>Got it - -
-
diff --git a/tools/server/webui/src/lib/components/app/index.ts b/tools/server/webui/src/lib/components/app/index.ts index a695f997..54bd8d5a 100644 --- a/tools/server/webui/src/lib/components/app/index.ts +++ b/tools/server/webui/src/lib/components/app/index.ts @@ -1,56 +1,63 @@ +// Chat + +export { default as ChatAttachmentPreview } from './chat/ChatAttachments/ChatAttachmentPreview.svelte'; +export { default as ChatAttachmentThumbnailFile } from './chat/ChatAttachments/ChatAttachmentThumbnailFile.svelte'; +export { default as ChatAttachmentThumbnailImage } from './chat/ChatAttachments/ChatAttachmentThumbnailImage.svelte'; export { default as ChatAttachmentsList } from './chat/ChatAttachments/ChatAttachmentsList.svelte'; -export { default as ChatAttachmentFilePreview } from './chat/ChatAttachments/ChatAttachmentFilePreview.svelte'; -export { default as ChatAttachmentImagePreview } from './chat/ChatAttachments/ChatAttachmentImagePreview.svelte'; -export { default as ChatAttachmentPreviewDialog } from './chat/ChatAttachments/ChatAttachmentPreviewDialog.svelte'; -export { default as ChatAttachmentsViewAllDialog } from './chat/ChatAttachments/ChatAttachmentsViewAllDialog.svelte'; +export { default as ChatAttachmentsViewAll } from './chat/ChatAttachments/ChatAttachmentsViewAll.svelte'; export { default as ChatForm } from './chat/ChatForm/ChatForm.svelte'; -export { default as ChatFormTextarea } from './chat/ChatForm/ChatFormTextarea.svelte'; -export { default as ChatFormActions } from './chat/ChatForm/ChatFormActions.svelte'; -export { default as ChatFormActionFileAttachments } from './chat/ChatForm/ChatFormActionFileAttachments.svelte'; -export { default as ChatFormActionRecord } from './chat/ChatForm/ChatFormActionRecord.svelte'; -export { default as ChatFormModelSelector } from './chat/ChatForm/ChatFormModelSelector.svelte'; -export { default as ChatFormHelperText } from './chat/ChatForm/ChatFormHelperText.svelte'; +export { default as ChatFormActionFileAttachments } from './chat/ChatForm/ChatFormActions/ChatFormActionFileAttachments.svelte'; +export { default as ChatFormActionRecord } from './chat/ChatForm/ChatFormActions/ChatFormActionRecord.svelte'; +export { default as ChatFormActions } from './chat/ChatForm/ChatFormActions/ChatFormActions.svelte'; export { default as ChatFormFileInputInvisible } from './chat/ChatForm/ChatFormFileInputInvisible.svelte'; +export { default as ChatFormHelperText } from './chat/ChatForm/ChatFormHelperText.svelte'; +export { default as ChatFormModelSelector } from './chat/ChatForm/ChatFormModelSelector.svelte'; +export { default as ChatFormTextarea } from './chat/ChatForm/ChatFormTextarea.svelte'; export { default as ChatMessage } from './chat/ChatMessages/ChatMessage.svelte'; export { default as ChatMessages } from './chat/ChatMessages/ChatMessages.svelte'; +export { default as ChatMessageBranchingControls } from './chat/ChatMessages/ChatMessageBranchingControls.svelte'; export { default as ChatMessageThinkingBlock } from './chat/ChatMessages/ChatMessageThinkingBlock.svelte'; -export { default as MessageBranchingControls } from './chat/ChatMessages/ChatMessageBranchingControls.svelte'; - -export { default as ChatProcessingInfo } from './chat/ChatProcessingInfo.svelte'; +export { default as ChatScreen } from './chat/ChatScreen/ChatScreen.svelte'; export { default as ChatScreenHeader } from './chat/ChatScreen/ChatScreenHeader.svelte'; +export { default as ChatScreenProcessingInfo } from './chat/ChatScreen/ChatScreenProcessingInfo.svelte'; export { default as ChatScreenWarning } from './chat/ChatScreen/ChatScreenWarning.svelte'; -export { default as ChatScreen } from './chat/ChatScreen/ChatScreen.svelte'; -export { default as ChatSettingsDialog } from './chat/ChatSettings/ChatSettingsDialog.svelte'; +export { default as ChatSettings } from './chat/ChatSettings/ChatSettings.svelte'; export { default as ChatSettingsFooter } from './chat/ChatSettings/ChatSettingsFooter.svelte'; export { default as ChatSettingsFields } from './chat/ChatSettings/ChatSettingsFields.svelte'; -export { default as ImportExportTab } from './chat/ChatSettings/ImportExportTab.svelte'; -export { default as ConversationSelectionDialog } from './chat/ChatSettings/ConversationSelectionDialog.svelte'; -export { default as ParameterSourceIndicator } from './chat/ChatSettings/ParameterSourceIndicator.svelte'; +export { default as ChatSettingsImportExportTab } from './chat/ChatSettings/ChatSettingsImportExportTab.svelte'; +export { default as ChatSettingsParameterSourceIndicator } from './chat/ChatSettings/ChatSettingsParameterSourceIndicator.svelte'; export { default as ChatSidebar } from './chat/ChatSidebar/ChatSidebar.svelte'; export { default as ChatSidebarConversationItem } from './chat/ChatSidebar/ChatSidebarConversationItem.svelte'; export { default as ChatSidebarSearch } from './chat/ChatSidebar/ChatSidebarSearch.svelte'; -export { default as ChatErrorDialog } from './dialogs/ChatErrorDialog.svelte'; -export { default as EmptyFileAlertDialog } from './dialogs/EmptyFileAlertDialog.svelte'; -export { default as ConversationTitleUpdateDialog } from './dialogs/ConversationTitleUpdateDialog.svelte'; +// Dialogs -export { default as KeyboardShortcutInfo } from './misc/KeyboardShortcutInfo.svelte'; +export { default as DialogChatAttachmentPreview } from './dialogs/DialogChatAttachmentPreview.svelte'; +export { default as DialogChatAttachmentsViewAll } from './dialogs/DialogChatAttachmentsViewAll.svelte'; +export { default as DialogChatError } from './dialogs/DialogChatError.svelte'; +export { default as DialogChatSettings } from './dialogs/DialogChatSettings.svelte'; +export { default as DialogConfirmation } from './dialogs/DialogConfirmation.svelte'; +export { default as DialogConversationSelection } from './dialogs/DialogConversationSelection.svelte'; +export { default as DialogConversationTitleUpdate } from './dialogs/DialogConversationTitleUpdate.svelte'; +export { default as DialogEmptyFileAlert } from './dialogs/DialogEmptyFileAlert.svelte'; -export { default as MarkdownContent } from './misc/MarkdownContent.svelte'; +// Miscellanous +export { default as ActionButton } from './misc/ActionButton.svelte'; +export { default as ActionDropdown } from './misc/ActionDropdown.svelte'; +export { default as ConversationSelection } from './misc/ConversationSelection.svelte'; +export { default as KeyboardShortcutInfo } from './misc/KeyboardShortcutInfo.svelte'; +export { default as MarkdownContent } from './misc/MarkdownContent.svelte'; export { default as RemoveButton } from './misc/RemoveButton.svelte'; +// Server + export { default as ServerStatus } from './server/ServerStatus.svelte'; export { default as ServerErrorSplash } from './server/ServerErrorSplash.svelte'; export { default as ServerLoadingSplash } from './server/ServerLoadingSplash.svelte'; export { default as ServerInfo } from './server/ServerInfo.svelte'; - -// Shared components -export { default as ActionButton } from './misc/ActionButton.svelte'; -export { default as ActionDropdown } from './misc/ActionDropdown.svelte'; -export { default as ConfirmationDialog } from './dialogs/ConfirmationDialog.svelte'; diff --git a/tools/server/webui/src/lib/components/app/misc/ConversationSelection.svelte b/tools/server/webui/src/lib/components/app/misc/ConversationSelection.svelte new file mode 100644 index 00000000..e2095e08 --- /dev/null +++ b/tools/server/webui/src/lib/components/app/misc/ConversationSelection.svelte @@ -0,0 +1,205 @@ + + +
+
+ + + + + {#if searchQuery} + + {/if} +
+ +
+ + {selectedIds.size} of {conversations.length} selected + {#if searchQuery} + ({filteredConversations.length} shown) + {/if} + +
+ +
+ + + + + + + + + + + + + {#if filteredConversations.length === 0} + + + + {:else} + {#each filteredConversations as conv (conv.id)} + toggleConversation(conv.id, e.shiftKey)} + > + + + + + + + {/each} + {/if} + +
+ + Conversation NameMessages
+ {#if searchQuery} + No conversations found matching "{searchQuery}" + {:else} + No conversations available + {/if} +
+ { + e.preventDefault(); + e.stopPropagation(); + toggleConversation(conv.id, e.shiftKey); + }} + /> + +
+ {conv.name || 'Untitled conversation'} +
+
+ {messageCountMap.get(conv.id) ?? 0} +
+
+
+ +
+ + + +
+
diff --git a/tools/server/webui/src/routes/+layout.svelte b/tools/server/webui/src/routes/+layout.svelte index b08bd59c..dfe094c0 100644 --- a/tools/server/webui/src/routes/+layout.svelte +++ b/tools/server/webui/src/routes/+layout.svelte @@ -1,7 +1,7 @@ + + diff --git a/tools/server/webui/src/stories/ChatSettingsDialog.stories.svelte b/tools/server/webui/src/stories/ChatSettingsDialog.stories.svelte deleted file mode 100644 index 1e53f707..00000000 --- a/tools/server/webui/src/stories/ChatSettingsDialog.stories.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - - - -