diff --git a/web/src/components/ChatList.tsx b/web/src/components/ChatList.tsx index a0b4667..eb21f5b 100644 --- a/web/src/components/ChatList.tsx +++ b/web/src/components/ChatList.tsx @@ -171,6 +171,52 @@ export function ChatList() { ]; const visibleChats = tab === "archived" ? archivedChats : filteredChats; + const pinnedVisibleChats = visibleChats.filter((chat) => chat.pinned); + const regularVisibleChats = visibleChats.filter((chat) => !chat.pinned); + + function renderChatRow(chat: (typeof visibleChats)[number]) { + return ( + setActiveChatId(chat.id)} + onContextMenu={(e) => { + e.preventDefault(); + const safePos = getSafeContextPosition(e.clientX, e.clientY, 176, 56); + setCtxChatId(chat.id); + setCtxPos(safePos); + }} + > + + + + {chat.pinned ? "📌" : (chat.display_title || chat.title || chat.type).slice(0, 1)} + + {chat.type === "private" && chat.counterpart_is_online ? ( + + ) : null} + + + + {chatLabel(chat)} + {(chat.unread_count ?? 0) > 0 ? ( + + {chat.unread_count} + + ) : ( + + {formatChatListTime(chat.last_message_created_at)} + + )} + + {chatPreviewLabel(chat)} + + + + ); + } return (
{chatLabel(chat)}
{chatPreviewLabel(chat)}