diff --git a/src/App.css b/src/App.css index 3c0907a..927a4a0 100644 --- a/src/App.css +++ b/src/App.css @@ -627,6 +627,46 @@ body { position: relative; } +.message-item.grouped { + padding-top: 4px; + padding-bottom: 4px; +} + +.message-item.grouped .message-header { + display: none; +} + +.message-avatar-placeholder { + width: 40px; + height: 20px; /* Match approximate line-height */ + flex-shrink: 0; + position: relative; + display: flex; + justify-content: center; +} + +.thread-message-item .message-avatar-placeholder { + width: 32px; +} + +.message-hover-timestamp { + position: absolute; + top: 0; + left: 0; + width: 100%; + text-align: center; + font-size: 0.65rem; + color: var(--text-muted); + opacity: 0; + pointer-events: none; + line-height: 1.4; + padding-top: 2px; +} + +.message-item.grouped:hover .message-hover-timestamp { + opacity: 1; +} + .message-item:hover { background-color: rgba(0, 0, 0, 0.05); } diff --git a/src/auth/AuthGate.svelte b/src/auth/AuthGate.svelte index ac23566..1f7eac6 100644 --- a/src/auth/AuthGate.svelte +++ b/src/auth/AuthGate.svelte @@ -99,7 +99,7 @@ - + @@ -107,7 +107,7 @@ - + diff --git a/src/chat/components/MessageItem.svelte b/src/chat/components/MessageItem.svelte index d279738..6a8b57c 100644 --- a/src/chat/components/MessageItem.svelte +++ b/src/chat/components/MessageItem.svelte @@ -13,11 +13,13 @@ msg, isThread = false, isHighlighted = false, + isGrouped = false, onContentLoad }: { msg: Types.Message; isThread?: boolean; isHighlighted?: boolean; + isGrouped?: boolean; onContentLoad?: () => void; } = $props(); @@ -145,7 +147,7 @@ -
+
{#if chat.isFullyAuthenticated}
@@ -186,17 +188,25 @@ {/if}
- -
{ - e.preventDefault(); - e.stopPropagation(); - const user = chat.users.find(u => u.identity.isEqual(msg.sender)); - if (user) { - chat.userContextMenu = { x: e.clientX, y: e.clientY, user }; - } - }}> - u.identity.isEqual(msg.sender))} size={isThread ? "small" : "medium"} class="message-avatar" /> -
+ {#if isGrouped} +
+
+ {chat.formatTime(msg.sent)} +
+
+ {:else} + +
{ + e.preventDefault(); + e.stopPropagation(); + const user = chat.users.find(u => u.identity.isEqual(msg.sender)); + if (user) { + chat.userContextMenu = { x: e.clientX, y: e.clientY, user }; + } + }}> + u.identity.isEqual(msg.sender))} size={isThread ? "small" : "medium"} class="message-avatar" /> +
+ {/if}
@@ -281,11 +291,11 @@ {/if} {/if} {group.length} - - {/each} -
+ + {/each} +
- {#if !isThread && existingThread} + {#if !isThread && existingThread} {@const threadMessageCount = chat.allMessages.filter(m => m.threadId === existingThread.id).length}