diff --git a/apps/mana/apps/web/src/lib/app-registry/apps.ts b/apps/mana/apps/web/src/lib/app-registry/apps.ts index 48aa5aeef..2a6768bb4 100644 --- a/apps/mana/apps/web/src/lib/app-registry/apps.ts +++ b/apps/mana/apps/web/src/lib/app-registry/apps.ts @@ -449,7 +449,10 @@ registerApp({ icon: ChatCircle, views: { list: { load: () => import('$lib/modules/chat/ListView.svelte') }, + detail: { load: () => import('$lib/modules/chat/views/DetailView.svelte') }, }, + collection: 'conversations', + paramKey: 'conversationId', }); registerApp({ diff --git a/apps/mana/apps/web/src/lib/modules/chat/ListView.svelte b/apps/mana/apps/web/src/lib/modules/chat/ListView.svelte index 747a409b5..32ff0effd 100644 --- a/apps/mana/apps/web/src/lib/modules/chat/ListView.svelte +++ b/apps/mana/apps/web/src/lib/modules/chat/ListView.svelte @@ -1,22 +1,34 @@ - c.id} emptyTitle="Keine Unterhaltungen"> - {#snippet header()} - {conversations.length} Unterhaltungen - {/snippet} +
+ - {#snippet item(conv)} - {@const lastMsg = lastMessages.get(conv.id)} -
-
-

- {conv.title || 'Neue Unterhaltung'} -

- {#if conv.isPinned} - 📌 + c.id} emptyTitle="Keine Unterhaltungen"> + {#snippet header()} + {conversations.length} Unterhaltungen + {/snippet} + + {#snippet item(conv)} + {@const lastMsg = lastMessages.get(conv.id)} +
- {#if lastMsg} -

- {lastMsg.sender === 'user' ? 'Du: ' : ''}{truncate(lastMsg.messageText)} -

- {/if} -
- {/snippet} - + + {/snippet} + + + +
+ + diff --git a/apps/mana/apps/web/src/lib/modules/chat/views/DetailView.svelte b/apps/mana/apps/web/src/lib/modules/chat/views/DetailView.svelte new file mode 100644 index 000000000..54a447d74 --- /dev/null +++ b/apps/mana/apps/web/src/lib/modules/chat/views/DetailView.svelte @@ -0,0 +1,270 @@ + + + +
+ +
+ {#if messages.length === 0 && !isSending} +
Schreibe eine Nachricht
+ {/if} + + {#each messages as msg (msg.id)} +
+
+

{msg.messageText}

+ + {new Date(msg.createdAt).toLocaleTimeString('de-DE', { + hour: '2-digit', + minute: '2-digit', + })} + +
+
+ {/each} + + {#if isSending && streamingText} +
+
+

{streamingText}

+ ... +
+
+ {:else if isSending} +
+
+ ●●● +
+
+ {/if} +
+ + +
+ + +
+
+ +