From e904bb8210fa1c236a686c8eb623885e42e03d5c Mon Sep 17 00:00:00 2001 From: JCEEE <0xjceee@proton.me> Date: Tue, 25 Aug 2026 10:54:18 +0100 Subject: [PATCH] fixed issues namely reveloved around chat --- frontend/src/lib/components/Chat.svelte | 21 ++++++--- frontend/src/lib/server/migrate.ts | 43 ++++++++++--------- frontend/src/lib/stores/chat.svelte.ts | 35 +++++++++++---- .../[fam]/[username]/preferences/+page.svelte | 29 +++++++++++-- shared/pb/schema.ts | 6 +++ 5 files changed, 96 insertions(+), 38 deletions(-) diff --git a/frontend/src/lib/components/Chat.svelte b/frontend/src/lib/components/Chat.svelte index 5e82a7c..53996da 100644 --- a/frontend/src/lib/components/Chat.svelte +++ b/frontend/src/lib/components/Chat.svelte @@ -14,6 +14,14 @@ const isOwn = (msg: any) => msg.authorId === chatStore.actorId; + // Colour comes from the sender's user record (loaded with the family on + // page load) — no per-message snapshot, no live colour tracking. Falls back + // to the stored authorColor for any message sent before this change. + function colorOf(msg: any): string { + if (msg.authorId === chatStore.actorId) return chatStore.actorColor || '#6366f1'; + return msg.authorColor || '#6366f1'; + } + function scrollToBottom(instant = false) { if (!container) return; container.scrollTo({ @@ -107,15 +115,18 @@ {#each chatStore.messages as msg (msg.id)}
{#if !isOwn(msg)} - + {msg.authorName?.charAt(0).toUpperCase()} {/if}
{#if !isOwn(msg)} - {msg.authorName} + {msg.authorName} {/if} -
+
{#each renderContent(msg.content) as seg (msg.id + ':' + seg.text)} {#if seg.mention}