From 0467ac3891f3ffe83e46a88348a4c4b240a00bfc Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Sat, 29 Nov 2025 16:04:19 +0100 Subject: [PATCH] fix(chat): align frontend types with backend camelCase and redesign message bubbles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update all frontend types and components to use camelCase properties matching backend API - Redesign MessageBubble with gradient avatars, shadows, and modern speech bubble styling - Update TypingIndicator to match new bubble design with Robot avatar - Fix marked.js undefined input error by ensuring proper property access đŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../src/lib/components/chat/ChatInput.svelte | 129 ++++++++--- .../src/lib/components/chat/ChatLayout.svelte | 62 +++++- .../components/chat/ConversationList.svelte | 2 +- .../lib/components/chat/MessageBubble.svelte | 210 +++++++++++++++++- .../lib/components/chat/ModelSelector.svelte | 12 +- .../components/chat/TypingIndicator.svelte | 61 +++-- .../lib/components/spaces/SpaceCard.svelte | 2 +- .../components/templates/TemplateCard.svelte | 8 +- .../components/templates/TemplateForm.svelte | 16 +- apps/chat/apps/web/src/lib/services/api.ts | 9 +- .../apps/web/src/lib/services/document.ts | 4 +- apps/chat/apps/web/src/lib/services/space.ts | 2 +- .../apps/web/src/lib/stores/chat.svelte.ts | 14 +- .../src/lib/stores/conversations.svelte.ts | 4 +- .../apps/web/src/lib/stores/spaces.svelte.ts | 2 +- .../web/src/lib/stores/templates.svelte.ts | 2 +- .../routes/(protected)/archive/+page.svelte | 6 +- .../src/routes/(protected)/chat/+page.svelte | 110 +-------- .../routes/(protected)/chat/[id]/+page.svelte | 115 ++-------- .../routes/(protected)/documents/+page.svelte | 6 +- .../routes/(protected)/spaces/+page.svelte | 4 +- .../(protected)/spaces/[id]/+page.svelte | 2 +- .../routes/(protected)/templates/+page.svelte | 24 +- apps/chat/packages/chat-types/src/index.ts | 96 ++++---- 24 files changed, 532 insertions(+), 370 deletions(-) diff --git a/apps/chat/apps/web/src/lib/components/chat/ChatInput.svelte b/apps/chat/apps/web/src/lib/components/chat/ChatInput.svelte index 30481857f..7410a7c3c 100644 --- a/apps/chat/apps/web/src/lib/components/chat/ChatInput.svelte +++ b/apps/chat/apps/web/src/lib/components/chat/ChatInput.svelte @@ -1,17 +1,41 @@
- {formatDate(conv.updated_at || conv.created_at)} + {formatDate(conv.updatedAt || conv.createdAt)} - {#if conv.document_mode} - - Dokument - - {/if} +
+ {#if conv.documentMode} + + Dokument + + {/if} + +
+ + +
+
{/each} diff --git a/apps/chat/apps/web/src/lib/components/chat/ConversationList.svelte b/apps/chat/apps/web/src/lib/components/chat/ConversationList.svelte index 17fe8752b..483f63ca1 100644 --- a/apps/chat/apps/web/src/lib/components/chat/ConversationList.svelte +++ b/apps/chat/apps/web/src/lib/components/chat/ConversationList.svelte @@ -77,7 +77,7 @@ {truncateTitle(conv.title || 'Neue Konversation')} - {formatDate(conv.updated_at || conv.created_at)} + {formatDate(conv.updatedAt || conv.createdAt)}
diff --git a/apps/chat/apps/web/src/lib/components/chat/MessageBubble.svelte b/apps/chat/apps/web/src/lib/components/chat/MessageBubble.svelte index 24643b4fb..fcfd2a27b 100644 --- a/apps/chat/apps/web/src/lib/components/chat/MessageBubble.svelte +++ b/apps/chat/apps/web/src/lib/components/chat/MessageBubble.svelte @@ -1,6 +1,7 @@ -
+
+
{#if isUser} -

{message.message_text}

+ {:else} -
- {@html htmlContent} -
+ {/if} -
- {formattedTime} +
+ + +
+ +
+ {#if isUser} +

{message.messageText}

+ {:else} +
+ {@html htmlContent} +
+ {/if} +
+ + +
+ + {formattedTime} +
+ + diff --git a/apps/chat/apps/web/src/lib/components/chat/ModelSelector.svelte b/apps/chat/apps/web/src/lib/components/chat/ModelSelector.svelte index d4160c063..590165a4d 100644 --- a/apps/chat/apps/web/src/lib/components/chat/ModelSelector.svelte +++ b/apps/chat/apps/web/src/lib/components/chat/ModelSelector.svelte @@ -22,11 +22,11 @@ value={selectedModelId} onchange={handleChange} {disabled} - class="appearance-none bg-muted text-foreground - text-sm rounded-lg px-3 py-2 pr-8 border border-border - focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent + class="appearance-none bg-white/80 dark:bg-white/10 backdrop-blur-xl text-foreground + text-sm font-medium rounded-xl px-4 py-2.5 pr-9 border border-black/10 dark:border-white/20 + focus:outline-none focus:ring-2 focus:ring-primary/50 disabled:opacity-50 disabled:cursor-not-allowed - cursor-pointer min-w-[160px]" + cursor-pointer min-w-[160px] shadow-md hover:shadow-lg transition-all" > {#if models.length === 0} @@ -36,7 +36,7 @@ {/each} {/if} -
- +
+
diff --git a/apps/chat/apps/web/src/lib/components/chat/TypingIndicator.svelte b/apps/chat/apps/web/src/lib/components/chat/TypingIndicator.svelte index ce1561730..27b3d1167 100644 --- a/apps/chat/apps/web/src/lib/components/chat/TypingIndicator.svelte +++ b/apps/chat/apps/web/src/lib/components/chat/TypingIndicator.svelte @@ -1,27 +1,56 @@ -
-
-
-
-
-
+
+ +
+ +
+ + +
+
+
+
+
+
+