From b7ba13b6a0418060cfbafd34a29ea2904feddc99 Mon Sep 17 00:00:00 2001 From: Aleksander Grygier Date: Sun, 23 Nov 2025 21:46:43 +0100 Subject: [PATCH] refactor: Attachments data --- .../ChatAttachmentPreview.svelte | 76 ++++------- .../ChatAttachmentThumbnailFile.svelte | 21 ++- .../ChatAttachmentsList.svelte | 75 +++-------- .../ChatAttachmentsViewAll.svelte | 72 +++------- .../DialogChatAttachmentPreview.svelte | 28 +--- tools/server/webui/src/lib/types/chat.d.ts | 2 - .../webui/src/lib/utils/attachment-type.ts | 126 ++++++++++++++++++ 7 files changed, 204 insertions(+), 196 deletions(-) create mode 100644 tools/server/webui/src/lib/utils/attachment-type.ts 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 index 015f6fc3d7..fa01075496 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentPreview.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatAttachments/ChatAttachmentPreview.svelte @@ -1,12 +1,9 @@ -{#if type === MimeTypeText.PLAIN || type === FileTypeCategory.TEXT} +{#if isText} {#if readonly}