Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

feat(dashboard): redesign the chat page in a WhatsApp Web style

Rezk Jörg Sebeningfb358c9d1174
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fda572063..f6a820bac 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add chat and contact menus to the dashboard Chats page: pin, mute, archive, mark unread, save, rename and block a contact, leave a group, and clear or delete a chat on whatsapp-web.js only until #1891 is fixed. Thanks @rjsebening.
- Add an Archived view to the dashboard chat list. Thanks @rjsebening.
- Add a group info dialog to the dashboard Chats page that edits a group and manages its participants. Thanks @rjsebening.
+- Add a session switcher to the dashboard Chats page that lists every session with its state, picture, push name and number, and lets only a ready one be selected.
+- Add a contact info panel to the dashboard chat room with the contact's picture, name, number and copyable chat id.
+- Add Today, Yesterday and date separators to the dashboard chat thread.
### Changed
@@ -35,6 +38,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove a stored plugin secret when a config write sends `null` for it; an empty string still keeps it.
- Send `null` for a cleared secret field in the plugin config form of the dashboard, which removes the stored secret.
- Reuse the participant list of a Baileys group for up to 5 minutes (`BAILEYS_GROUP_METADATA_CACHE_TTL_MS`, `0` queries for every send) instead of querying it for every group message.
+- Redesign the dashboard Chats page in a WhatsApp Web style, full height without the page header, with its own light and dark palette, a patterned wallpaper behind the thread, coloured avatars, tailed bubbles and a single-pill composer; every existing chat feature stays.
+- Show the dashboard Chats page's message search behind a toggle in the chat list header, still hidden for read-only keys.
+- Show the raw chat id of a dashboard chat in its contact info panel instead of the room header.
+- Show a dashboard chat message's time and delivery ticks inside its last line of text, with the delivery status still named for screen readers.
+- Show dashboard chat list times as the clock today, Yesterday, the weekday within the last week and a short date before that.
+- Move the dashboard sidebar's collapse button from the sidebar edge into its header, beside the logo or under it when collapsed, with a panel icon mirrored for right-to-left languages.
### Fixed
diff --git a/dashboard/src/components/Layout.css b/dashboard/src/components/Layout.css
index 9138bfb58..20f9e7043 100644
--- a/dashboard/src/components/Layout.css
+++ b/dashboard/src/components/Layout.css
@@ -26,14 +26,16 @@
display: flex;
align-items: center;
gap: 0.75rem;
- padding: 1.5rem;
- border-bottom: 1px solid var(--border);
+ padding: 0.5rem 1.5rem;
min-height: 72px;
}
.sidebar.collapsed .sidebar-header {
+ /* On the collapsed rail the header stacks: the logo, and the expand control under it. */
+ flex-direction: column;
justify-content: center;
- padding: 1.5rem 1rem;
+ gap: 0.5rem;
+ padding: 0.75rem 1rem;
}
.sidebar-logo {
@@ -88,40 +90,38 @@
}
/* Collapse Toggle Button - Circular design at edge */
+/* Collapse control: a ghost button at the end of the header row. */
.collapse-toggle {
- position: absolute;
- right: -14px;
- top: 36px;
- width: 28px;
- height: 28px;
- border-radius: 50%;
- background: var(--bg-white);
- border: 1px solid var(--border);
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ margin-inline-start: auto;
+ width: 36px;
+ height: 36px;
+ padding: 0;
+ border: none;
+ border-radius: var(--radius);
+ background: transparent;
+ color: var(--text-secondary);
display: flex;
align-items: center;
justify-content: center;
+ flex-shrink: 0;
cursor: pointer;
- color: var(--text-secondary);
- transition: all 0.2s;
- z-index: 101;
- padding: 0;
+ transition:
+ background 0.2s,
+ color 0.2s;
}
.collapse-toggle:hover {
- background: var(--primary);
- border-color: var(--primary);
- color: white;
- box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
+ background: var(--bg-light);
+ color: var(--text-primary);
}
-.collapse-toggle svg {
- width: 16px;
- height: 16px;
+.collapse-toggle:focus-visible {
+ outline: 2px solid var(--primary);
+ outline-offset: 2px;
}
.sidebar.collapsed .collapse-toggle {
- right: -14px;
+ margin-inline-start: 0;
}
.sidebar-nav {
@@ -432,11 +432,6 @@
border-left: 1px solid var(--border);
}
-[dir='rtl'] .collapse-toggle {
- right: auto;
- left: -14px;
-}
-
[dir='rtl'] .language-menu-item {
text-align: right;
}
diff --git a/dashboard/src/components/Layout.css.test.ts b/dashboard/src/components/Layout.css.test.ts
index 6baa2c467..a637b7b25 100644
--- a/dashboard/src/components/Layout.css.test.ts
+++ b/dashboard/src/components/Layout.css.test.ts
@@ -69,9 +69,10 @@ test('the closed mobile sidebar slides off the right edge under RTL, and opens b
assert.equal(decl(open[0].body, 'transform'), 'translateX(0)');
});
-test('the collapse chevron is mirrored once, by the icon Layout.tsx picks', () => {
- assert.match(tsx, /isRtl \? \(\s*<ChevronLeft/, 'Layout.tsx no longer swaps the chevron for RTL');
- for (const r of all.filter(r => r.selectors.some(s => s.includes('.collapse-toggle svg')))) {
- assert.equal(decl(r.body, 'transform'), undefined, `${r.selectors.join(', ')} flips the chevron again`);
+test('the collapse icon is mirrored once, by the icon Layout.tsx picks', () => {
+ assert.match(tsx, /isRtl \?\s*\(?\s*<PanelRightClose/, 'Layout.tsx no longer swaps the collapse icon for RTL');
+ assert.match(tsx, /isRtl \?\s*\(?\s*<PanelRightOpen/, 'Layout.tsx no longer swaps the expand icon for RTL');
+ for (const r of all.filter(r => r.selectors.some(s => s.includes('.collapse-toggle') && s.includes('svg')))) {
+ assert.equal(decl(r.body, 'transform'), undefined, `${r.selectors.join(', ')} flips the icon again`);
}
});
diff --git a/dashboard/src/components/Layout.tsx b/dashboard/src/components/Layout.tsx
index a4513c428..4e856c7b9 100644
--- a/dashboard/src/components/Layout.tsx
+++ b/dashboard/src/components/Layout.tsx
@@ -18,8 +18,10 @@ import {
Monitor,
Menu,
X,
- ChevronLeft,
- ChevronRight,
+ PanelLeftClose,
+ PanelLeftOpen,
+ PanelRightClose,
+ PanelRightOpen,
Languages,
UserCheck,
} from 'lucide-react';
@@ -198,28 +200,29 @@ export function Layout({ onLogout, userRole }: LayoutProps) {
)}
</div>
)}
- </div>
-
- {!isMobile && (
- <button
- className="collapse-toggle"
- onClick={toggleCollapse}
- title={isCollapsed ? t('common.expand') : t('common.collapse')}
- aria-label={isCollapsed ? t('common.expand') : t('common.collapse')}
- >
- {isCollapsed ? (
- isRtl ? (
- <ChevronLeft size={16} />
+ {/* At the end of the header row, or under the logo on the collapsed rail. The icon is picked for the
+ reading direction, so the panel side follows the mirrored layout. */}
+ {!isMobile && (
+ <button
+ className="collapse-toggle"
+ onClick={toggleCollapse}
+ title={isCollapsed ? t('common.expand') : t('common.collapse')}
+ aria-label={isCollapsed ? t('common.expand') : t('common.collapse')}
+ >
+ {isCollapsed ? (
+ isRtl ? (
+ <PanelRightOpen size={20} />
+ ) : (
+ <PanelLeftOpen size={20} />
+ )
+ ) : isRtl ? (
+ <PanelRightClose size={20} />
) : (
- <ChevronRight size={16} />
- )
- ) : isRtl ? (
- <ChevronRight size={16} />
- ) : (
- <ChevronLeft size={16} />
- )}
- </button>
- )}
+ <PanelLeftClose size={20} />
+ )}
+ </button>
+ )}
+ </div>
<nav className="sidebar-nav">
{navItems.map(({ to, icon: Icon, key }) => {
diff --git a/dashboard/src/components/chats/ChatAvatar.tsx b/dashboard/src/components/chats/ChatAvatar.tsx
index 1654ecce8..187feb21a 100644
--- a/dashboard/src/components/chats/ChatAvatar.tsx
+++ b/dashboard/src/components/chats/ChatAvatar.tsx
@@ -1,32 +1,44 @@
import type { ChatKind } from '../../services/api';
import KindIcon from './KindIcon';
+// Pastel tone for a picture-less avatar, hashed from the chat id so a contact keeps its colour across
+// reloads. The names map to the `.avatar-tone-*` rules in Chats.css (light and dark).
+const AVATAR_TONES = ['blue', 'orange', 'pink', 'brown', 'violet', 'teal'] as const;
+const avatarTone = (id: string): string => {
+ let hash = 0;
+ for (let i = 0; i < id.length; i++) hash = (hash * 31 + id.charCodeAt(i)) | 0;
+ return AVATAR_TONES[Math.abs(hash) % AVATAR_TONES.length];
+};
+
+const ICON_SIZE = { sm: 20, md: 24, lg: 40 } as const;
+
// Chat list avatar. Renders from the sidebar's ONE batch request (useProfilePictures) — firing a
// query per row burst the per-IP throttle into 429s. The generic icon stays while the batch loads
-// or when the contact hides their picture. The group info dialog shows it large, with `onImageError`
-// refetching an expired CDN URL.
+// or when the contact hides their picture. The room header and the contact panel reuse it for the
+// open chat, whose single-picture query hands `onImageError` a refetch for an expired CDN URL.
function ChatAvatar({
+ chatId,
pictureUrl,
kind,
- size,
+ size = 'md',
onImageError,
}: {
+ chatId: string;
pictureUrl?: string | null;
kind: ChatKind;
- size?: 'lg';
+ size?: keyof typeof ICON_SIZE;
onImageError?: () => void;
}) {
- const className = size ? `chat-avatar avatar-${size}` : 'chat-avatar';
if (pictureUrl) {
return (
- <div className={className}>
+ <div className={`chat-avatar avatar-${size}`}>
<img src={pictureUrl} alt="" onError={onImageError} />
</div>
);
}
return (
- <div className={className}>
- <KindIcon kind={kind} size={size === 'lg' ? 40 : 20} />
+ <div className={`chat-avatar avatar-${size} avatar-tone-${avatarTone(chatId)}`}>
+ <KindIcon kind={kind} size={ICON_SIZE[size]} strokeWidth={1.75} />
</div>
);
}
diff --git a/dashboard/src/components/chats/ChatComposer.tsx b/dashboard/src/components/chats/ChatComposer.tsx
index 8ef03800f..ba9b50e04 100644
--- a/dashboard/src/components/chats/ChatComposer.tsx
+++ b/dashboard/src/components/chats/ChatComposer.tsx
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState, type Dispatch, type SetStateAction } from 'react';
import { useQueryClient } from '@tanstack/react-query';
import { useTranslation } from 'react-i18next';
-import { Loader2, Paperclip, Send, Smile, X } from 'lucide-react';
+import { Loader2, Plus, Send, Smile, X } from 'lucide-react';
import { messageApi, type Chat, type MessageType } from '../../services/api';
import { type ChatMessageView } from '../../utils/chatMessages';
import { buildMediaSendPayload, buildOptimisticMetadata, quotedIdOf } from '../../utils/composerSend';
@@ -305,9 +305,9 @@ function ChatComposer({
return (
<>
- {/* Attachment preview banner */}
+ {/* Composer extras: the attachment, emoji and reply panels stack above the input bar. */}
{attachment && (
- <div className="attachment-preview-banner">
+ <div className="composer-banner attachment-preview-banner">
{previewUrl ? (
<img src={previewUrl} alt={attachment.filename} className="preview-thumbnail" />
) : (
@@ -317,18 +317,17 @@ function ChatComposer({
<span className="preview-filename">{attachment.filename}</span>
<span className="preview-filesize">({(attachment.file.size / 1024).toFixed(1)} KB)</span>
</div>
- <button className="btn-remove-attachment" onClick={handleRemoveAttachment}>
+ <button className="btn-banner-close btn-remove-attachment" onClick={handleRemoveAttachment}>
<X size={18} />
</button>
</div>
)}
- {/* Popular emojis panel */}
{showEmojiPicker && (
// No role="menu" here: these are plain buttons with no menuitem roles, no roving focus and
// no arrow-key navigation, so claiming the role would promise a keyboard contract the panel
// does not keep. Escape is handled on document instead, see the effect above.
- <div className="chats-emoji-picker">
+ <div className="composer-banner chats-emoji-picker">
<div className="emoji-grid">
{popularEmojis.map(emoji => (
<button key={emoji} type="button" className="emoji-btn" onClick={() => handleEmojiClick(emoji)}>
@@ -339,9 +338,8 @@ function ChatComposer({
</div>
)}
- {/* Replying preview banner */}
{replyingTo && (
- <div className="replying-preview-banner">
+ <div className="composer-banner replying-preview-banner">
<div className="replying-preview-content">
<div className="replying-to-title">
{t('chats.replyingTo', {
@@ -353,7 +351,7 @@ function ChatComposer({
{replyingTo.type !== 'text' ? typeLabel(replyingTo.type) : replyingTo.body}
</div>
</div>
- <button className="btn-close-reply" onClick={() => setReplyingTo(null)}>
+ <button className="btn-banner-close btn-close-reply" onClick={() => setReplyingTo(null)}>
<X size={18} />
</button>
</div>
@@ -370,41 +368,47 @@ function ChatComposer({
disabled={!canWrite || sending}
className="btn-input-accessory"
title={t('chats.attachTitle')}
+ aria-label={t('chats.attachTitle')}
>
- <Paperclip size={20} />
+ <Plus size={24} />
</button>
- <button
- type="button"
- onClick={() => setShowEmojiPicker(!showEmojiPicker)}
- disabled={!canWrite || sending}
- className={`btn-input-accessory ${showEmojiPicker ? 'active' : ''}`}
- title={t('chats.emojiTitle')}
- >
- <Smile size={20} />
- </button>
+ {/* The text field and the emoji toggle share one pill, as in WhatsApp. */}
+ <div className="message-input-pill">
+ <input
+ type="text"
+ placeholder={
+ canWrite
+ ? attachment && !attachmentIsAudio
+ ? t('chats.captionPlaceholder')
+ : t('chats.messagePlaceholder')
+ : t('chats.noPermission')
+ }
+ value={messageInput}
+ onChange={e => setMessageInput(e.target.value)}
+ disabled={!canWrite || sending}
+ className="message-text-input"
+ />
+ <button
+ type="button"
+ onClick={() => setShowEmojiPicker(!showEmojiPicker)}
+ disabled={!canWrite || sending}
+ className={`btn-input-accessory inside ${showEmojiPicker ? 'active' : ''}`}
+ title={t('chats.emojiTitle')}
+ aria-label={t('chats.emojiTitle')}
+ >
+ <Smile size={22} />
+ </button>
+ </div>
- <input
- type="text"
- placeholder={
- canWrite
- ? attachment && !attachmentIsAudio
- ? t('chats.captionPlaceholder')
- : t('chats.messagePlaceholder')
- : t('chats.noPermission')
- }
- value={messageInput}
- onChange={e => setMessageInput(e.target.value)}
- disabled={!canWrite || sending}
- className="message-text-input"
- />
<button
type="submit"
disabled={!canWrite || (!messageInput.trim() && !attachment) || sending}
className="btn-send-message"
aria-label={t('chats.send')}
+ title={t('chats.send')}
>
- {sending ? <Loader2 className="animate-spin" size={24} /> : <Send size={28} strokeWidth={2.5} />}
+ {sending ? <Loader2 className="animate-spin" size={22} /> : <Send size={20} strokeWidth={2.25} />}
</button>
</form>
</footer>
diff --git a/dashboard/src/components/chats/ChatSidebar.tsx b/dashboard/src/components/chats/ChatSidebar.tsx
index fff9c2755..097f3779c 100644
--- a/dashboard/src/components/chats/ChatSidebar.tsx
+++ b/dashboard/src/components/chats/ChatSidebar.tsx
@@ -1,30 +1,36 @@
-import type { ReactNode } from 'react';
+import { useState, type ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import {
AlertCircle,
Archive,
ArrowLeft,
BellOff,
+ Pin,
CircleDashed,
Loader2,
Megaphone,
MessageSquarePlus,
- Pin,
Plus,
Search,
+ TextSearch,
+ X,
} from 'lucide-react';
import type { UseQueryResult } from '@tanstack/react-query';
import type { Channel, Chat, ContactStatusGroup, Session } from '../../services/api';
import { useRole } from '../../hooks/useRole';
import { CHAT_LIST_FILTERS, type ChatListFilter } from '../../utils/chatFilters';
import ChatAvatar from './ChatAvatar';
+import SessionPicker from './SessionPicker';
import ChatRowMenu from './ChatRowMenu';
import type { ChatRowActions } from './chatActionItems';
export type ChatsTab = 'chats' | 'channels' | 'status';
interface ChatSidebarProps {
+ /** The ready sessions the page can open. */
sessions: Session[];
+ /** Every session the gateway lists, for the switcher to show with its state; defaults to `sessions`. */
+ pickerSessions?: Session[];
selectedSessionId: string;
onSelectSession: (sessionId: string) => void;
activeTab: ChatsTab;
@@ -33,6 +39,8 @@ interface ChatSidebarProps {
onSearchQueryChange: (query: string) => void;
onComposeStatus: () => void;
formatChatTime: (timestamp?: number) => string;
+ /** The full-text message search, or null when this key may not search. Shown behind a header toggle. */
+ messageSearch?: ReactNode;
/** Opens the new-chat panel; absent for a key that cannot write. */
onNewChat?: () => void;
/** The new-chat panel, rendered in place of the lists while it is open. */
@@ -42,13 +50,13 @@ interface ChatSidebarProps {
chats: Chat[];
filter: ChatListFilter;
onFilterChange: (filter: ChatListFilter) => void;
+ activeChatId?: string;
+ pictures?: Record<string, string | null>;
+ onSelectChat: (chat: Chat) => void;
/** The actions behind the chevron on a group or 1:1 row. */
rowActions?: ChatRowActions;
/** The archive: how many chats it holds, whether the list shows it, and the switch between the two. */
archive?: { count: number; showing: boolean; onToggle: () => void };
- activeChatId?: string;
- pictures?: Record<string, string | null>;
- onSelectChat: (chat: Chat) => void;
};
channelsTab: {
engineLoading: boolean;
@@ -67,10 +75,12 @@ interface ChatSidebarProps {
};
}
-// LEFT SIDEBAR: session selector, Chats/Channels/Status tab bar, search, and the per-tab lists.
-// The page owns all queries/state; this component renders them and reports interactions up.
+// LEFT SIDEBAR: session switcher, header actions, Chats/Channels/Status tab bar, search, quick filters,
+// and the per-tab lists. The page owns all queries/state; this component renders them and reports
+// interactions up.
function ChatSidebar({
sessions,
+ pickerSessions,
selectedSessionId,
onSelectSession,
activeTab,
@@ -79,6 +89,7 @@ function ChatSidebar({
onSearchQueryChange,
onComposeStatus,
formatChatTime,
+ messageSearch,
onNewChat,
newChatPanel,
chatsTab,
@@ -88,6 +99,7 @@ function ChatSidebar({
const { t } = useTranslation();
// Posting a status needs an operator key; a read-only key would only reach a 403.
const { canWrite } = useRole();
+ const [showMessageSearch, setShowMessageSearch] = useState(false);
const formatLastMessageSnippet = (chat: Chat) => chat.lastMessage || '';
@@ -102,7 +114,7 @@ function ChatSidebar({
role="button"
tabIndex={0}
aria-current={isActive ? 'true' : undefined}
- className={`chat-item-card ${isActive ? 'active' : ''}`}
+ className={`chat-item-card ${isActive ? 'active' : ''} ${chat.unreadCount !== 0 ? 'unread' : ''}`}
onClick={() => chatsTab.onSelectChat(chat)}
onKeyDown={e => {
if (e.key === 'Enter' || e.key === ' ') {
@@ -111,7 +123,7 @@ function ChatSidebar({
}
}}
>
- <ChatAvatar pictureUrl={chatsTab.pictures?.[chat.id]} kind={chat.kind} />
+ <ChatAvatar chatId={chat.id} pictureUrl={chatsTab.pictures?.[chat.id]} kind={chat.kind} />
<div className="chat-item-info">
<div className="chat-item-top">
@@ -135,8 +147,8 @@ function ChatSidebar({
</span>
{(chat.muted || chat.pinned) && (
<span className="chat-item-flags">
- {chat.muted && <BellOff size={14} role="img" aria-label={t('chats.rowActions.mutedLabel')} />}
- {chat.pinned && <Pin size={14} role="img" aria-label={t('chats.rowActions.pinnedLabel')} />}
+ {chat.muted && <BellOff size={15} role="img" aria-label={t('chats.rowActions.mutedLabel')} />}
+ {chat.pinned && <Pin size={15} role="img" aria-label={t('chats.rowActions.pinnedLabel')} />}
</span>
)}
{/* A negative count is a chat marked unread (Baileys reports -1): a badge with no number. */}
@@ -167,26 +179,45 @@ function ChatSidebar({
return (
<aside className="chats-sidebar">
- <div className="sidebar-header-box">
- {/* Session selector */}
- <div className="session-select-group">
- <label className="form-label" htmlFor="csb-1">
- {t('chats.sessionLabel')}
- </label>
- <select
- id="csb-1"
- value={selectedSessionId}
- onChange={e => onSelectSession(e.target.value)}
- className="session-selector"
- >
- {sessions.map(s => (
- <option key={s.id} value={s.id}>
- {s.name} ({s.phone || t('chats.noPhone')})
- </option>
- ))}
- </select>
+ <header className="sidebar-header">
+ <SessionPicker
+ sessions={pickerSessions ?? sessions}
+ selectedSessionId={selectedSessionId}
+ onSelectSession={onSelectSession}
+ canAddSession={canWrite}
+ />
+
+ <div className="sidebar-header-actions">
+ {messageSearch && (
+ <button
+ type="button"
+ className={`icon-btn ${showMessageSearch ? 'active' : ''}`}
+ onClick={() => setShowMessageSearch(open => !open)}
+ title={t('chats.searchMessages')}
+ aria-label={t('chats.searchMessages')}
+ aria-pressed={showMessageSearch}
+ >
+ <TextSearch size={22} />
+ </button>
+ )}
+ {onNewChat && (
+ <button
+ type="button"
+ className="icon-btn"
+ onClick={onNewChat}
+ title={t('chats.newChat.title')}
+ aria-label={t('chats.newChat.title')}
+ >
+ <MessageSquarePlus size={22} />
+ </button>
+ )}
</div>
+ </header>
+
+ {/* Full-text search over the stored messages of every session, collapsed by default. */}
+ {messageSearch && showMessageSearch && <div className="sidebar-message-search">{messageSearch}</div>}
+ <div className="sidebar-header-box">
{/* Chats / Channels / Status tabs */}
<div className="chats-tabs" role="tablist">
{(['chats', 'channels', 'status'] as const).map(tab => (
@@ -203,47 +234,28 @@ function ChatSidebar({
))}
</div>
- {/* Search bar, and the New chat button beside it */}
- <div className="chat-search-row">
- <div className="chat-search-input">
- <Search size={18} />
- <input
- type="text"
- placeholder={t('chats.searchPlaceholder')}
- value={searchQuery}
- onChange={e => onSearchQueryChange(e.target.value)}
- />
- </div>
- {onNewChat && (
+ {/* Search bar */}
+ <div className="chat-search-input">
+ <Search size={18} />
+ <input
+ type="text"
+ placeholder={t('chats.searchPlaceholder')}
+ value={searchQuery}
+ onChange={e => onSearchQueryChange(e.target.value)}
+ />
+ {searchQuery && (
<button
type="button"
- className="icon-btn chat-new-button"
- onClick={onNewChat}
- title={t('chats.newChat.title')}
- aria-label={t('chats.newChat.title')}
+ className="search-clear"
+ onClick={() => onSearchQueryChange('')}
+ aria-label={t('chats.clearSearch')}
+ title={t('chats.clearSearch')}
>
- <MessageSquarePlus size={20} />
+ <X size={16} />
</button>
)}
</div>
- {/* Quick filters over the chat list. Toggle buttons, not tabs: the tab bar above already is one. */}
- {activeTab === 'chats' && (
- <div className="chat-filters" role="group" aria-label={t('chats.filters.label')}>
- {CHAT_LIST_FILTERS.map(filter => (
- <button
- key={filter}
- type="button"
- aria-pressed={chatsTab.filter === filter}
- className={`chat-filter-pill ${chatsTab.filter === filter ? 'active' : ''}`}
- onClick={() => chatsTab.onFilterChange(filter)}
- >
- {t(`chats.filters.${filter}`)}
- </button>
- ))}
- </div>
- )}
-
{/* Compose a new status — only meaningful on the Status tab. */}
{activeTab === 'status' && canWrite && (
<button type="button" className="btn-primary status-compose-trigger" onClick={onComposeStatus}>
@@ -253,13 +265,30 @@ function ChatSidebar({
)}
</div>
+ {/* Quick filters over the chat list. Toggle buttons, not tabs: the tab bar above already is one. */}
+ {activeTab === 'chats' && (
+ <div className="chat-filters" role="group" aria-label={t('chats.filters.label')}>
+ {CHAT_LIST_FILTERS.map(filter => (
+ <button
+ key={filter}
+ type="button"
+ aria-pressed={chatsTab.filter === filter}
+ className={`chat-filter-pill ${chatsTab.filter === filter ? 'active' : ''}`}
+ onClick={() => chatsTab.onFilterChange(filter)}
+ >
+ {t(`chats.filters.${filter}`)}
+ </button>
+ ))}
+ </div>
+ )}
+
{/* Chat list */}
{activeTab === 'chats' && (
<div className="chats-list">
{/* The archive's entry heads the list, and its view says where it is and leads back. */}
{!chatsTab.loading && chatsTab.archive && (chatsTab.archive.showing || chatsTab.archive.count > 0) && (
<button type="button" className="chat-archive-entry" onClick={chatsTab.archive.onToggle}>
- {chatsTab.archive.showing ? <ArrowLeft size={18} /> : <Archive size={18} />}
+ {chatsTab.archive.showing ? <ArrowLeft size={20} /> : <Archive size={20} />}
<span>
{chatsTab.archive.showing ? t('chats.rowActions.archivedTitle') : t('chats.rowActions.archivedEntry')}
</span>
@@ -343,8 +372,8 @@ function ChatSidebar({
}
}}
>
- <div className="chat-avatar">
- <Megaphone size={20} />
+ <div className="chat-avatar avatar-md">
+ <Megaphone size={22} strokeWidth={1.75} />
</div>
<div className="chat-item-info">
<div className="chat-item-top">
@@ -397,8 +426,8 @@ function ChatSidebar({
}
}}
>
- <div className="chat-avatar">
- <CircleDashed size={20} />
+ <div className="chat-avatar avatar-md">
+ <CircleDashed size={22} strokeWidth={1.75} />
</div>
<div className="chat-item-info">
<div className="chat-item-top">
diff --git a/dashboard/src/components/chats/ChatThread.test.ts b/dashboard/src/components/chats/ChatThread.test.ts
index 8bfe3d374..c7cbd2e54 100644
--- a/dashboard/src/components/chats/ChatThread.test.ts
+++ b/dashboard/src/components/chats/ChatThread.test.ts
@@ -1307,10 +1307,17 @@ test('the scroll-to-bottom button is sticky inside the scroller, not absolute, a
const css = readFileSync(new URL('../../pages/Chats.css', import.meta.url), 'utf8');
const rule = /\.chats-page \.scroll-to-bottom-btn \{([^}]*)\}/.exec(css)?.[1] ?? '';
assert.match(rule, /position:\s*sticky;/);
- assert.match(rule, /bottom:\s*1rem;/);
+ assert.match(rule, /bottom:\s*[\d.]+rem;/);
assert.match(rule, /align-self:\s*flex-end;/);
- assert.match(rule, /margin-top:\s*calc\(-40px - 0\.75rem\);/);
assert.doesNotMatch(rule, /position:\s*absolute/);
+ const plain = css.replace(/\/\*[\s\S]*?\*\//g, '');
+ const button = declarationsOf(plain, '.chats-page .scroll-to-bottom-btn');
+ const gap = lengthPx(declarationsOf(plain, '.chats-page .room-messages').gap);
+ assert.equal(
+ lengthPx(button['margin-top']),
+ -(lengthPx(button.height) + gap),
+ 'the negative margin takes back the height and the gap the button adds to the scroll height',
+ );
const menu = /\.chats-page \.message-actions-menu \{([^}]*)\}/.exec(css)?.[1] ?? '';
const level = (text: string): number => Number(/z-index:\s*(\d+);/.exec(text)?.[1]);
assert.ok(level(rule) < level(menu), 'the jump button paints over the actions menu');
@@ -1365,6 +1372,19 @@ function lengthPx(value: string, vars: Record<string, string> = {}, emPx = 16):
return Function(`return (${expression})`)() as number;
}
+// Where the first text of a thread begins, below its padding. A thread opens with the day pill of its first
+// message (see the render test below), so that pill's text is the first a reader at the top of the thread sees.
+function firstTextStartsPx(): number {
+ const thread = declarationsOf(chatsCss, '.chats-page .room-messages');
+ const day = declarationsOf(chatsCss, '.chats-page .day-separator');
+ const pill = declarationsOf(chatsCss, '.chats-page .day-separator span');
+ return (
+ lengthPx(thread.padding) +
+ lengthPx(day['margin-block'].split(' ')[0]) +
+ lengthPx(pill['padding-block'].split(' ')[0])
+ );
+}
+
// The older-page indicator sat in flow above the oldest bubble, so it pushed the reader's content down by its
// height and one gap when the page was requested, and back up when it landed. The loading pill's height and
// margins add up to minus the thread's gap, so it adds nothing to the scroll height, and the failure is out of
@@ -1420,11 +1440,9 @@ test('the older-page indicator takes no room in the thread, loading or failed',
const box = Math.max(lineClamp * line + 2 * (border + paddingBlock), lengthPx(failed['min-height'], own));
// The text paints into the room the clip leaves it below the last line, past the border.
const ink = border + paddingBlock + lineClamp * line + clipRoom;
- const bubble = rule('.chats-page .message-bubble');
- const textStarts = padding + lengthPx(bubble.padding.split(' ')[0], own);
assert.ok(
- lengthPx(failed.top, own) + Math.max(box, ink) <= textStarts,
- "the failure indicator, at two lines, ends above the first message's text",
+ lengthPx(failed.top, own) + Math.max(box, ink) <= firstTextStartsPx(),
+ "the failure indicator, at two lines, ends above the thread's first text",
);
});
@@ -1538,10 +1556,8 @@ test('the loading label may take two lines in a thread of 18rem or less, and no
const border = lengthPx(base.border.split(' ')[0], own);
const height = lengthPx(base.height, own);
assert.ok(lines * line + 2 * border <= height, 'the two lines fit inside the height of the pill');
- const bubble = declarationsOf(chatsCss, '.chats-page .message-bubble');
- const textStarts = padding + lengthPx(bubble.padding.split(' ')[0], own);
const top = padding + lengthPx(base['margin-top'], own);
- assert.ok(top + height <= textStarts, "the wrapped pill ends above the first message's text");
+ assert.ok(top + height <= firstTextStartsPx(), "the wrapped pill ends above the thread's first text");
});
test('a failed older page renders the whole sentence and the retry instruction as two texts', () => {
@@ -1838,3 +1854,55 @@ test('does not label an unedited or revoked message as edited', () => {
]);
assert.equal(container.querySelector('.message-edited'), null);
});
+
+// Two messages one day apart, and a reply on the second day from the other side.
+const DAY = 86_400;
+const dayThread = (): ChatMessageView[] => [
+ { ...PROMPT, id: 'd1', waMessageId: 'wamid.d1', body: 'first day', metadata: undefined },
+ {
+ ...PROMPT,
+ id: 'd2',
+ waMessageId: 'wamid.d2',
+ body: 'second day',
+ timestamp: PROMPT.timestamp! + DAY,
+ metadata: undefined,
+ },
+ {
+ ...PROMPT,
+ id: 'd3',
+ waMessageId: 'wamid.d3',
+ body: 'reply',
+ direction: 'outgoing',
+ status: 'read',
+ timestamp: PROMPT.timestamp! + DAY + 60,
+ metadata: undefined,
+ },
+];
+
+// The older-page indicator is measured against the first text of the thread, which this pill is: a thread
+// always opens with the day of its first message.
+test('a thread opens with the day of its first message, and each new day gets a pill of its own', () => {
+ const { container } = renderThread('operator', dayThread());
+ const children = Array.from(container.querySelector('.room-messages')!.children);
+ assert.ok(children[0].classList.contains('day-separator'), 'the thread opens with a day pill');
+ assert.equal(container.querySelectorAll('.day-separator').length, 2, 'one pill per day');
+ // A pill is never an anchor the scroll hook holds the reader by: only messages are.
+ assert.ok(!children[0].hasAttribute('data-scroll-anchor'), 'the day pill is not a scroll anchor');
+});
+
+test('the first bubble of a run from one side starts a run, and a new day starts one too', () => {
+ const { container } = renderThread('operator', dayThread());
+ const starts = Array.from(container.querySelectorAll('.message-bubble-wrapper')).map(wrapper =>
+ wrapper.classList.contains('run-start'),
+ );
+ assert.deepEqual(starts, [true, true, true]);
+
+ rtl.cleanup();
+ const sameDay = dayThread().map(message => ({ ...message, direction: 'incoming' as const }));
+ sameDay[0] = { ...sameDay[0], timestamp: sameDay[1].timestamp };
+ const { container: oneRun } = renderThread('operator', sameDay);
+ const runStarts = Array.from(oneRun.querySelectorAll('.message-bubble-wrapper')).map(wrapper =>
+ wrapper.classList.contains('run-start'),
+ );
+ assert.deepEqual(runStarts, [true, false, false], 'one side on one day is a single run');
+});
diff --git a/dashboard/src/components/chats/ChatThread.tsx b/dashboard/src/components/chats/ChatThread.tsx
index 3b771125b..ebc1fca6d 100644
--- a/dashboard/src/components/chats/ChatThread.tsx
+++ b/dashboard/src/components/chats/ChatThread.tsx
@@ -1,4 +1,5 @@
import {
+ Fragment,
useCallback,
useEffect,
useMemo,
@@ -6,11 +7,23 @@ import {
useState,
type FocusEvent,
type KeyboardEvent,
+ type ReactElement,
type SyntheticEvent,
type RefObject,
} from 'react';
import { useTranslation } from 'react-i18next';
-import { AlertCircle, ChevronDown, CornerUpLeft, Loader2, MessageSquare, Smile, Trash2 } from 'lucide-react';
+import {
+ AlertCircle,
+ Check,
+ CheckCheck,
+ ChevronDown,
+ Clock,
+ CornerUpLeft,
+ Loader2,
+ MessageSquare,
+ Smile,
+ Trash2,
+} from 'lucide-react';
import { useRole } from '../../hooks/useRole';
import { sessionApi, type Chat } from '../../services/api';
import {
@@ -35,6 +48,22 @@ const senderColor = (name: string): string => {
return SENDER_COLORS[Math.abs(hash) % SENDER_COLORS.length];
};
+/** A message's time in epoch seconds: the WhatsApp timestamp, else when the gateway stored it. */
+const timestampOf = (msg: ChatMessageView): number =>
+ msg.timestamp || Math.floor(new Date(msg.createdAt).getTime() / 1000);
+
+const sameDay = (a: number, b: number): boolean =>
+ new Date(a * 1000).toDateString() === new Date(b * 1000).toDateString();
+
+// Delivered and read share a glyph and differ in colour only; the span around it spells the status out.
+const STATUS_ICONS: Record<ChatMessageView['status'], ReactElement> = {
+ pending: <Clock size={14} />,
+ sent: <Check size={16} />,
+ delivered: <CheckCheck size={16} />,
+ read: <CheckCheck size={16} />,
+ failed: <AlertCircle size={14} />,
+};
+
interface ChatThreadProps {
/** Needed to fetch a message's media on demand; null before a session is chosen. */
sessionId: string | null;
@@ -92,7 +121,7 @@ function ChatThread({
onDelete,
onClickButton,
}: ChatThreadProps) {
- const { t } = useTranslation();
+ const { t, i18n } = useTranslation();
// Reply, react, delete and prompt taps all need an operator key, like the composer; a viewer
// would only reach a 403.
const { canWrite } = useRole();
@@ -386,10 +415,26 @@ function ChatThread({
setButtonClick({});
}, [activeChat?.id]);
- // Helper formats
+ // Helper formats, in the dashboard's language rather than the browser's.
const formatTime = (timestamp?: number) => {
if (!timestamp) return '';
- return new Date(timestamp * 1000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
+ return new Date(timestamp * 1000).toLocaleTimeString(i18n.language, { hour: '2-digit', minute: '2-digit' });
+ };
+
+ // The pill above the first message of each day: Today, Yesterday, else a short date (with the year
+ // once it is not this year's).
+ const formatDayLabel = (timestamp: number) => {
+ const date = new Date(timestamp * 1000);
+ const yesterday = new Date();
+ yesterday.setDate(yesterday.getDate() - 1);
+ if (date.toDateString() === new Date().toDateString()) return t('chats.today');
+ if (date.toDateString() === yesterday.toDateString()) return t('chats.yesterday');
+ return date.toLocaleDateString(i18n.language, {
+ weekday: 'short',
+ day: '2-digit',
+ month: 'short',
+ ...(date.getFullYear() !== new Date().getFullYear() ? { year: 'numeric' } : {}),
+ });
};
return (
@@ -484,12 +529,17 @@ function ChatThread({
) : (
messages.map((msg, index) => {
const isMe = msg.direction === 'outgoing';
- const formattedTime = formatTime(msg.timestamp || Math.floor(new Date(msg.createdAt).getTime() / 1000));
+ const ts = timestampOf(msg);
+ const formattedTime = formatTime(ts);
// Label who posted, WhatsApp-style: only in groups, only on incoming messages,
// and only on the first of a consecutive run from the same sender (so a burst
// from one person isn't repeated on every bubble).
const prev = messages[index - 1];
+ // A day pill heads the first message of each day. The first bubble of a run from one side
+ // carries the tail and the wider gap, like WhatsApp; a new day starts a new run.
+ const startsNewDay = !prev || !sameDay(timestampOf(prev), ts);
+ const startsRun = startsNewDay || prev.direction !== msg.direction;
const showSender = Boolean(
activeChat?.isGroup &&
!isMe &&
@@ -643,187 +693,202 @@ function ChatThread({
const reactions = msg.metadata?.reactions || {};
const hasReactions = Object.keys(reactions).length > 0;
const isRevoked = msg.type === 'revoked';
+ const isEdited = !isRevoked && Boolean(msg.metadata?.edited);
const isMasked = msg.type === 'masked';
return (
- <div
- key={msg.id}
- className={`message-bubble-wrapper ${isMe ? 'outgoing' : 'incoming'}`}
- data-wa-message-id={msg.waMessageId}
- data-scroll-anchor=""
- >
+ <Fragment key={msg.id}>
+ {/* A sibling of the bubbles, not an anchor: the scroll hook holds the reader by messages only. */}
+ {startsNewDay && (
+ <div className="day-separator">
+ <span>{formatDayLabel(ts)}</span>
+ </div>
+ )}
<div
- className="message-bubble-container"
- {...(hasActions(msg)
- ? {
- 'data-roving-message': '',
- tabIndex: tabStopId === msg.id ? 0 : -1,
- // Only focus on the bubble itself: a link or a button inside it is a stop of its own and
- // must not turn the bubble into the thread's tab stop as well.
- onFocus: (event: FocusEvent<HTMLDivElement>) => {
- if (event.target === event.currentTarget) setFocusedMessageId(msg.id);
- },
- onKeyDown: onBubbleKeyDown,
- }
- : {})}
+ className={`message-bubble-wrapper ${isMe ? 'outgoing' : 'incoming'}${startsRun ? ' run-start' : ''}${
+ hasReactions ? ' has-reactions' : ''
+ }`}
+ data-wa-message-id={msg.waMessageId}
+ data-scroll-anchor=""
>
<div
- className={`message-bubble ${isMe ? 'outgoing' : 'incoming'} ${msg.status} ${
- isMediaMessage ? 'media-type' : ''
- } ${isRevoked ? 'revoked-type' : ''}`}
+ className="message-bubble-container"
+ {...(hasActions(msg)
+ ? {
+ 'data-roving-message': '',
+ tabIndex: tabStopId === msg.id ? 0 : -1,
+ // Only focus on the bubble itself: a link or a button inside it is a stop of its own and
+ // must not turn the bubble into the thread's tab stop as well.
+ onFocus: (event: FocusEvent<HTMLDivElement>) => {
+ if (event.target === event.currentTarget) setFocusedMessageId(msg.id);
+ },
+ onKeyDown: onBubbleKeyDown,
+ }
+ : {})}
>
- {/* Group sender label (WhatsApp-style: coloured name atop the bubble) */}
- {/* Group sender label (WhatsApp-style: coloured name atop the bubble).
+ <div
+ className={`message-bubble ${isMe ? 'outgoing' : 'incoming'} ${msg.status} ${
+ isMediaMessage ? 'media-type' : ''
+ } ${isRevoked ? 'revoked-type' : ''}`}
+ >
+ {/* Group sender label (WhatsApp-style: coloured name atop the bubble) */}
+ {/* Group sender label (WhatsApp-style: coloured name atop the bubble).
Colour keys on the stable sender id, so same-named participants
still get distinct colours; the label shows the human name. */}
- {showSender && (
- <div className="message-sender" style={{ color: senderColor(senderKey(msg)!) }}>
- {msg.chatName}
- </div>
- )}
+ {showSender && (
+ <div className="message-sender" style={{ color: senderColor(senderKey(msg)!) }}>
+ {msg.chatName}
+ </div>
+ )}
- {/* Quoted message display */}
- {msg.metadata?.quotedMessage && (
- <div className="message-quote-box">
- <MessageBody
- text={resolveMentions(msg.metadata.quotedMessage.body, mentionNames)}
- className="quote-body"
- />
- </div>
- )}
+ {/* Quoted message display */}
+ {msg.metadata?.quotedMessage && (
+ <div className="message-quote-box">
+ <MessageBody
+ text={resolveMentions(msg.metadata.quotedMessage.body, mentionNames)}
+ className="quote-body"
+ />
+ </div>
+ )}
- {renderMedia()}
+ {renderMedia()}
+
+ {/* Text flows inline and ends in an invisible spacer as wide as the time and ticks, so the
+ meta tucks into the last line when it fits and wraps below it only when it does not. */}
+ <div className="message-content">
+ {isRevoked ? (
+ <div className="message-text">{t('chats.messageDeleted')}</div>
+ ) : isMasked ? (
+ <div className="message-text message-masked">{t('chats.messageMasked')}</div>
+ ) : (
+ displayBody &&
+ (!mediaInfo || displayBody !== mediaInfo.filename) &&
+ msg.type !== 'location' &&
+ msg.type !== 'call' && (
+ <MessageBody text={resolveMentions(displayBody, mentionNames)} className="message-text" />
+ )
+ )}
- {isRevoked ? (
- <div className="message-text">{t('chats.messageDeleted')}</div>
- ) : isMasked ? (
- <div className="message-text message-masked">{t('chats.messageMasked')}</div>
- ) : (
- displayBody &&
- (!mediaInfo || displayBody !== mediaInfo.filename) &&
- msg.type !== 'location' &&
- msg.type !== 'call' && (
- <MessageBody text={resolveMentions(displayBody, mentionNames)} className="message-text" />
- )
- )}
+ {!isRevoked && msg.type === 'poll' && (msg.metadata?.poll?.options?.length ?? 0) > 0 && (
+ <ul className="message-text message-poll-options" aria-label={t('messageTester.pollOptions')}>
+ {msg.metadata!.poll!.options.map((option, index) => (
+ <li key={index}>
+ <bdi>{option}</bdi>
+ </li>
+ ))}
+ </ul>
+ )}
- {!isRevoked && msg.type === 'poll' && (msg.metadata?.poll?.options?.length ?? 0) > 0 && (
- <ul className="message-text" aria-label={t('messageTester.pollOptions')}>
- {msg.metadata!.poll!.options.map((option, index) => (
- <li key={index}>
- <bdi>{option}</bdi>
- </li>
- ))}
- </ul>
- )}
+ {/* Inbound business prompt choices; a tap calls POST .../messages/click-button. */}
+ {!isMe && !isRevoked && !isMasked && (msg.metadata?.buttons?.length ?? 0) > 0 && (
+ <div className="message-prompt-buttons" role="group" aria-label={t('chats.promptButtons')}>
+ {msg.metadata!.buttons!.map((btn, idx) => {
+ const clickKey = msg.waMessageId || msg.id;
+ const state = buttonClick[clickKey];
+ const loading = state?.loadingId === btn.id;
+ const disabled = Boolean(state?.loadingId || state?.done);
+ return (
+ <button
+ key={`${idx}:${btn.id}`}
+ type="button"
+ className={`message-prompt-button${state?.selectedId === btn.id ? ' selected' : ''}${state?.done ? ' answered' : ''}`}
+ disabled={disabled || !canWrite}
+ onClick={() => void handleClickButton(msg, btn)}
+ >
+ {loading ? <Loader2 size={14} className="animate-spin" /> : btn.text}
+ </button>
+ );
+ })}
+ </div>
+ )}
- {/* Inbound business prompt choices; a tap calls POST .../messages/click-button. */}
- {!isMe && !isRevoked && !isMasked && (msg.metadata?.buttons?.length ?? 0) > 0 && (
- <div className="message-prompt-buttons" role="group" aria-label={t('chats.promptButtons')}>
- {msg.metadata!.buttons!.map((btn, idx) => {
- const clickKey = msg.waMessageId || msg.id;
- const state = buttonClick[clickKey];
- const loading = state?.loadingId === btn.id;
- const disabled = Boolean(state?.loadingId || state?.done);
- return (
- <button
- key={`${idx}:${btn.id}`}
- type="button"
- className={`message-prompt-button${state?.selectedId === btn.id ? ' selected' : ''}${state?.done ? ' answered' : ''}`}
- disabled={disabled || !canWrite}
- onClick={() => void handleClickButton(msg, btn)}
+ {/* Holds the room the time (and an edited label, whose width the language decides) takes
+ at the end of the last line, so the text never runs under them. */}
+ <span className={`meta-spacer${isMe ? ' with-status' : ''}`} aria-hidden="true">
+ {isEdited && <span className="meta-spacer-edited">{t('chats.edited')}</span>}
+ </span>
+ <span className="message-meta">
+ {isEdited && <span className="message-edited">{t('chats.edited')}</span>}
+ <span className="message-time">{formattedTime}</span>
+ {/* delivered and read render the SAME glyph and differ only in colour, which
+ carries the meaning nowhere a screen reader or a colour-blind reader can
+ reach it. The status is spelled out for both. */}
+ {isMe && (
+ <span
+ className={`message-status-icon ${msg.status}`}
+ role="img"
+ aria-label={t(`chats.messageStatus.${msg.status}`)}
+ title={t(`chats.messageStatus.${msg.status}`)}
>
- {loading ? <Loader2 size={14} className="animate-spin" /> : btn.text}
- </button>
- );
- })}
+ {STATUS_ICONS[msg.status]}
+ </span>
+ )}
+ </span>
</div>
- )}
- <div className="message-meta">
- {!isRevoked && msg.metadata?.edited && <span className="message-edited">{t('chats.edited')}</span>}
- <span className="message-time">{formattedTime}</span>
- {/* delivered and read render the SAME glyph and differ only in colour, which
- carries the meaning nowhere a screen reader or a colour-blind reader can
- reach it. The status is spelled out for both. */}
- {isMe && (
- <span
- className={`message-status-icon ${msg.status}`}
- role="img"
- aria-label={t(`chats.messageStatus.${msg.status}`)}
- title={t(`chats.messageStatus.${msg.status}`)}
- >
- {msg.status === 'pending' && '🕒'}
- {msg.status === 'sent' && '✓'}
- {msg.status === 'delivered' && '✓✓'}
- {msg.status === 'read' && '✓✓'}
- {msg.status === 'failed' && '⚠️'}
- </span>
+ {/* Reactions display */}
+ {hasReactions && (
+ <div className="message-reactions-badge">
+ {Object.values(reactions)
+ .slice(0, 3)
+ .map((emoji, idx) => (
+ <span key={idx} className="reaction-emoji-span">
+ {emoji}
+ </span>
+ ))}
+ {Object.keys(reactions).length > 1 && (
+ <span className="reactions-count-span">{Object.keys(reactions).length}</span>
+ )}
+ </div>
)}
</div>
- {/* Reactions display */}
- {hasReactions && (
- <div className="message-reactions-badge">
- {Object.values(reactions)
- .slice(0, 3)
- .map((emoji, idx) => (
- <span key={idx} className="reaction-emoji-span">
- {emoji}
- </span>
- ))}
- {Object.keys(reactions).length > 1 && (
- <span className="reactions-count-span">{Object.keys(reactions).length}</span>
- )}
- </div>
- )}
- </div>
-
- {/* Message actions menu (hover, or focus inside the bubble). Every action addresses the message by its WhatsApp
+ {/* Message actions menu (hover, or focus inside the bubble). Every action addresses the message by its WhatsApp
id, so an optimistic bubble still on its local temp_ id (pending, or failed for
good) offers none: the gateway could never resolve it. */}
- {canWrite && !isRevoked && Boolean(msg.waMessageId) && (
- <div className="message-actions-menu">
- <button
- type="button"
- className="action-btn"
- onClick={() => onReply(msg)}
- title={t('chats.actions.reply')}
- >
- <CornerUpLeft size={14} />
- </button>
-
- <div
- className="reaction-trigger-wrapper"
- onMouseEnter={fitReactionPopover}
- onFocus={fitReactionPopover}
- >
- <button type="button" className="action-btn reaction-btn" title={t('chats.actions.react')}>
- <Smile size={14} />
- </button>
- <div className="reaction-quick-popover">
- {['👍', '❤️', '😂', '😮', '😢', '🙏'].map(emoji => (
- <button key={emoji} type="button" onClick={() => onReact(msg, emoji)}>
- {emoji}
- </button>
- ))}
- </div>
- </div>
-
- {isMe && msg.status !== 'pending' && (
+ {canWrite && !isRevoked && Boolean(msg.waMessageId) && (
+ <div className="message-actions-menu">
<button
type="button"
- className="action-btn delete-btn"
- onClick={() => onDelete(msg)}
- title={t('chats.actions.delete')}
+ className="action-btn"
+ onClick={() => onReply(msg)}
+ title={t('chats.actions.reply')}
>
- <Trash2 size={14} />
+ <CornerUpLeft size={14} />
</button>
- )}
- </div>
- )}
+
+ <div
+ className="reaction-trigger-wrapper"
+ onMouseEnter={fitReactionPopover}
+ onFocus={fitReactionPopover}
+ >
+ <button type="button" className="action-btn reaction-btn" title={t('chats.actions.react')}>
+ <Smile size={14} />
+ </button>
+ <div className="reaction-quick-popover">
+ {['👍', '❤️', '😂', '😮', '😢', '🙏'].map(emoji => (
+ <button key={emoji} type="button" onClick={() => onReact(msg, emoji)}>
+ {emoji}
+ </button>
+ ))}
+ </div>
+ </div>
+
+ {isMe && msg.status !== 'pending' && (
+ <button
+ type="button"
+ className="action-btn delete-btn"
+ onClick={() => onDelete(msg)}
+ title={t('chats.actions.delete')}
+ >
+ <Trash2 size={14} />
+ </button>
+ )}
+ </div>
+ )}
+ </div>
</div>
- </div>
+ </Fragment>
);
})
)}
diff --git a/dashboard/src/components/chats/GroupInfoDialog.tsx b/dashboard/src/components/chats/GroupInfoDialog.tsx
index e39151c00..0213c12ac 100644
--- a/dashboard/src/components/chats/GroupInfoDialog.tsx
+++ b/dashboard/src/components/chats/GroupInfoDialog.tsx
@@ -280,7 +280,13 @@ function GroupInfoDialog({ session, group, onClose, onRenamed }: GroupInfoDialog
<img src={newPicture.preview} alt="" />
</span>
) : (
- <ChatAvatar pictureUrl={picture.data} kind="group" size="lg" onImageError={() => picture.refetch()} />
+ <ChatAvatar
+ chatId={group.id}
+ pictureUrl={picture.data}
+ kind="group"
+ size="lg"
+ onImageError={() => picture.refetch()}
+ />
)}
<span>{canEditInfo ? t('chats.group.pictureHint') : t('chats.group.readOnlyHint')}</span>
</button>
@@ -345,7 +351,7 @@ function GroupInfoDialog({ session, group, onClose, onRenamed }: GroupInfoDialog
const label = own ? t('chats.you') : p.name || formatPhoneForDisplay(p.number) || p.number;
return (
<li key={p.id}>
- <ChatAvatar kind="individual" />
+ <ChatAvatar chatId={p.id} kind="individual" size="sm" />
<span className="group-info-member">
<bdi className="name">{label}</bdi>
{p.name && (
diff --git a/dashboard/src/components/chats/KindIcon.tsx b/dashboard/src/components/chats/KindIcon.tsx
index 759e2489c..72fc2aa0f 100644
--- a/dashboard/src/components/chats/KindIcon.tsx
+++ b/dashboard/src/components/chats/KindIcon.tsx
@@ -1,11 +1,11 @@
import { User, Users, Megaphone, CircleDashed } from 'lucide-react';
import type { ChatKind } from '../../services/api';
-function KindIcon({ kind, size = 20 }: { kind: ChatKind; size?: number }) {
- if (kind === 'group' || kind === 'broadcast') return <Users size={size} />;
- if (kind === 'channel') return <Megaphone size={size} />;
- if (kind === 'status') return <CircleDashed size={size} />;
- return <User size={size} />;
+function KindIcon({ kind, size = 20, strokeWidth }: { kind: ChatKind; size?: number; strokeWidth?: number }) {
+ if (kind === 'group' || kind === 'broadcast') return <Users size={size} strokeWidth={strokeWidth} />;
+ if (kind === 'channel') return <Megaphone size={size} strokeWidth={strokeWidth} />;
+ if (kind === 'status') return <CircleDashed size={size} strokeWidth={strokeWidth} />;
+ return <User size={size} strokeWidth={strokeWidth} />;
}
export default KindIcon;
diff --git a/dashboard/src/components/chats/NewChatPanel.tsx b/dashboard/src/components/chats/NewChatPanel.tsx
index 091603970..7df89d2ab 100644
--- a/dashboard/src/components/chats/NewChatPanel.tsx
+++ b/dashboard/src/components/chats/NewChatPanel.tsx
@@ -329,7 +329,7 @@ function NewChatPanel({ sessionId, onOpenChat, onClose }: NewChatPanelProps) {
: onOpenChat(draftChat(c.id, c.name || '', 'individual'), sessionId)
}
>
- <ChatAvatar kind="individual" />
+ <ChatAvatar chatId={c.id} kind="individual" />
<span className="chat-item-info">
<span className="chat-item-name">{label}</span>
{phone && phone !== label && (
diff --git a/dashboard/src/components/chats/SessionPicker.tsx b/dashboard/src/components/chats/SessionPicker.tsx
new file mode 100644
index 000000000..f1f513652
--- /dev/null
+++ b/dashboard/src/components/chats/SessionPicker.tsx
@@ -0,0 +1,258 @@
+import { useEffect, useId, useRef, useState, type KeyboardEvent } from 'react';
+import { Link, useInRouterContext } from 'react-router-dom';
+import { useTranslation } from 'react-i18next';
+import { Check, ChevronDown, ChevronRight, Plus, Search } from 'lucide-react';
+import type { Session } from '../../services/api';
+import { useProfilePicture } from '../../hooks/useProfilePicture';
+import { formatPhoneForDisplay } from '../../utils/formatPhone';
+import { flagOfRegion, regionOfPhone } from '../../utils/phoneCountry';
+
+interface SessionPickerProps {
+ /** Every session the gateway lists; only a ready one can be picked. */
+ sessions: Session[];
+ selectedSessionId: string;
+ onSelectSession: (sessionId: string) => void;
+ /** Offers the link to the Sessions page, where an operator pairs another number. */
+ canAddSession: boolean;
+}
+
+/** Two initials from a session's name: "Marie Haas" → "MH", "support" → "SU". */
+const initialsOf = (name: string): string => {
+ const words = name
+ .trim()
+ .split(/[\s_-]+/)
+ .filter(Boolean);
+ const letters = words.length > 1 ? words[0][0] + words[1][0] : (words[0] ?? '?').slice(0, 2);
+ return letters.toUpperCase();
+};
+
+// Green for a connected session, amber while one is on its way, red for one that needs a hand.
+const statusTone = (status: Session['status']): 'ready' | 'pending' | 'down' =>
+ status === 'ready'
+ ? 'ready'
+ : status === 'initializing' || status === 'authenticating' || status === 'qr_ready'
+ ? 'pending'
+ : 'down';
+
+/** The flag and the formatted number, e.g. "🇩🇪 +49 174 712 7865". */
+function PhoneLine({ phone }: { phone?: string | null }) {
+ const { t } = useTranslation();
+ if (!phone) return <>{t('chats.noPhone')}</>;
+ const region = regionOfPhone(phone);
+ return (
+ <>
+ {region && (
+ <span className="session-flag" aria-hidden="true">
+ {flagOfRegion(region)}
+ </span>
+ )}
+ {/* Digits and + carry no direction of their own: without ltr a right-to-left page reverses them. */}
+ <bdi dir="ltr">{formatPhoneForDisplay(phone) ?? phone}</bdi>
+ </>
+ );
+}
+
+// The account's own profile picture, read through the session itself, so only a ready session has one.
+// The initials stand in while it loads, when the account hides it, or when the session is down.
+function SessionAvatar({ session, size }: { session: Session; size: 'md' | 'sm' }) {
+ const { t } = useTranslation();
+ const ownJid = session.phone ? `${session.phone.replace(/\D/g, '')}@c.us` : undefined;
+ const picture = useProfilePicture(session.status === 'ready' ? session.id : undefined, ownJid);
+ const tone = statusTone(session.status);
+ return (
+ <span className={`session-avatar ${size}`}>
+ {picture.data ? (
+ <img src={picture.data} alt="" onError={() => picture.refetch()} />
+ ) : (
+ <span aria-hidden="true">{initialsOf(session.name)}</span>
+ )}
+ <span
+ className={`session-status-dot ${tone}`}
+ role="img"
+ aria-label={t(`sessionStatus.${session.status}`)}
+ title={t(`sessionStatus.${session.status}`)}
+ />
+ </span>
+ );
+}
+
+// Only inside a router: the page also renders in tests that mount it without one.
+function AddSessionLink({ onFollow }: { onFollow: () => void }) {
+ const { t } = useTranslation();
+ return (
+ <Link to="/sessions" className="session-picker-add" onClick={onFollow}>
+ <span className="session-avatar sm add" aria-hidden="true">
+ <Plus size={20} />
+ </span>
+ <span className="session-text">
+ <span className="session-name">{t('chats.sessionPicker.addTitle')}</span>
+ <span className="session-phone">{t('chats.sessionPicker.addHint')}</span>
+ </span>
+ <ChevronRight size={18} className="session-picker-add-chevron" />
+ </Link>
+ );
+}
+
+/**
+ * The account switcher in the chat sidebar's header: the selected session's picture, name and number,
+ * opening a searchable list of every session with its connection state. A list that also shows the
+ * sessions that cannot be opened right now says why a number is missing from the chats.
+ */
+function SessionPicker({ sessions, selectedSessionId, onSelectSession, canAddSession }: SessionPickerProps) {
+ const { t } = useTranslation();
+ const inRouter = useInRouterContext();
+ const [open, setOpen] = useState(false);
+ const [query, setQuery] = useState('');
+ const rootRef = useRef<HTMLDivElement | null>(null);
+ const triggerRef = useRef<HTMLButtonElement | null>(null);
+ const listRef = useRef<HTMLUListElement | null>(null);
+ const listId = useId();
+
+ const selected = sessions.find(s => s.id === selectedSessionId);
+ const needle = query.trim().toLowerCase();
+ const digits = query.replace(/\D/g, '');
+ const shown = needle
+ ? sessions.filter(
+ s =>
+ [s.name, s.pushName].some(field => field?.toLowerCase().includes(needle)) ||
+ (digits.length > 0 && (s.phone ?? '').includes(digits)),
+ )
+ : sessions;
+
+ const close = (refocus: boolean) => {
+ setOpen(false);
+ setQuery('');
+ if (refocus) triggerRef.current?.focus();
+ };
+
+ // Closes on a press outside and on Escape. Escape is taken in the capture phase and marked handled,
+ // like the emoji picker's, so the page's own Escape handler leaves the open chat alone.
+ useEffect(() => {
+ if (!open) return;
+ const onPress = (event: MouseEvent) => {
+ if (rootRef.current?.contains(event.target as Node)) return;
+ setOpen(false);
+ setQuery('');
+ };
+ const onEscape = (event: globalThis.KeyboardEvent) => {
+ if (event.key !== 'Escape' || event.isComposing || event.defaultPrevented) return;
+ event.preventDefault();
+ setOpen(false);
+ setQuery('');
+ triggerRef.current?.focus();
+ };
+ document.addEventListener('mousedown', onPress);
+ document.addEventListener('keydown', onEscape, true);
+ return () => {
+ document.removeEventListener('mousedown', onPress);
+ document.removeEventListener('keydown', onEscape, true);
+ };
+ }, [open]);
+
+ const options = () => Array.from(listRef.current?.querySelectorAll<HTMLButtonElement>('[role="option"]') ?? []);
+
+ // Arrow keys walk the options, from the search box into the list and back.
+ const onListKeyDown = (event: KeyboardEvent<HTMLElement>) => {
+ if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;
+ const all = options().filter(option => !option.disabled);
+ if (all.length === 0) return;
+ event.preventDefault();
+ const at = all.indexOf(document.activeElement as HTMLButtonElement);
+ const next = event.key === 'ArrowDown' ? all[Math.min(at + 1, all.length - 1)] : at <= 0 ? null : all[at - 1];
+ if (next) next.focus();
+ else rootRef.current?.querySelector<HTMLInputElement>('.session-picker-search input')?.focus();
+ };
+
+ const pick = (session: Session) => {
+ if (session.id !== selectedSessionId) onSelectSession(session.id);
+ close(true);
+ };
+
+ return (
+ <div className="session-switcher" ref={rootRef}>
+ <button
+ ref={triggerRef}
+ type="button"
+ className="session-switcher-btn"
+ onClick={() => (open ? close(false) : setOpen(true))}
+ aria-haspopup="listbox"
+ aria-expanded={open}
+ aria-controls={open ? listId : undefined}
+ title={t('chats.switchSession')}
+ >
+ {selected && <SessionAvatar session={selected} size="md" />}
+ <span className="session-text">
+ <span className="session-name">{selected?.name}</span>
+ <span className="session-phone">
+ <PhoneLine phone={selected?.phone} />
+ </span>
+ </span>
+ <ChevronDown size={18} className={`session-chevron ${open ? 'open' : ''}`} />
+ </button>
+
+ {open && (
+ <div className="session-picker" onKeyDown={onListKeyDown}>
+ <div className="session-picker-search">
+ <Search size={18} />
+ <input
+ type="text"
+ value={query}
+ onChange={e => setQuery(e.target.value)}
+ placeholder={t('chats.sessionPicker.searchPlaceholder')}
+ aria-label={t('chats.sessionPicker.searchPlaceholder')}
+ aria-controls={listId}
+ autoFocus
+ />
+ </div>
+ <ul
+ className="session-picker-list"
+ role="listbox"
+ id={listId}
+ aria-label={t('chats.sessionLabel')}
+ ref={listRef}
+ >
+ {shown.length === 0 ? (
+ <li className="session-picker-empty">{t('chats.sessionPicker.noMatch')}</li>
+ ) : (
+ shown.map(session => {
+ const isSelected = session.id === selectedSessionId;
+ const ready = session.status === 'ready';
+ return (
+ <li key={session.id} role="presentation">
+ <button
+ type="button"
+ role="option"
+ aria-selected={isSelected}
+ disabled={!ready}
+ className={`session-picker-option ${isSelected ? 'selected' : ''}`}
+ onClick={() => pick(session)}
+ title={ready ? undefined : t(`sessionStatus.${session.status}`)}
+ >
+ <SessionAvatar session={session} size="sm" />
+ <span className="session-text">
+ <span className="session-name">{session.name}</span>
+ <span className="session-phone">
+ {session.pushName && (
+ <>
+ <bdi>{session.pushName}</bdi>
+ <span aria-hidden="true"> · </span>
+ </>
+ )}
+ <PhoneLine phone={session.phone} />
+ </span>
+ </span>
+ {isSelected && <Check size={18} className="session-check" />}
+ </button>
+ </li>
+ );
+ })
+ )}
+ </ul>
+ {canAddSession && inRouter && <AddSessionLink onFollow={() => close(false)} />}
+ </div>
+ )}
+ </div>
+ );
+}
+
+export default SessionPicker;
diff --git a/dashboard/src/components/chats/chatActionItems.tsx b/dashboard/src/components/chats/chatActionItems.tsx
index 0be069ff7..17821757e 100644
--- a/dashboard/src/components/chats/chatActionItems.tsx
+++ b/dashboard/src/components/chats/chatActionItems.tsx
@@ -13,13 +13,15 @@ import {
PinOff,
ShieldCheck,
Trash2,
+ User,
UserPen,
} from 'lucide-react';
import type { Chat } from '../../services/api';
-/** What a chat can be asked to do from its row or its room. Every one but group info is an operator route. */
+/** What a chat can be asked to do from its row or its room. Every one but the info views is an operator route. */
export interface ChatRowActions {
onGroupInfo: (chat: Chat) => void;
+ onContactInfo?: (chat: Chat) => void;
onSaveContact?: (chat: Chat) => void;
/** Whether the chat has a phone-based id the address book accepts; Save is offered disabled otherwise. */
canSaveContact?: (chat: Chat) => boolean;
@@ -66,6 +68,7 @@ export function chatActionItems(chat: Chat, actions: ChatRowActions, t: (key: st
if (group) add(actions.onGroupInfo, { key: 'info', icon: <Info size={18} />, label: t('chats.group.info') });
if (direct) {
+ add(actions.onContactInfo, { key: 'contact', icon: <User size={18} />, label: t('chats.contactInfo') });
const addressable = actions.canSaveContact?.(chat) ?? true;
add(actions.onSaveContact, {
key: 'save',
diff --git a/dashboard/src/i18n/locales/ar.json b/dashboard/src/i18n/locales/ar.json
index ed4b98cfb..b51c030f0 100644
--- a/dashboard/src/i18n/locales/ar.json
+++ b/dashboard/src/i18n/locales/ar.json
@@ -224,6 +224,9 @@
"read": "تمت القراءة",
"failed": "فشل"
},
+ "today": "اليوم",
+ "switchSession": "تبديل الجلسة",
+ "searchMessages": "البحث في الرسائل",
"clearSearch": "مسح البحث",
"filters": {
"label": "تصفية المحادثات",
@@ -234,11 +237,13 @@
"unknown": "غير معروف"
},
"noFilterResults": "لا توجد محادثات مطابقة لهذا الفلتر",
+ "contactInfo": "معلومات جهة الاتصال",
"moreActions": "إجراءات إضافية",
"copyChatId": "نسخ معرّف المحادثة",
"chatIdCopied": "تم نسخ معرّف المحادثة",
"copyFailed": "تعذّر النسخ إلى الحافظة",
"closeChat": "إغلاق المحادثة",
+ "phone": "رقم الهاتف",
"chatId": "معرّف المحادثة",
"newChat": {
"title": "محادثة جديدة",
@@ -264,6 +269,12 @@
"createFailed": "تعذّر إنشاء المجموعة",
"removeParticipant": "إزالة {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "ابحث في الجلسات...",
+ "noMatch": "لا توجد جلسة مطابقة",
+ "addTitle": "ربط رقم آخر",
+ "addHint": "أنشئ جلسة واربطها برمز QR"
+ },
"group": {
"info": "معلومات المجموعة",
"leave": "مغادرة المجموعة",
diff --git a/dashboard/src/i18n/locales/de.json b/dashboard/src/i18n/locales/de.json
index 689bbb13a..4570576e4 100644
--- a/dashboard/src/i18n/locales/de.json
+++ b/dashboard/src/i18n/locales/de.json
@@ -203,6 +203,9 @@
"read": "Gelesen",
"failed": "Fehlgeschlagen"
},
+ "today": "Heute",
+ "switchSession": "Sitzung wechseln",
+ "searchMessages": "Nachrichten durchsuchen",
"clearSearch": "Suche leeren",
"filters": {
"label": "Chats filtern",
@@ -213,11 +216,13 @@
"unknown": "Unbekannt"
},
"noFilterResults": "Keine Chats für diesen Filter",
+ "contactInfo": "Kontaktinfo",
"moreActions": "Weitere Aktionen",
"copyChatId": "Chat-ID kopieren",
"chatIdCopied": "Chat-ID kopiert",
"copyFailed": "Kopieren in die Zwischenablage fehlgeschlagen",
"closeChat": "Chat schließen",
+ "phone": "Telefonnummer",
"chatId": "Chat-ID",
"newChat": {
"title": "Neuer Chat",
@@ -243,6 +248,12 @@
"createFailed": "Gruppe konnte nicht erstellt werden",
"removeParticipant": "{{name}} entfernen"
},
+ "sessionPicker": {
+ "searchPlaceholder": "Sitzung suchen...",
+ "noMatch": "Keine passende Sitzung",
+ "addTitle": "Weitere Nummer koppeln",
+ "addHint": "Sitzung anlegen und per QR-Code verbinden"
+ },
"group": {
"info": "Gruppeninfo",
"leave": "Gruppe verlassen",
diff --git a/dashboard/src/i18n/locales/en.json b/dashboard/src/i18n/locales/en.json
index 31fa8cb49..d1953e4b8 100644
--- a/dashboard/src/i18n/locales/en.json
+++ b/dashboard/src/i18n/locales/en.json
@@ -203,6 +203,9 @@
"read": "Read",
"failed": "Failed"
},
+ "today": "Today",
+ "switchSession": "Switch session",
+ "searchMessages": "Search messages",
"clearSearch": "Clear search",
"filters": {
"label": "Filter chats",
@@ -213,11 +216,13 @@
"unknown": "Unknown"
},
"noFilterResults": "No chats match this filter",
+ "contactInfo": "Contact info",
"moreActions": "More actions",
"copyChatId": "Copy chat ID",
"chatIdCopied": "Chat ID copied",
"copyFailed": "Could not copy to clipboard",
"closeChat": "Close chat",
+ "phone": "Phone number",
"chatId": "Chat ID",
"newChat": {
"title": "New chat",
@@ -243,6 +248,12 @@
"createFailed": "Could not create the group",
"removeParticipant": "Remove {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "Search sessions...",
+ "noMatch": "No session matches",
+ "addTitle": "Pair another number",
+ "addHint": "Create a session and link it with a QR code"
+ },
"group": {
"info": "Group info",
"leave": "Leave group",
diff --git a/dashboard/src/i18n/locales/es.json b/dashboard/src/i18n/locales/es.json
index 49b31b4d2..6f5f0ab1d 100644
--- a/dashboard/src/i18n/locales/es.json
+++ b/dashboard/src/i18n/locales/es.json
@@ -208,6 +208,9 @@
"read": "Leído",
"failed": "Fallido"
},
+ "today": "Hoy",
+ "switchSession": "Cambiar sesión",
+ "searchMessages": "Buscar mensajes",
"clearSearch": "Borrar búsqueda",
"filters": {
"label": "Filtrar chats",
@@ -218,11 +221,13 @@
"unknown": "Desconocidos"
},
"noFilterResults": "Ningún chat coincide con este filtro",
+ "contactInfo": "Info. del contacto",
"moreActions": "Más acciones",
"copyChatId": "Copiar ID del chat",
"chatIdCopied": "ID del chat copiado",
"copyFailed": "No se pudo copiar al portapapeles",
"closeChat": "Cerrar chat",
+ "phone": "Número de teléfono",
"chatId": "ID del chat",
"newChat": {
"title": "Nuevo chat",
@@ -248,6 +253,12 @@
"createFailed": "No se pudo crear el grupo",
"removeParticipant": "Quitar a {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "Buscar sesiones...",
+ "noMatch": "Ninguna sesión coincide",
+ "addTitle": "Vincular otro número",
+ "addHint": "Crea una sesión y vincúlala con un código QR"
+ },
"group": {
"info": "Info. del grupo",
"leave": "Salir del grupo",
diff --git a/dashboard/src/i18n/locales/fr.json b/dashboard/src/i18n/locales/fr.json
index 1779063aa..386524715 100644
--- a/dashboard/src/i18n/locales/fr.json
+++ b/dashboard/src/i18n/locales/fr.json
@@ -208,6 +208,9 @@
"read": "Lu",
"failed": "Échec"
},
+ "today": "Aujourd'hui",
+ "switchSession": "Changer de session",
+ "searchMessages": "Rechercher des messages",
"clearSearch": "Effacer la recherche",
"filters": {
"label": "Filtrer les discussions",
@@ -218,11 +221,13 @@
"unknown": "Inconnus"
},
"noFilterResults": "Aucune discussion ne correspond à ce filtre",
+ "contactInfo": "Infos du contact",
"moreActions": "Plus d’actions",
"copyChatId": "Copier l’ID de la discussion",
"chatIdCopied": "ID de la discussion copié",
"copyFailed": "Impossible de copier dans le presse-papiers",
"closeChat": "Fermer la discussion",
+ "phone": "Numéro de téléphone",
"chatId": "ID de la discussion",
"newChat": {
"title": "Nouvelle discussion",
@@ -248,6 +253,12 @@
"createFailed": "Impossible de créer le groupe",
"removeParticipant": "Retirer {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "Rechercher des sessions...",
+ "noMatch": "Aucune session ne correspond",
+ "addTitle": "Associer un autre numéro",
+ "addHint": "Créez une session et associez-la avec un code QR"
+ },
"group": {
"info": "Infos du groupe",
"leave": "Quitter le groupe",
diff --git a/dashboard/src/i18n/locales/he.json b/dashboard/src/i18n/locales/he.json
index f484eae4f..9b7a25e26 100644
--- a/dashboard/src/i18n/locales/he.json
+++ b/dashboard/src/i18n/locales/he.json
@@ -214,6 +214,9 @@
"read": "נקרא",
"failed": "נכשל"
},
+ "today": "היום",
+ "switchSession": "החלפת סשן",
+ "searchMessages": "חיפוש הודעות",
"clearSearch": "ניקוי החיפוש",
"filters": {
"label": "סינון שיחות",
@@ -224,11 +227,13 @@
"unknown": "לא מוכרים"
},
"noFilterResults": "אין צ׳אטים שתואמים למסנן זה",
+ "contactInfo": "פרטי איש קשר",
"moreActions": "פעולות נוספות",
"copyChatId": "העתקת מזהה הצ׳אט",
"chatIdCopied": "מזהה הצ׳אט הועתק",
"copyFailed": "ההעתקה ללוח נכשלה",
"closeChat": "סגירת הצ׳אט",
+ "phone": "מספר טלפון",
"chatId": "מזהה צ׳אט",
"newChat": {
"title": "צ׳אט חדש",
@@ -254,6 +259,12 @@
"createFailed": "לא ניתן ליצור את הקבוצה",
"removeParticipant": "הסרת {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "חיפוש סשנים...",
+ "noMatch": "אין סשן תואם",
+ "addTitle": "קישור מספר נוסף",
+ "addHint": "יצירת סשן וקישורו באמצעות קוד QR"
+ },
"group": {
"info": "פרטי הקבוצה",
"leave": "יציאה מהקבוצה",
diff --git a/dashboard/src/i18n/locales/hi.json b/dashboard/src/i18n/locales/hi.json
index 4024ae7a1..6dbb71463 100644
--- a/dashboard/src/i18n/locales/hi.json
+++ b/dashboard/src/i18n/locales/hi.json
@@ -203,6 +203,9 @@
"read": "पढ़ा गया",
"failed": "विफल"
},
+ "today": "आज",
+ "switchSession": "सत्र बदलें",
+ "searchMessages": "संदेश खोजें",
"clearSearch": "खोज साफ़ करें",
"filters": {
"label": "चैट फ़िल्टर करें",
@@ -213,11 +216,13 @@
"unknown": "अज्ञात"
},
"noFilterResults": "इस फ़िल्टर से कोई चैट मेल नहीं खाता",
+ "contactInfo": "संपर्क जानकारी",
"moreActions": "और विकल्प",
"copyChatId": "चैट आईडी कॉपी करें",
"chatIdCopied": "चैट आईडी कॉपी हो गई",
"copyFailed": "क्लिपबोर्ड पर कॉपी नहीं हो सका",
"closeChat": "चैट बंद करें",
+ "phone": "फ़ोन नंबर",
"chatId": "चैट आईडी",
"newChat": {
"title": "नई चैट",
@@ -243,6 +248,12 @@
"createFailed": "समूह नहीं बनाया जा सका",
"removeParticipant": "{{name}} हटाएँ"
},
+ "sessionPicker": {
+ "searchPlaceholder": "सत्र खोजें...",
+ "noMatch": "कोई सत्र मेल नहीं खाता",
+ "addTitle": "एक और नंबर जोड़ें",
+ "addHint": "सत्र बनाएँ और QR कोड से लिंक करें"
+ },
"group": {
"info": "समूह जानकारी",
"leave": "समूह छोड़ें",
diff --git a/dashboard/src/i18n/locales/id.json b/dashboard/src/i18n/locales/id.json
index 551bb7036..bdff4d5af 100644
--- a/dashboard/src/i18n/locales/id.json
+++ b/dashboard/src/i18n/locales/id.json
@@ -203,6 +203,9 @@
"read": "Dibaca",
"failed": "Gagal"
},
+ "today": "Hari ini",
+ "switchSession": "Ganti sesi",
+ "searchMessages": "Cari pesan",
"clearSearch": "Hapus pencarian",
"filters": {
"label": "Filter obrolan",
@@ -213,11 +216,13 @@
"unknown": "Tidak dikenal"
},
"noFilterResults": "Tidak ada obrolan yang cocok dengan filter ini",
+ "contactInfo": "Info kontak",
"moreActions": "Tindakan lainnya",
"copyChatId": "Salin ID obrolan",
"chatIdCopied": "ID obrolan disalin",
"copyFailed": "Tidak dapat menyalin ke papan klip",
"closeChat": "Tutup obrolan",
+ "phone": "Nomor telepon",
"chatId": "ID obrolan",
"newChat": {
"title": "Obrolan baru",
@@ -243,6 +248,12 @@
"createFailed": "Tidak dapat membuat grup",
"removeParticipant": "Hapus {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "Cari sesi...",
+ "noMatch": "Tidak ada sesi yang cocok",
+ "addTitle": "Tautkan nomor lain",
+ "addHint": "Buat sesi dan tautkan dengan kode QR"
+ },
"group": {
"info": "Info grup",
"leave": "Keluar dari grup",
diff --git a/dashboard/src/i18n/locales/it.json b/dashboard/src/i18n/locales/it.json
index aafb04045..3a15a8f18 100644
--- a/dashboard/src/i18n/locales/it.json
+++ b/dashboard/src/i18n/locales/it.json
@@ -208,6 +208,9 @@
"read": "Letto",
"failed": "Fallito"
},
+ "today": "Oggi",
+ "switchSession": "Cambia sessione",
+ "searchMessages": "Cerca messaggi",
"clearSearch": "Cancella ricerca",
"filters": {
"label": "Filtra chat",
@@ -218,11 +221,13 @@
"unknown": "Sconosciuti"
},
"noFilterResults": "Nessuna chat corrisponde a questo filtro",
+ "contactInfo": "Info contatto",
"moreActions": "Altre azioni",
"copyChatId": "Copia ID chat",
"chatIdCopied": "ID chat copiato",
"copyFailed": "Impossibile copiare negli appunti",
"closeChat": "Chiudi chat",
+ "phone": "Numero di telefono",
"chatId": "ID chat",
"newChat": {
"title": "Nuova chat",
@@ -248,6 +253,12 @@
"createFailed": "Impossibile creare il gruppo",
"removeParticipant": "Rimuovi {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "Cerca sessioni...",
+ "noMatch": "Nessuna sessione corrisponde",
+ "addTitle": "Collega un altro numero",
+ "addHint": "Crea una sessione e collegala con un codice QR"
+ },
"group": {
"info": "Info gruppo",
"leave": "Esci dal gruppo",
diff --git a/dashboard/src/i18n/locales/ko.json b/dashboard/src/i18n/locales/ko.json
index 476f3ef76..725474cdd 100644
--- a/dashboard/src/i18n/locales/ko.json
+++ b/dashboard/src/i18n/locales/ko.json
@@ -203,6 +203,9 @@
"read": "읽음",
"failed": "실패"
},
+ "today": "오늘",
+ "switchSession": "세션 전환",
+ "searchMessages": "메시지 검색",
"clearSearch": "검색 지우기",
"filters": {
"label": "채팅 필터",
@@ -213,11 +216,13 @@
"unknown": "알 수 없음"
},
"noFilterResults": "이 필터와 일치하는 채팅이 없습니다",
+ "contactInfo": "연락처 정보",
"moreActions": "추가 작업",
"copyChatId": "채팅 ID 복사",
"chatIdCopied": "채팅 ID가 복사되었습니다",
"copyFailed": "클립보드에 복사할 수 없습니다",
"closeChat": "채팅 닫기",
+ "phone": "전화번호",
"chatId": "채팅 ID",
"newChat": {
"title": "새 채팅",
@@ -243,6 +248,12 @@
"createFailed": "그룹을 만들 수 없습니다",
"removeParticipant": "{{name}} 제거"
},
+ "sessionPicker": {
+ "searchPlaceholder": "세션 검색...",
+ "noMatch": "일치하는 세션이 없습니다",
+ "addTitle": "다른 번호 연결",
+ "addHint": "세션을 만들고 QR 코드로 연결하세요"
+ },
"group": {
"info": "그룹 정보",
"leave": "그룹 나가기",
diff --git a/dashboard/src/i18n/locales/pt-BR.json b/dashboard/src/i18n/locales/pt-BR.json
index 849cf8911..5b0b7416d 100644
--- a/dashboard/src/i18n/locales/pt-BR.json
+++ b/dashboard/src/i18n/locales/pt-BR.json
@@ -208,6 +208,9 @@
"read": "Lido",
"failed": "Falhou"
},
+ "today": "Hoje",
+ "switchSession": "Trocar sessão",
+ "searchMessages": "Pesquisar mensagens",
"clearSearch": "Limpar pesquisa",
"filters": {
"label": "Filtrar chats",
@@ -218,11 +221,13 @@
"unknown": "Desconhecidos"
},
"noFilterResults": "Nenhuma conversa corresponde a este filtro",
+ "contactInfo": "Dados do contato",
"moreActions": "Mais ações",
"copyChatId": "Copiar ID da conversa",
"chatIdCopied": "ID da conversa copiado",
"copyFailed": "Não foi possível copiar para a área de transferência",
"closeChat": "Fechar conversa",
+ "phone": "Número de telefone",
"chatId": "ID da conversa",
"newChat": {
"title": "Nova conversa",
@@ -248,6 +253,12 @@
"createFailed": "Não foi possível criar o grupo",
"removeParticipant": "Remover {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "Pesquisar sessões...",
+ "noMatch": "Nenhuma sessão corresponde",
+ "addTitle": "Vincular outro número",
+ "addHint": "Crie uma sessão e vincule-a com um código QR"
+ },
"group": {
"info": "Dados do grupo",
"leave": "Sair do grupo",
diff --git a/dashboard/src/i18n/locales/te.json b/dashboard/src/i18n/locales/te.json
index ed815a125..d3f608b05 100644
--- a/dashboard/src/i18n/locales/te.json
+++ b/dashboard/src/i18n/locales/te.json
@@ -203,6 +203,9 @@
"read": "చదవబడింది",
"failed": "విఫలమైంది"
},
+ "today": "ఈరోజు",
+ "switchSession": "సెషన్ మార్చండి",
+ "searchMessages": "సందేశాలను శోధించండి",
"clearSearch": "శోధనను క్లియర్ చేయండి",
"filters": {
"label": "చాట్‌లను ఫిల్టర్ చేయండి",
@@ -213,11 +216,13 @@
"unknown": "తెలియనివి"
},
"noFilterResults": "ఈ ఫిల్టర్‌కు సరిపోయే చాట్‌లు లేవు",
+ "contactInfo": "సంప్రదింపు సమాచారం",
"moreActions": "మరిన్ని చర్యలు",
"copyChatId": "చాట్ ID కాపీ చేయండి",
"chatIdCopied": "చాట్ ID కాపీ అయింది",
"copyFailed": "క్లిప్‌బోర్డ్‌కు కాపీ చేయడం సాధ్యం కాలేదు",
"closeChat": "చాట్ మూసివేయండి",
+ "phone": "ఫోన్ నంబర్",
"chatId": "చాట్ ID",
"newChat": {
"title": "కొత్త చాట్",
@@ -243,6 +248,12 @@
"createFailed": "గ్రూప్‌ను సృష్టించడం సాధ్యం కాలేదు",
"removeParticipant": "{{name}}ను తొలగించండి"
},
+ "sessionPicker": {
+ "searchPlaceholder": "సెషన్‌ల కోసం వెతకండి...",
+ "noMatch": "సరిపోలే సెషన్ లేదు",
+ "addTitle": "మరో నంబర్‌ను జత చేయండి",
+ "addHint": "సెషన్‌ను సృష్టించి QR కోడ్‌తో లింక్ చేయండి"
+ },
"group": {
"info": "సమూహ సమాచారం",
"leave": "సమూహం నుండి నిష్క్రమించండి",
diff --git a/dashboard/src/i18n/locales/tr.json b/dashboard/src/i18n/locales/tr.json
index 673d1c629..34a19c248 100644
--- a/dashboard/src/i18n/locales/tr.json
+++ b/dashboard/src/i18n/locales/tr.json
@@ -203,6 +203,9 @@
"read": "Okundu",
"failed": "Başarısız"
},
+ "today": "Bugün",
+ "switchSession": "Oturum değiştir",
+ "searchMessages": "Mesajlarda ara",
"clearSearch": "Aramayı temizle",
"filters": {
"label": "Sohbetleri filtrele",
@@ -213,11 +216,13 @@
"unknown": "Bilinmeyen"
},
"noFilterResults": "Bu filtreyle eşleşen sohbet yok",
+ "contactInfo": "Kişi bilgisi",
"moreActions": "Diğer işlemler",
"copyChatId": "Sohbet kimliğini kopyala",
"chatIdCopied": "Sohbet kimliği kopyalandı",
"copyFailed": "Panoya kopyalanamadı",
"closeChat": "Sohbeti kapat",
+ "phone": "Telefon numarası",
"chatId": "Sohbet kimliği",
"newChat": {
"title": "Yeni sohbet",
@@ -243,6 +248,12 @@
"createFailed": "Grup oluşturulamadı",
"removeParticipant": "{{name}} kaldır"
},
+ "sessionPicker": {
+ "searchPlaceholder": "Oturum ara...",
+ "noMatch": "Eşleşen oturum yok",
+ "addTitle": "Başka bir numara bağla",
+ "addHint": "Bir oturum oluşturun ve QR koduyla bağlayın"
+ },
"group": {
"info": "Grup bilgisi",
"leave": "Gruptan çık",
diff --git a/dashboard/src/i18n/locales/zh-CN.json b/dashboard/src/i18n/locales/zh-CN.json
index b85735ab6..ec45f7595 100644
--- a/dashboard/src/i18n/locales/zh-CN.json
+++ b/dashboard/src/i18n/locales/zh-CN.json
@@ -203,6 +203,9 @@
"read": "已读",
"failed": "发送失败"
},
+ "today": "今天",
+ "switchSession": "切换会话",
+ "searchMessages": "搜索消息",
"clearSearch": "清除搜索",
"filters": {
"label": "筛选聊天",
@@ -213,11 +216,13 @@
"unknown": "未知"
},
"noFilterResults": "没有符合此筛选条件的聊天",
+ "contactInfo": "联系人信息",
"moreActions": "更多操作",
"copyChatId": "复制聊天 ID",
"chatIdCopied": "已复制聊天 ID",
"copyFailed": "无法复制到剪贴板",
"closeChat": "关闭聊天",
+ "phone": "电话号码",
"chatId": "聊天 ID",
"newChat": {
"title": "新聊天",
@@ -243,6 +248,12 @@
"createFailed": "无法创建群组",
"removeParticipant": "移除 {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "搜索会话...",
+ "noMatch": "没有匹配的会话",
+ "addTitle": "关联其他号码",
+ "addHint": "创建会话并通过二维码关联"
+ },
"group": {
"info": "群组信息",
"leave": "退出群组",
diff --git a/dashboard/src/i18n/locales/zh-HK.json b/dashboard/src/i18n/locales/zh-HK.json
index 1c774ada4..baf99493e 100644
--- a/dashboard/src/i18n/locales/zh-HK.json
+++ b/dashboard/src/i18n/locales/zh-HK.json
@@ -203,6 +203,9 @@
"read": "已讀",
"failed": "傳送失敗"
},
+ "today": "今天",
+ "switchSession": "切換工作階段",
+ "searchMessages": "搜尋訊息",
"clearSearch": "清除搜尋",
"filters": {
"label": "篩選聊天",
@@ -213,11 +216,13 @@
"unknown": "未知"
},
"noFilterResults": "沒有符合此篩選條件的聊天",
+ "contactInfo": "聯絡人資料",
"moreActions": "更多操作",
"copyChatId": "複製聊天 ID",
"chatIdCopied": "已複製聊天 ID",
"copyFailed": "無法複製到剪貼簿",
"closeChat": "關閉聊天",
+ "phone": "電話號碼",
"chatId": "聊天 ID",
"newChat": {
"title": "新聊天",
@@ -243,6 +248,12 @@
"createFailed": "無法建立群組",
"removeParticipant": "移除 {{name}}"
},
+ "sessionPicker": {
+ "searchPlaceholder": "搜尋工作階段...",
+ "noMatch": "沒有相符的工作階段",
+ "addTitle": "連結其他號碼",
+ "addHint": "建立工作階段並以 QR 碼連結"
+ },
"group": {
"info": "群組資訊",
"leave": "退出群組",
diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.css
index 08a849cb8..569e57882 100644
--- a/dashboard/src/pages/Chats.css
+++ b/dashboard/src/pages/Chats.css
@@ -1,1597 +1,2137 @@
.chats-page {
- padding: 2rem;
+ /* Chat palette. Light values follow WhatsApp Web; the dark set below swaps them as a whole, so the rules
+ further down never need a theme branch of their own. */
+ --chat-panel: var(--bg-white);
+ --chat-panel-header: #f0f2f5;
+ --chat-hover: #f5f6f6;
+ --chat-active: #f0f2f5;
+ --chat-divider: #e9edef;
+ --chat-wallpaper: #efeae2;
+ --chat-wallpaper-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' fill='none' stroke='rgba%2884,72,56,0.07%29' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E %3Cpath d='M22 30h40a8 8 0 0 1 8 8v20a8 8 0 0 1-8 8H38l-12 10v-10h-4a8 8 0 0 1-8-8V38a8 8 0 0 1 8-8z'/%3E %3Cpath d='M150 40c0-7 9-11 14-5 5-6 14-2 14 5 0 9-14 17-14 17s-14-8-14-17z'/%3E %3Cpath d='M205 120l5 11 12 2-9 8 2 12-10-6-10 6 2-12-9-8 12-2z'/%3E %3Crect x='30' y='150' width='40' height='30' rx='6'/%3E%3Ccircle cx='50' cy='165' r='8'/%3E%3Cpath d='M40 150l4-6h12l4 6'/%3E %3Cpath d='M120 130l46-18-18 46-8-20z'/%3E%3Cpath d='M140 138l8-8'/%3E %3Ccircle cx='120' cy='210' r='12'/%3E%3Cpath d='M114 214c2 3 10 3 12 0'/%3E%3Cpath d='M115 206h.1M125 206h.1'/%3E %3Cpath d='M190 200h30M190 210h20M184 192h42v28h-42z'/%3E %3Cpath d='M90 70l6 6 12-12'/%3E%3Ccircle cx='99' cy='70' r='14'/%3E %3Cpath d='M200 70a10 10 0 1 1-1-8'/%3E%3Cpath d='M60 110h.1M70 110h.1M80 110h.1'/%3E %3C/svg%3E");
+ --chat-bubble-in: #ffffff;
+ --chat-bubble-out: #d9fdd3;
+ --chat-bubble-text: #111b21;
+ --chat-meta: #667781;
+ --chat-pill: #ffffff;
+ --chat-pill-active-bg: #d9fdd3;
+ --chat-pill-active-text: #008069;
+ --chat-accent: #00a884;
+ --chat-accent-hover: #008f6f;
+ --chat-quote-accent: #06cf9c;
+ --chat-link: #027eb5;
+ /* The WhatsApp read blue is 2.13:1 on the outgoing bubble; this one clears 3:1 for the icon there. Read
+ and delivered also differ in aria-label and title, never by colour alone. */
+ --chat-tick-read: #1f8fc4;
+ --chat-icon: #54656f;
+ --chat-shadow-bubble: 0 1px 0.5px rgba(11, 20, 26, 0.13);
+
width: 100%;
- height: calc(100vh - 4rem);
+ height: 100vh;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
+[data-theme='dark'] .chats-page {
+ --chat-panel: #111b21;
+ --chat-panel-header: #202c33;
+ --chat-hover: #202c33;
+ --chat-active: #2a3942;
+ --chat-divider: #222d34;
+ --chat-wallpaper: #0b141a;
+ --chat-wallpaper-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' fill='none' stroke='rgba%28255,255,255,0.045%29' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E %3Cpath d='M22 30h40a8 8 0 0 1 8 8v20a8 8 0 0 1-8 8H38l-12 10v-10h-4a8 8 0 0 1-8-8V38a8 8 0 0 1 8-8z'/%3E %3Cpath d='M150 40c0-7 9-11 14-5 5-6 14-2 14 5 0 9-14 17-14 17s-14-8-14-17z'/%3E %3Cpath d='M205 120l5 11 12 2-9 8 2 12-10-6-10 6 2-12-9-8 12-2z'/%3E %3Crect x='30' y='150' width='40' height='30' rx='6'/%3E%3Ccircle cx='50' cy='165' r='8'/%3E%3Cpath d='M40 150l4-6h12l4 6'/%3E %3Cpath d='M120 130l46-18-18 46-8-20z'/%3E%3Cpath d='M140 138l8-8'/%3E %3Ccircle cx='120' cy='210' r='12'/%3E%3Cpath d='M114 214c2 3 10 3 12 0'/%3E%3Cpath d='M115 206h.1M125 206h.1'/%3E %3Cpath d='M190 200h30M190 210h20M184 192h42v28h-42z'/%3E %3Cpath d='M90 70l6 6 12-12'/%3E%3Ccircle cx='99' cy='70' r='14'/%3E %3Cpath d='M200 70a10 10 0 1 1-1-8'/%3E%3Cpath d='M60 110h.1M70 110h.1M80 110h.1'/%3E %3C/svg%3E");
+ --chat-bubble-in: #202c33;
+ --chat-bubble-out: #005c4b;
+ --chat-bubble-text: #e9edef;
+ --chat-meta: #8696a0;
+ --chat-pill: #202c33;
+ --chat-pill-active-bg: #0a332c;
+ --chat-pill-active-text: #00a884;
+ --chat-link: #53bdeb;
+ --chat-tick-read: #53bdeb;
+ --chat-icon: #aebac1;
+ --chat-shadow-bubble: 0 1px 0.5px rgba(11, 20, 26, 0.4);
+}
+
+/* System-dark twin: the default 'system' theme removes data-theme entirely, so the explicit rule above
+ never matches on a dark OS. :not([data-theme='light']) keeps an explicit light choice in control. */
+@media (prefers-color-scheme: dark) {
+ :root:not([data-theme='light']) .chats-page {
+ --chat-panel: #111b21;
+ --chat-panel-header: #202c33;
+ --chat-hover: #202c33;
+ --chat-active: #2a3942;
+ --chat-divider: #222d34;
+ --chat-wallpaper: #0b141a;
+ --chat-wallpaper-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' fill='none' stroke='rgba%28255,255,255,0.045%29' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E %3Cpath d='M22 30h40a8 8 0 0 1 8 8v20a8 8 0 0 1-8 8H38l-12 10v-10h-4a8 8 0 0 1-8-8V38a8 8 0 0 1 8-8z'/%3E %3Cpath d='M150 40c0-7 9-11 14-5 5-6 14-2 14 5 0 9-14 17-14 17s-14-8-14-17z'/%3E %3Cpath d='M205 120l5 11 12 2-9 8 2 12-10-6-10 6 2-12-9-8 12-2z'/%3E %3Crect x='30' y='150' width='40' height='30' rx='6'/%3E%3Ccircle cx='50' cy='165' r='8'/%3E%3Cpath d='M40 150l4-6h12l4 6'/%3E %3Cpath d='M120 130l46-18-18 46-8-20z'/%3E%3Cpath d='M140 138l8-8'/%3E %3Ccircle cx='120' cy='210' r='12'/%3E%3Cpath d='M114 214c2 3 10 3 12 0'/%3E%3Cpath d='M115 206h.1M125 206h.1'/%3E %3Cpath d='M190 200h30M190 210h20M184 192h42v28h-42z'/%3E %3Cpath d='M90 70l6 6 12-12'/%3E%3Ccircle cx='99' cy='70' r='14'/%3E %3Cpath d='M200 70a10 10 0 1 1-1-8'/%3E%3Cpath d='M60 110h.1M70 110h.1M80 110h.1'/%3E %3C/svg%3E");
+ --chat-bubble-in: #202c33;
+ --chat-bubble-out: #005c4b;
+ --chat-bubble-text: #e9edef;
+ --chat-meta: #8696a0;
+ --chat-pill: #202c33;
+ --chat-pill-active-bg: #0a332c;
+ --chat-pill-active-text: #00a884;
+ --chat-link: #53bdeb;
+ --chat-tick-read: #53bdeb;
+ --chat-icon: #aebac1;
+ --chat-shadow-bubble: 0 1px 0.5px rgba(11, 20, 26, 0.4);
+ }
+}
+
.chats-page .chats-layout {
display: flex;
flex: 1;
min-height: 0;
- background: var(--bg-white);
- border: 1px solid var(--border);
- border-radius: 16px;
+ background: var(--chat-panel);
overflow: hidden;
- box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
- height: calc(100vh - 12rem);
- margin-top: 1rem;
+ box-shadow: var(--shadow-md);
+}
+
+/* Shared round icon button (header actions, panel close, copy). */
+.chats-page .icon-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 40px;
+ height: 40px;
+ padding: 0;
+ background: transparent;
+ border: none;
+ border-radius: 50%;
+ color: var(--chat-icon);
+ cursor: pointer;
+ flex-shrink: 0;
+ transition: background 0.15s;
+}
+
+.chats-page .icon-btn:hover,
+.chats-page .icon-btn.active {
+ background: color-mix(in srgb, var(--chat-icon) 14%, transparent);
+}
+
+.chats-page .icon-btn.small {
+ width: 28px;
+ height: 28px;
}
/* =============================================================================
SIDEBAR: Left Column
============================================================================= */
.chats-page .chats-sidebar {
- width: 320px;
- border-inline-end: 1px solid var(--border);
+ width: 380px;
+ min-width: 300px;
+ max-width: 40%;
display: flex;
flex-direction: column;
- background: var(--bg-white);
+ background: var(--chat-panel);
+ border-inline-end: 1px solid var(--chat-divider);
flex-shrink: 0;
+ min-height: 0;
}
-.chats-page .sidebar-header-box {
- padding: 1.25rem;
- border-bottom: 1px solid var(--border);
+.chats-page .sidebar-header {
+ height: 64px;
+ padding-block: 0;
+ padding-inline: 1rem 0.75rem;
display: flex;
- flex-direction: column;
- gap: 1rem;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.5rem;
+ border-bottom: 1px solid var(--chat-divider);
+ box-sizing: border-box;
+ flex-shrink: 0;
}
-.chats-page .session-select-group {
- display: flex;
- flex-direction: column;
- gap: 0.375rem;
+/* Session switcher: the selected account in the header, opening a searchable list of every session. */
+.chats-page .session-switcher {
+ position: relative;
+ min-width: 0;
}
-.chats-page .session-selector {
- width: 100%;
- padding: 0.625rem 0.75rem;
- border: 1px solid var(--border);
- border-radius: var(--radius, 8px);
- background: var(--bg-light);
+.chats-page .session-switcher-btn {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ max-width: 100%;
+ min-width: 0;
+ padding-block: 0.25rem;
+ padding-inline: 0.25rem 0.5rem;
+ margin-inline-start: -0.25rem;
+ background: transparent;
+ border: none;
+ border-radius: 12px;
color: var(--text-primary);
- font-size: 0.875rem;
- font-weight: 500;
- outline: none;
+ text-align: start;
cursor: pointer;
- transition: all 0.2s;
}
-.chats-page .session-selector:focus {
- border-color: var(--primary);
- background: var(--bg-white);
- box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
+.chats-page .session-switcher-btn:hover {
+ background: var(--chat-hover);
}
-/* Chats / Channels / Status segmented control */
-.chats-page .chats-tabs {
+.chats-page .session-switcher-btn:focus-visible {
+ outline: 2px solid var(--chat-accent);
+ outline-offset: 2px;
+}
+
+.chats-page .session-avatar {
+ position: relative;
+ width: 48px;
+ height: 48px;
+ border-radius: 50%;
+ background: color-mix(in srgb, var(--chat-accent) 12%, var(--chat-panel));
+ border: 1px solid color-mix(in srgb, var(--chat-accent) 25%, transparent);
+ color: var(--chat-accent);
+ font-weight: 600;
+ font-size: 1rem;
display: flex;
- gap: 4px;
- padding: 4px;
- background: var(--bg-light);
- border: 1px solid var(--border);
- border-radius: var(--radius, 8px);
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ box-sizing: border-box;
}
-.chats-page .chats-tab {
- flex: 1;
- padding: 6px 8px;
- border: none;
- border-radius: 6px;
- background: transparent;
- color: var(--text-secondary);
- cursor: pointer;
- font-size: 0.8125rem;
- transition:
- background 0.15s ease,
- color 0.15s ease;
+.chats-page .session-avatar.sm {
+ width: 44px;
+ height: 44px;
+ font-size: 0.9375rem;
}
-.chats-page .chats-tab:hover {
- color: var(--text-primary);
+.chats-page .session-avatar img {
+ width: 100%;
+ height: 100%;
+ border-radius: 50%;
+ object-fit: cover;
}
-.chats-page .chats-tab.active {
- background: var(--bg-card);
+.chats-page .session-avatar.add {
+ border-style: solid;
+}
+
+.chats-page .session-status-dot {
+ position: absolute;
+ top: -1px;
+ inset-inline-end: -1px;
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: var(--success);
+ border: 2px solid var(--chat-panel);
+}
+
+.chats-page .session-status-dot.pending {
+ background: var(--warning);
+}
+
+.chats-page .session-status-dot.down {
+ background: var(--error);
+}
+
+.chats-page .session-text {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ line-height: 1.3;
+}
+
+.chats-page .session-name {
+ font-size: 1rem;
+ font-weight: 500;
color: var(--text-primary);
- font-weight: 600;
- box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
-.chats-page .chat-search-input {
+.chats-page .session-phone {
+ font-size: 0.875rem;
+ color: var(--chat-meta);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.chats-page .session-flag {
+ margin-inline-end: 0.3em;
+}
+
+.chats-page .session-chevron {
+ color: var(--chat-icon);
+ flex-shrink: 0;
+ margin-inline-start: 0.5rem;
+ transition: transform 0.15s;
+}
+
+.chats-page .session-chevron.open {
+ transform: rotate(180deg);
+}
+
+/* The open list */
+.chats-page .session-picker {
+ position: absolute;
+ top: calc(100% + 0.5rem);
+ inset-inline-start: -0.25rem;
+ z-index: 30;
+ width: min(360px, calc(100vw - 2rem));
+ display: flex;
+ flex-direction: column;
+ background: var(--chat-panel);
+ border: 1px solid var(--chat-divider);
+ border-radius: 14px;
+ box-shadow: var(--shadow-lg);
+ overflow: hidden;
+}
+
+.chats-page .session-picker-search {
display: flex;
align-items: center;
- gap: 0.5rem;
- padding: 0.625rem 0.75rem;
- background: var(--bg-light);
- border: 1px solid var(--border);
- border-radius: var(--radius, 8px);
+ gap: 0.625rem;
+ padding-block: 0.875rem;
+ padding-inline: 1rem;
+ border-bottom: 1px solid var(--chat-divider);
+ color: var(--chat-meta);
}
-.chats-page .chat-search-input svg {
- color: var(--text-muted);
- flex-shrink: 0;
+.chats-page .session-picker-search:focus-within {
+ color: var(--chat-accent);
}
-.chats-page .chat-search-input input {
+.chats-page .session-picker-search input {
flex: 1;
+ min-width: 0;
border: none;
background: none;
- font-size: 0.875rem;
+ font-size: 1rem;
color: var(--text-primary);
outline: none;
}
-.chats-page .chat-search-input:focus-within {
- border-color: var(--primary);
- box-shadow: 0 0 0 3px var(--primary-soft);
+.chats-page .session-picker-search input::placeholder {
+ color: var(--chat-meta);
}
-.chats-page .chats-list {
- flex: 1;
+.chats-page .session-picker-list {
+ margin: 0;
+ padding: 0.25rem;
+ list-style: none;
+ max-height: 360px;
overflow-y: auto;
+}
+
+.chats-page .session-picker-option,
+.chats-page .session-picker-add {
+ width: 100%;
display: flex;
- flex-direction: column;
+ align-items: center;
+ gap: 0.875rem;
+ padding-block: 0.625rem;
+ padding-inline: 0.75rem;
+ background: transparent;
+ border: none;
+ border-radius: 10px;
+ color: inherit;
+ font: inherit;
+ text-align: start;
+ text-decoration: none;
+ cursor: pointer;
+ box-sizing: border-box;
}
-/* Custom Scrollbar for chats list */
-.chats-page .chats-list::-webkit-scrollbar,
-.chats-page .room-messages::-webkit-scrollbar {
- width: 6px;
+.chats-page .session-picker-option:hover:not(:disabled),
+.chats-page .session-picker-option:focus-visible,
+.chats-page .session-picker-add:hover,
+.chats-page .session-picker-add:focus-visible {
+ background: var(--chat-hover);
+ outline: none;
}
-.chats-page .chats-list::-webkit-scrollbar-thumb,
-.chats-page .room-messages::-webkit-scrollbar-thumb {
- background: var(--border);
- border-radius: 3px;
+.chats-page .session-picker-option:disabled {
+ cursor: not-allowed;
}
-.chats-page .chats-list::-webkit-scrollbar-track,
-.chats-page .room-messages::-webkit-scrollbar-track {
- background: transparent;
+.chats-page .session-picker-option:disabled .session-name {
+ color: var(--chat-meta);
}
-.chats-page .chats-list-loading,
-.chats-page .chats-list-empty {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 3rem 1.5rem;
- color: var(--text-muted);
+.chats-page .session-check {
+ margin-inline-start: auto;
+ color: var(--chat-accent);
+ flex-shrink: 0;
+}
+
+.chats-page .session-picker-empty {
+ padding-block: 1rem;
+ padding-inline: 0.75rem;
+ color: var(--chat-meta);
font-size: 0.875rem;
- gap: 0.5rem;
+ text-align: center;
}
-.chats-page .chat-item-card {
- display: flex;
- align-items: center;
- gap: 0.75rem;
- padding: 1rem 1.25rem;
- border-bottom: 1px solid var(--border);
- cursor: pointer;
- transition: background 0.15s ease;
- user-select: none;
+.chats-page .session-picker-add {
+ border-top: 1px solid var(--chat-divider);
+ border-radius: 0;
+ padding-block: 0.875rem;
+ padding-inline: 1rem;
}
-.chats-page .chat-item-card:hover {
- background: var(--bg-light);
+.chats-page .session-picker-add .session-name {
+ font-weight: 600;
}
-.chats-page .chat-item-card.active {
- background: rgba(34, 197, 94, 0.08);
+.chats-page .session-picker-add-chevron {
+ margin-inline-start: auto;
+ color: var(--chat-icon);
+ flex-shrink: 0;
}
-.chats-page .chat-avatar {
- width: 44px;
- height: 44px;
- border-radius: 50%;
- background: var(--bg-light);
- border: 1px solid var(--border);
+[dir='rtl'] .chats-page .session-picker-add-chevron {
+ transform: scaleX(-1);
+}
+
+.chats-page .sidebar-header-actions {
display: flex;
align-items: center;
- justify-content: center;
- color: var(--text-secondary);
+ gap: 0.125rem;
flex-shrink: 0;
- overflow: hidden;
}
-.chats-page .chat-avatar img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- display: block;
+/* Full-text message search (collapsible). The input's own minimum would push the scope toggle out of a
+ narrow list. */
+.chats-page .sidebar-message-search {
+ padding-block: 0.75rem 0;
+ padding-inline: 1rem;
}
-.chats-page .chat-item-card.active .chat-avatar {
- background: var(--bg-white);
- color: var(--primary-text);
- border-color: rgba(34, 197, 94, 0.3);
+.chats-page .sidebar-message-search .global-search-input {
+ min-width: 0;
}
-.chats-page .chat-item-info {
- flex: 1;
+.chats-page .sidebar-header-box {
+ padding-block: 0.75rem 0;
+ padding-inline: 1rem;
display: flex;
flex-direction: column;
- gap: 0.25rem;
- min-width: 0; /* Ensures text truncation works */
+ gap: 0.75rem;
+ flex-shrink: 0;
}
-.chats-page .chat-item-top {
+/* Chats / Channels / Status segmented control */
+.chats-page .chats-tabs {
display: flex;
- justify-content: flex-start;
- align-items: baseline;
- gap: 6px;
+ gap: 4px;
+ padding: 4px;
+ background: var(--chat-panel-header);
+ border-radius: 10px;
}
-.chats-page .chat-item-name {
- font-size: 0.9375rem;
- font-weight: 600;
+.chats-page .chats-tab {
+ flex: 1;
+ padding: 6px 8px;
+ border: none;
+ border-radius: 7px;
+ background: transparent;
+ color: var(--chat-meta);
+ cursor: pointer;
+ font-size: 0.8125rem;
+ font-weight: 500;
+ transition:
+ background 0.15s ease,
+ color 0.15s ease;
+}
+
+.chats-page .chats-tab:hover {
color: var(--text-primary);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
}
-.chats-page .chat-item-time {
- font-size: 0.75rem;
- color: var(--text-muted);
- flex-shrink: 0;
- margin-inline-start: auto;
+.chats-page .chats-tab.active {
+ background: var(--chat-panel);
+ color: var(--text-primary);
+ font-weight: 600;
+ box-shadow: var(--chat-shadow-bubble);
}
-.chats-page .chat-item-bottom {
+/* Search box (sidebar and new-chat panel) */
+.chats-page .chat-search-input {
display: flex;
- justify-content: space-between;
align-items: center;
+ gap: 0.625rem;
+ padding-block: 0;
+ padding-inline: 0.875rem;
+ height: 40px;
+ background: var(--chat-panel);
+ border: 1px solid var(--chat-divider);
+ border-radius: 10px;
+ color: var(--chat-meta);
+ box-sizing: border-box;
+ transition:
+ border-color 0.15s,
+ box-shadow 0.15s;
}
-.chats-page .chat-item-snippet {
- font-size: 0.8125rem;
- color: var(--text-muted);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 180px;
+.chats-page .chat-search-input svg {
+ flex-shrink: 0;
}
-.chats-page .chat-item-snippet .no-message {
- font-style: italic;
- opacity: 0.6;
+.chats-page .chat-search-input:focus-within {
+ border-color: var(--chat-accent);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--chat-accent) 15%, transparent);
}
-.chats-page .chat-unread-badge {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- height: 20px;
- min-width: 20px;
- padding: 0 6px;
- background: var(--primary);
- color: white;
- font-size: 0.75rem;
- font-weight: 700;
- line-height: 1;
- border-radius: 999px;
- box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
+.chats-page .chat-search-input input {
+ flex: 1;
+ min-width: 0;
+ border: none;
+ background: none;
+ font-size: 0.9375rem;
+ color: var(--text-primary);
+ outline: none;
}
-.chats-page .chat-kind-badge {
- font-size: 0.7rem;
- padding: 0 6px;
- border-radius: 8px;
- border: 1px solid var(--border);
- color: var(--text-secondary);
- white-space: nowrap;
+.chats-page .chat-search-input input::placeholder {
+ color: var(--chat-meta);
}
-/* =============================================================================
- CHAT ROOM: Right Column
- ============================================================================= */
-.chats-page .chats-room {
- flex: 1;
- min-width: 0;
- min-height: 0;
+.chats-page .search-clear {
display: flex;
- flex-direction: column;
- background: var(--bg-light);
+ padding: 2px;
+ background: none;
+ border: none;
+ border-radius: 50%;
+ color: var(--chat-meta);
+ cursor: pointer;
}
-.chats-page .chats-room-placeholder {
- flex: 1;
+.chats-page .search-clear:hover {
+ color: var(--text-primary);
+}
+
+/* Filter pills */
+.chats-page .chat-filters {
display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 3rem;
- text-align: center;
- color: var(--text-muted);
+ gap: 0.5rem;
+ padding-block: 0.75rem;
+ padding-inline: 1rem;
+ overflow-x: auto;
+ scrollbar-width: none;
+ flex-shrink: 0;
}
-.chats-page .placeholder-icon {
- margin-bottom: 1.5rem;
- opacity: 0.3;
- color: var(--text-secondary);
+.chats-page .chat-filters::-webkit-scrollbar {
+ display: none;
}
-.chats-page .chats-room-placeholder h2 {
- font-size: 1.25rem;
- font-weight: 600;
- color: var(--text-primary);
- /* Reset the global h2 eyebrow treatment: this is an empty-state title, not a section label. */
- text-transform: none;
- letter-spacing: -0.01em;
- margin: 0 0 0.375rem;
+.chats-page .chat-filter-pill {
+ flex-shrink: 0;
+ padding-block: 0.375rem;
+ padding-inline: 0.875rem;
+ background: var(--chat-pill);
+ border: 1px solid var(--chat-divider);
+ border-radius: 999px;
+ font-size: 0.875rem;
+ font-weight: 500;
+ color: var(--chat-meta);
+ cursor: pointer;
+ transition:
+ background 0.15s,
+ color 0.15s,
+ border-color 0.15s;
}
-.chats-page .chats-room-placeholder p {
- font-size: 0.9375rem;
- max-width: 380px;
- margin: 0;
+.chats-page .chat-filter-pill:hover {
+ background: var(--chat-hover);
}
-.chats-page .room-container {
+.chats-page .chat-filter-pill.active {
+ background: var(--chat-pill-active-bg);
+ border-color: transparent;
+ color: var(--chat-pill-active-text);
+}
+
+/* Lists */
+.chats-page .chats-list {
flex: 1;
min-height: 0;
+ overflow-y: auto;
display: flex;
flex-direction: column;
- height: 100%;
+ padding-block: 0 0.5rem;
+ padding-inline: 0.5rem;
}
-.chats-page .room-header {
- height: 70px;
- background: var(--bg-white);
- border-bottom: 1px solid var(--border);
- padding: 0 1.5rem;
+/* The Channels and Status tabs have no filter row; the list keeps its distance from the search box. */
+.chats-page .sidebar-header-box + .chats-list {
+ padding-block-start: 0.5rem;
+}
+
+.chats-page .chats-list::-webkit-scrollbar,
+.chats-page .room-messages::-webkit-scrollbar {
+ width: 6px;
+}
+
+.chats-page .chats-list::-webkit-scrollbar-thumb,
+.chats-page .room-messages::-webkit-scrollbar-thumb {
+ background: color-mix(in srgb, var(--chat-meta) 35%, transparent);
+ border-radius: 3px;
+}
+
+.chats-page .chats-list::-webkit-scrollbar-track,
+.chats-page .room-messages::-webkit-scrollbar-track {
+ background: transparent;
+}
+
+.chats-page .chats-list-loading,
+.chats-page .chats-list-empty {
display: flex;
+ flex-direction: column;
align-items: center;
- gap: 0.75rem;
- box-sizing: border-box;
+ justify-content: center;
+ padding: 3rem 1.5rem;
+ color: var(--chat-meta);
+ font-size: 0.875rem;
+ gap: 0.5rem;
+ text-align: center;
}
-/* Back-to-list control: only needed in the single-pane mobile layout; hidden on the two-pane desktop. */
-.chats-page .room-back {
- display: none;
+.chats-page .chat-item-card {
+ display: flex;
align-items: center;
- justify-content: center;
- width: 36px;
- height: 36px;
- /* Reset the global `button` padding (0.6em 1.2em): with box-sizing:border-box it would consume
- the whole 36px width and collapse the arrow icon to 0px wide, making the button look empty. */
- padding: 0;
- margin-inline-start: -0.5rem;
+ gap: 0.875rem;
+ padding-block: 0.625rem;
+ padding-inline: 0.75rem;
+ border-radius: 10px;
+ cursor: pointer;
+ user-select: none;
+ transition: background 0.12s;
+}
+
+/* The new-chat panel's rows are buttons: they take the row's look, not the global button's. */
+.chats-page button.chat-item-card {
+ width: 100%;
background: transparent;
border: none;
- border-radius: 8px;
- color: var(--text-secondary);
- cursor: pointer;
- flex-shrink: 0;
+ color: inherit;
+ font: inherit;
+ text-align: start;
}
-.chats-page .room-back:hover {
- background: var(--bg-light);
- color: var(--text-primary);
+.chats-page .chat-item-card:hover {
+ background: var(--chat-hover);
}
-.chats-page .room-avatar {
- width: 40px;
- height: 40px;
+.chats-page .chat-item-card.active {
+ background: var(--chat-active);
+}
+
+.chats-page .chat-item-card:focus-visible {
+ outline: 2px solid var(--chat-accent);
+ outline-offset: -2px;
+}
+
+.chats-page .chat-item-card:disabled {
+ cursor: progress;
+ opacity: 0.75;
+}
+
+/* Avatars */
+.chats-page .chat-avatar {
+ width: 52px;
+ height: 52px;
border-radius: 50%;
- background: var(--bg-light);
- border: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
- color: var(--text-secondary);
- overflow: hidden;
flex-shrink: 0;
+ overflow: hidden;
+ background: var(--chat-hover);
+ color: var(--chat-icon);
+}
+
+.chats-page .chat-avatar.avatar-sm {
+ width: 44px;
+ height: 44px;
+}
+
+.chats-page .chat-avatar.avatar-lg {
+ width: 120px;
+ height: 120px;
}
-.chats-page .room-avatar img {
+.chats-page .chat-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
-.chats-page .room-contact-info {
- display: flex;
- flex-direction: column;
- gap: 0.125rem;
- min-width: 0;
+.chats-page .avatar-tone-blue {
+ background: #e3ebff;
+ color: #4a6bd6;
}
-.chats-page .room-contact-info h3 {
- font-size: 1rem;
- font-weight: 600;
- color: var(--text-primary);
- margin: 0;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
+.chats-page .avatar-tone-orange {
+ background: #fde8dc;
+ color: #d9773b;
}
-/* Prettified phone (or "Group" / "Private contact" label for non-personal JIDs). Primary subtitle
- line directly under the name — what an operator reads first. */
-.chats-page .room-contact-phone {
- font-size: 0.8125rem;
- color: var(--text-muted);
- line-height: 1.2;
+.chats-page .avatar-tone-pink {
+ background: #fde3ee;
+ color: #d4467e;
}
-/* Raw JID preserved for technical use (lid resolution, webhook payloads, group ids). Muted mono,
- below the phone, truncated to keep the header compact — the full value is in the title tooltip. */
-.chats-page .room-contact-jid {
- font-size: 0.6875rem;
- color: var(--text-muted);
- font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
- opacity: 0.7;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
+.chats-page .avatar-tone-brown {
+ background: #f3e9dc;
+ color: #a1743f;
}
-.chats-page .room-messages {
- flex: 1;
- padding: 1.5rem;
- overflow-y: auto;
- /* Chrome/Firefox already adjust scrollTop on their own when content is prepended above the
- viewport (CSS scroll anchoring). The older-page handler applies its own correction for the
- same event, so leaving the browser's default on double-applies it. WebKit implements no
- scroll anchoring, so this is a no-op there and the manual correction is the only one that runs. */
- overflow-anchor: none;
- display: flex;
- flex-direction: column;
- gap: 0.75rem;
- background-image: radial-gradient(var(--border) 1px, transparent 0);
- background-size: 24px 24px;
- position: relative;
- /* The failure indicator's text is set against the width of the thread (the container query below), not the
- viewport: beside the list at an 890px viewport its client width is 244px, narrower than the 286px of a
- 320px phone. */
- container-type: inline-size;
+.chats-page .avatar-tone-violet {
+ background: #ede4fb;
+ color: #8257d1;
}
-/* Floating scroll-to-bottom button. Sits at the bottom-right of the messages pane (not the footer)
- so it overlays the conversation without stealing input-bar space. It is the last child of the
- scroller and sticky, not absolute: an absolute child of the scroller moves with the content, so it
- sat at the bottom of the first screen of the thread, off screen whenever it was shown. In flow it
- would add its own height and one flex gap to the thread, which the negative margin takes back, so
- the scroll height is the same with and without it (the gap is the 0.75rem of .room-messages). The
- right edge is the scroller's padding, clear of the scrollbar. It sits below a bubble's actions menu
- (z-index 5), which it would otherwise cover: it is later in the DOM, and the Delete icon of a message
- near the bottom edge of the pane lies under it. */
-.chats-page .scroll-to-bottom-btn {
- position: sticky;
- bottom: 1rem;
- align-self: flex-end;
- flex: none;
- margin-top: calc(-40px - 0.75rem);
- z-index: 4;
- width: 40px;
- height: 40px;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- background: var(--bg-white);
- color: var(--text-secondary);
- border: 1px solid var(--border);
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
- cursor: pointer;
- transition:
- background 0.15s,
- color 0.15s,
- transform 0.1s;
- padding: 0;
+.chats-page .avatar-tone-teal {
+ background: #daf3ee;
+ color: #1f9a85;
}
-.chats-page .scroll-to-bottom-btn:hover {
- background: var(--bg-light);
- color: var(--primary-text);
- border-color: var(--primary);
+[data-theme='dark'] .chats-page .chat-avatar[class*='avatar-tone-'] {
+ background: color-mix(in srgb, currentColor 18%, #111b21);
}
-.chats-page .scroll-to-bottom-btn:active {
- transform: scale(0.94);
+@media (prefers-color-scheme: dark) {
+ :root:not([data-theme='light']) .chats-page .chat-avatar[class*='avatar-tone-'] {
+ background: color-mix(in srgb, currentColor 18%, #111b21);
+ }
}
-.chats-page .messages-loading {
+.chats-page .action-avatar {
+ background: var(--chat-accent);
+ color: #fff;
+}
+
+.chats-page .chat-item-info {
+ flex: 1;
display: flex;
flex-direction: column;
- align-items: center;
- justify-content: center;
- flex: 1;
- color: var(--text-muted);
- font-size: 0.9375rem;
- gap: 0.75rem;
+ gap: 0.125rem;
+ min-width: 0; /* Ensures text truncation works */
}
-/* The older-page indicator (ChatThread): a pill that holds to the top edge of the pane while a page loads,
- and the failure to load one. Neither takes room in the thread: a row in flow adds its height and one flex
- gap above the oldest bubble, which pushed the reader's content down by that much when the page was
- requested and back up when it landed. The loading pill's height is explicit, and its margins take it and
- the gap back (the gap is the 0.75rem of .room-messages), as the scroll-to-bottom button does, so the
- thread lays out the same with and without the row. The top margin lifts it into the 1.5rem of padding,
- clear of the first bubble when the thread is at its top, whatever its height; the bottom margin is what is
- left to add up to minus the gap. It never takes a pointer event from a bubble under it, and it must not
- take the flex remainder either. */
-.chats-page .messages-loading-older {
- --older-row-height: 1.25rem;
- position: sticky;
- /* Sticky offsets are measured from the scroller's padding edge: the 1.5rem of padding back out, less
- the 0.125rem the pill keeps from the pane's edge. */
- top: -1.375rem;
- z-index: 4;
- align-self: center;
- flex: none;
- box-sizing: border-box;
+.chats-page .chat-item-top,
+.chats-page .chat-item-bottom {
display: flex;
align-items: center;
- justify-content: center;
- gap: 0.375rem;
- max-width: 100%;
- height: var(--older-row-height);
- margin-top: -1.375rem;
- margin-bottom: calc(0.625rem - var(--older-row-height));
- padding: 0 0.75rem;
- border: 1px solid var(--border);
- border-radius: 999px;
- background: var(--bg-white);
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
- color: var(--text-muted);
- font-size: 0.75rem;
- line-height: 1.25;
- pointer-events: none;
+ gap: 0.5rem;
}
-.chats-page .messages-loading-older > svg {
- flex: none;
- width: 0.875rem;
- height: 0.875rem;
+.chats-page .chat-item-bottom {
+ justify-content: space-between;
}
-/* The text has to clip (the ellipsis, and the line limit of the failure, need overflow other than visible),
- and a line box is shorter than the glyphs of some scripts: the tails of g and p, Telugu conjuncts below the
- base, Arabic marks above and below the letters. The padding is the room the clip leaves them, and the
- negative margin takes it back, so the span lays out as the line it is. */
-.chats-page .messages-loading-older > span {
- min-width: 0;
- padding-block: 0.25em;
- padding-inline: 0.15em;
- margin-block: -0.25em;
- margin-inline: -0.15em;
+.chats-page .chat-item-name {
+ font-size: 1rem;
+ font-weight: 600;
+ color: var(--text-primary);
+ white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
- white-space: nowrap;
}
-/* The failure carries the retry hint, so it wraps; its height is not known, and no margin can take it back. It
- is out of flow instead, so it takes no room at any height. It is not the reader's to carry through the
- thread: it stays at the top of the thread, where scrolling up again retries. Centred by its auto margins, as
- wide as its text up to the pane less its inset. It is held to two lines, which end inside the 1.5rem of
- padding and the top padding of the first bubble: a reader at the top of the thread is on that message, and a
- third line would run over its first line of text. Two lines hold the whole sentence of every translation
- in a thread wider than the container query below says; at that width or less only the retry instruction is
- shown. */
-.chats-page .messages-loading-older.failed {
- position: absolute;
- top: 0.125rem;
- inset-inline: 0.25rem;
- width: max-content;
- max-width: calc(100% - 0.5rem);
- height: auto;
- min-height: var(--older-row-height);
- margin: 0 auto;
- padding: 0 0.5rem;
- border-radius: 0.875rem;
- font-size: 0.6875rem;
+.chats-page .action-row .chat-item-name {
+ font-weight: 500;
}
-.chats-page .messages-loading-older.failed > span {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow-wrap: anywhere;
- text-align: center;
- white-space: normal;
+.chats-page .chat-item-time {
+ font-size: 0.8125rem;
+ color: var(--chat-meta);
+ flex-shrink: 0;
+ margin-inline-start: auto;
}
-.chats-page .messages-loading-older.failed > .older-failure-hint {
- display: none;
+.chats-page .chat-item-card.unread .chat-item-time {
+ color: var(--chat-accent);
+ font-weight: 600;
}
-/* In a thread of 17rem of content or less, two lines may not hold the whole sentence, and only the retry
- instruction is shown. The width queried is the content box of the thread: its client width, which leaves
- out a scrollbar, less the 1.5rem of padding on each side. 17rem of it is a client width of 320px. The
- longest sentence, the German one, needs 308px of client width for two lines in every engine. A 360px phone
- has 326px, and shows the sentence with an overlay scrollbar; a classic scrollbar of 6px leaves it 320px,
- and the instruction alone is shown. The instruction is two lines at most in the narrowest thread there is,
- 244px of client width beside the list at an 890px viewport (238px with a scrollbar of 6px). display: none
- takes the hidden text out of the accessibility tree as well, so what is read is what is shown. */
-@container (max-width: 17rem) {
- .chats-page .messages-loading-older.failed > .older-failure-full {
- display: none;
- }
-
- .chats-page .messages-loading-older.failed > .older-failure-hint {
- display: -webkit-box;
- }
+.chats-page .chat-item-snippet {
+ font-size: 0.875rem;
+ color: var(--chat-meta);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ min-width: 0;
}
-/* The loading label is one line while the pill fits it: the longest translation, the French one, is 285px
- wide with its icon and padding, and 18rem of content box is 288px. At 18rem or less the label may wrap
- onto a second line, at the size of the failure text. The pill is 1.875rem high there instead of 1.25rem
- whether or not the label wraps: its margins take that back (see above), and the two lines end where the
- failure's do, above the first message's text. */
-@container (max-width: 18rem) {
- .chats-page .messages-loading-older:not(.failed) {
- --older-row-height: 1.875rem;
- font-size: 0.6875rem;
- }
-
- .chats-page .messages-loading-older:not(.failed) > span {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow-wrap: anywhere;
- text-align: center;
- white-space: normal;
- }
+.chats-page .chat-item-snippet .no-message {
+ font-style: italic;
+ opacity: 0.85;
}
-.chats-page .messages-empty {
- display: flex;
- flex-direction: column;
+.chats-page .chat-unread-badge {
+ display: inline-flex;
align-items: center;
justify-content: center;
- flex: 1;
- color: var(--text-muted);
- font-size: 0.9375rem;
- gap: 0.75rem;
- text-align: center;
- padding: 2rem;
+ box-sizing: border-box;
+ height: 20px;
+ min-width: 20px;
+ padding-block: 0;
+ padding-inline: 6px;
+ background: var(--chat-accent);
+ color: #fff;
+ font-size: 0.75rem;
+ font-weight: 700;
+ line-height: 1;
+ border-radius: 999px;
+ flex-shrink: 0;
}
-.chats-page .message-bubble-wrapper {
- display: flex;
- width: 100%;
+.chats-page .chat-kind-badge {
+ font-size: 0.7rem;
+ padding-block: 0;
+ padding-inline: 6px;
+ border-radius: 8px;
+ border: 1px solid var(--chat-divider);
+ color: var(--chat-meta);
+ white-space: nowrap;
+ flex-shrink: 0;
}
-.chats-page .message-bubble-wrapper.incoming {
- justify-content: flex-start;
+.chats-page .status-compose-trigger {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.375rem;
+ width: 100%;
+ padding-block: 0.5rem;
+ padding-inline: 0.75rem;
+ font-size: 0.8125rem;
}
-.chats-page .message-bubble-wrapper.outgoing {
- justify-content: flex-end;
+.chats-page .chats-tab {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.375rem;
}
-.chats-page .message-bubble {
- max-width: 100%;
- padding: 0.625rem 0.875rem 0.375rem;
- border-radius: 12px;
- font-size: 0.9375rem;
- line-height: 1.4;
+/* Group rows: the chevron beside the time, shown on hover, on keyboard focus and while its list is open. Its
+ room is kept clear on every group row, so the time does not move when it appears. */
+.chats-page .chat-item-wrap {
position: relative;
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
-.chats-page .message-bubble.incoming {
- background: var(--bg-white);
- color: var(--text-primary);
- border-end-start-radius: 2px;
- border: 1px solid var(--border);
+.chats-page .chat-item-wrap.has-menu .chat-item-top {
+ padding-inline-end: 1.75rem;
}
-.chats-page .message-bubble.outgoing {
- background: #d9fdd3; /* Soft WhatsApp Green */
- color: #111b21;
- border-end-end-radius: 2px;
+.chats-page .chat-row-menu {
+ position: absolute;
+ top: 0.5rem;
+ inset-inline-end: 0.5rem;
}
-/* Dark theme outgoing chat bubble override */
-[data-theme='dark'] .chats-page .message-bubble.outgoing {
- background: #005c4b; /* Dark WhatsApp Green */
- color: #e9edef;
+.chats-page .chat-row-menu-trigger {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 26px;
+ height: 26px;
+ padding: 0;
+ border: 1px solid var(--chat-divider);
+ border-radius: 8px;
+ background: var(--chat-panel);
+ color: var(--chat-icon);
+ cursor: pointer;
+ opacity: 0;
+ transition: opacity 0.12s;
}
-/* System-dark twin: the default 'system' theme removes data-theme entirely, so the explicit rule
- above never matches on a dark OS. :not([data-theme='light']) keeps an explicit light choice in
- control (same pattern as Webhooks.css). */
-@media (prefers-color-scheme: dark) {
- :root:not([data-theme='light']) .chats-page .message-bubble.outgoing {
- background: #005c4b;
- color: #e9edef;
- }
+.chats-page .chat-item-wrap:hover .chat-row-menu-trigger,
+.chats-page .chat-row-menu.open .chat-row-menu-trigger,
+.chats-page .chat-row-menu-trigger:focus-visible {
+ opacity: 1;
}
-.chats-page .message-text {
- word-break: break-word;
- white-space: pre-wrap;
+.chats-page .chat-row-menu-trigger:focus-visible {
+ outline: 2px solid var(--chat-accent);
+ outline-offset: 1px;
}
-/* Group sender label: the poster's name atop an incoming group bubble (colour set inline per sender). */
-.chats-page .message-sender {
- font-size: 0.78rem;
- font-weight: 600;
- line-height: 1.2;
- margin-bottom: 0.15rem;
- word-break: break-word;
+.chats-page .chat-row-menu-popover {
+ position: absolute;
+ top: calc(100% + 0.375rem);
+ inset-inline-end: 0;
+ z-index: 30;
+ min-width: 240px;
+ padding: 0.375rem;
+ display: flex;
+ flex-direction: column;
+ background: var(--chat-panel);
+ border: 1px solid var(--chat-divider);
+ border-radius: 14px;
+ box-shadow: var(--shadow-lg);
}
-.chats-page .message-meta {
+.chats-page .chat-row-menu-popover button {
display: flex;
align-items: center;
- justify-content: flex-end;
- gap: 0.25rem;
- margin-top: 0.25rem;
+ gap: 0.875rem;
+ padding-block: 0.625rem;
+ padding-inline: 0.75rem;
+ background: transparent;
+ border: none;
+ border-radius: 10px;
+ font-size: 0.9375rem;
+ color: var(--text-primary);
+ text-align: start;
+ white-space: nowrap;
+ cursor: pointer;
}
-.chats-page .message-edited,
-.chats-page .message-time {
- font-size: 0.6875rem;
- color: var(--text-muted);
+.chats-page .chat-row-menu-popover button:hover,
+.chats-page .chat-row-menu-popover button:focus-visible {
+ background: var(--chat-hover);
+ outline: none;
}
-/* A styled status bubble sets its own inline background + white text; let its timestamp inherit
- instead of staying the muted gray meant for the default bubble. */
-.chats-page .message-bubble[style] .message-edited,
-.chats-page .message-bubble[style] .message-time {
- color: inherit;
- opacity: 0.75;
+.chats-page .chat-row-menu-group {
+ display: flex;
+ flex-direction: column;
}
-.chats-page .message-status-icon {
+.chats-page .chat-action-label {
+ display: flex;
+ flex-direction: column;
+ white-space: normal;
+}
+
+.chats-page .chat-action-label small {
+ max-width: 16rem;
font-size: 0.75rem;
+ color: var(--chat-meta);
}
-.chats-page .message-status-icon.read {
- /* The WhatsApp blue is 2.13:1 on the outgoing bubble, and these checks are TEXT, not an icon.
- Darkened to clear 4.5:1 there and on white; the status is also spelled out in aria-label/title,
- since delivered and read otherwise differ only by this colour. */
- color: #337592;
+.chats-page .chat-row-menu-popover button:disabled,
+.chats-page .room-menu-popover button:disabled {
+ cursor: not-allowed;
+ opacity: 0.6;
}
-/* =============================================================================
- INPUT BAR: Bottom Footer
- ============================================================================= */
-.chats-page .room-input-footer {
- background: var(--bg-white);
- border-top: 1px solid var(--border);
- padding: 1rem 1.5rem;
- box-sizing: border-box;
+.chats-page .chat-row-menu-popover button:disabled:hover,
+.chats-page .room-menu-popover button:disabled:hover {
+ background: transparent;
}
-.chats-page .input-form {
- display: flex;
- gap: 0.75rem;
- align-items: center;
+.chats-page .chat-row-menu-popover hr {
+ width: 100%;
+ margin-block: 0.25rem;
+ border: none;
+ border-top: 1px solid var(--chat-divider);
}
-.chats-page .message-text-input {
- flex: 1;
- /* An input keeps its intrinsic width as its automatic minimum, which pinned the whole composer to
- 369px and pushed the send button outside the layout's clip. The floor replaces that with one small
- enough to let the composer fit a narrow pane and large enough to keep a caret and a few characters
- visible; without it the box shrinks to its own padding and shows nothing at all. */
- min-width: 64px;
- padding: 0.75rem 1rem;
- border: 1px solid var(--border);
- border-radius: 24px;
- font-size: 0.9375rem;
- background: var(--bg-light);
- color: var(--text-primary);
- outline: none;
- transition: all 0.2s;
- box-sizing: border-box;
+/* Leave-group confirmation: the confirm-modal shape the Sessions page uses. */
+.chats-page .confirm-modal {
+ max-width: 420px;
}
-.chats-page .message-text-input:focus {
- border-color: var(--primary);
- background: var(--bg-white);
- box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
+.chats-page .confirm-modal .modal-body p {
+ margin: 0 0 0.5rem;
}
-.chats-page .btn-send-message {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 48px;
- height: 48px;
- background: var(--primary);
- border: none;
- border-radius: 50%;
- color: white;
- cursor: pointer;
- transition:
- background 0.2s,
- transform 0.1s;
- flex-shrink: 0;
- box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
+.chats-page .confirm-modal .text-muted {
+ color: var(--text-muted);
+ font-size: 0.875rem;
}
-.chats-page .btn-send-message:hover:not(:disabled) {
- background: var(--primary-hover);
- transform: scale(1.05);
+.chats-page .chat-item-flags {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.25rem;
+ color: var(--chat-meta);
+ flex-shrink: 0;
+ margin-inline-start: auto;
}
-.chats-page .btn-send-message:disabled {
- /* Keep the brand silhouette readable while clearly inactive — a bare gray-on-gray glyph
- reads as "no button here" rather than "send, disabled". */
- background: var(--primary);
- color: #fff;
- opacity: 0.55;
- cursor: not-allowed;
- box-shadow: none;
+.chats-page .chat-item-flags + .chat-unread-badge {
+ margin-inline-start: 0.25rem;
}
-/* =============================================================================
- GENERAL CHATS STYLES & ERROR STATES
- ============================================================================= */
-.chats-page .chats-loading-container,
-.chats-page .chats-error-state {
+/* The archive's entry at the head of the chat list, and the way back from its view. */
+.chats-page .chat-archive-entry {
display: flex;
- flex-direction: column;
align-items: center;
- justify-content: center;
- background: var(--bg-white);
- border: 1px solid var(--border);
- border-radius: 16px;
- padding: 4rem 2rem;
- margin-top: 1rem;
- text-align: center;
- color: var(--text-secondary);
- box-shadow: var(--shadow-sm);
- flex: 1;
-}
-
-.chats-page .chats-error-state h3 {
- font-size: 1.25rem;
- margin: 1rem 0 0.5rem;
+ gap: 1.25rem;
+ width: 100%;
+ padding-block: 0.75rem;
+ padding-inline: 1.5rem 0.75rem;
+ background: transparent;
+ border: none;
+ border-radius: 10px;
color: var(--text-primary);
+ font: inherit;
+ font-weight: 500;
+ text-align: start;
+ cursor: pointer;
}
-.chats-page .chats-error-state p {
- font-size: 0.9375rem;
- max-width: 450px;
- margin: 0;
- color: var(--text-muted);
-}
-
-.chats-page .text-warn {
- color: var(--warning-text);
+.chats-page .chat-archive-entry svg {
+ color: var(--chat-accent);
}
-/* Real-time connection-lost banner */
-.chats-page .chats-reconnect-banner {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- padding: 0.5rem 0.75rem;
- margin-bottom: 0.75rem;
- border-radius: 6px;
- background: rgba(234, 88, 12, 0.1);
- color: var(--warning-text);
- font-size: 0.875rem;
+.chats-page .chat-archive-entry:hover {
+ background: var(--chat-hover);
}
-.chats-page .chats-reconnect-banner button {
+.chats-page .chat-archive-count {
margin-inline-start: auto;
+ font-size: 0.8125rem;
+ font-weight: 600;
+ color: var(--chat-accent);
}
-/* =============================================================================
- ATTACHMENT PREVIEW & EMOJI PICKER
- ============================================================================= */
-.chats-page .btn-input-accessory {
- background: transparent;
- border: none;
- color: var(--text-secondary);
- cursor: pointer;
- padding: 0.5rem;
- border-radius: 50%;
+/* The room's menu lists the row's actions too: its groups stack, and dividers part them. */
+.chats-page .room-menu-group {
display: flex;
- align-items: center;
- justify-content: center;
- transition: all 0.2s ease;
- flex-shrink: 0;
+ flex-direction: column;
}
-.chats-page .btn-input-accessory:hover {
- background: var(--bg-light);
- color: var(--text-primary);
+.chats-page .room-menu-popover hr {
+ width: 100%;
+ margin-block: 0.25rem;
+ border: none;
+ border-top: 1px solid var(--chat-divider);
}
-.chats-page .btn-input-accessory.active {
- background: rgba(34, 197, 94, 0.1);
- color: var(--primary-text);
+/* Mute and save-contact dialogs (confirm-modal cards). */
+.chats-page .chat-dialog-options {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ margin: 0.75rem 0 0;
+ padding: 0;
+ border: none;
}
-.chats-page .attachment-preview-banner {
- background: var(--bg-white);
- border-top: 1px solid var(--border);
- padding: 0.75rem 1.5rem;
+.chats-page .chat-dialog-options label {
display: flex;
align-items: center;
- gap: 1rem;
- box-sizing: border-box;
+ gap: 0.75rem;
+ font-size: 0.9375rem;
+ color: var(--text-primary);
+ cursor: pointer;
}
-.chats-page .preview-thumbnail {
- width: 48px;
- height: 48px;
- object-fit: cover;
- border-radius: 6px;
- border: 1px solid var(--border);
+.chats-page .chat-dialog-options input {
+ accent-color: var(--chat-accent);
+ width: 18px;
+ height: 18px;
}
-.chats-page .preview-file-icon {
- width: 48px;
- height: 48px;
- background: var(--bg-light);
- border: 1px solid var(--border);
- border-radius: 6px;
+.chats-page .chat-dialog-form {
display: flex;
- align-items: center;
- justify-content: center;
- font-size: 1.5rem;
+ flex-direction: column;
+ gap: 1rem;
}
-.chats-page .preview-file-info {
- flex: 1;
+.chats-page .chat-dialog-form label {
display: flex;
flex-direction: column;
- min-width: 0;
-}
-
-.chats-page .preview-filename {
+ gap: 0.375rem;
font-size: 0.875rem;
font-weight: 600;
color: var(--text-primary);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
}
-.chats-page .preview-filesize {
- font-size: 0.75rem;
- color: var(--text-muted);
+.chats-page .chat-dialog-form input {
+ padding-block: 0.625rem;
+ padding-inline: 0.875rem;
+ border: 1px solid var(--chat-divider);
+ border-radius: 10px;
+ background: var(--chat-panel-header);
+ color: var(--text-primary);
+ font: inherit;
+ font-weight: 400;
+ outline: none;
}
-.chats-page .btn-remove-attachment {
- background: transparent;
- border: none;
- color: var(--text-muted);
- cursor: pointer;
- padding: 0.375rem;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: all 0.2s;
+.chats-page .chat-dialog-form input:focus {
+ border-color: var(--chat-accent);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--chat-accent) 15%, transparent);
}
-.chats-page .btn-remove-attachment:hover {
- background: rgba(239, 68, 68, 0.12);
- color: var(--error-text);
+.chats-page .chat-dialog-form .text-muted {
+ margin: 0;
+ font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
+ font-size: 0.8125rem;
}
-.chats-page .chats-emoji-picker {
- background: var(--bg-white);
- border-top: 1px solid var(--border);
- padding: 0.75rem 1.5rem;
- box-sizing: border-box;
- max-height: 120px;
- overflow-y: auto;
+/* =============================================================================
+ GROUP INFO DIALOG (the global .modal card, inside the page)
+ ============================================================================= */
+.chats-page .group-info-modal {
+ max-width: 680px;
}
-.chats-page .emoji-grid {
+.chats-page .group-info-title {
display: flex;
- flex-wrap: wrap;
- gap: 0.5rem;
+ align-items: center;
+ gap: 1rem;
}
-.chats-page .emoji-btn {
- background: transparent;
- border: none;
- font-size: 1.25rem;
- padding: 0.375rem;
- border-radius: 6px;
- cursor: pointer;
- transition: all 0.15s;
+.chats-page .group-info-tile {
+ width: 52px;
+ height: 52px;
+ border-radius: 14px;
+ background: linear-gradient(135deg, #5fd17b, var(--chat-accent));
+ color: #fff;
display: flex;
align-items: center;
justify-content: center;
+ flex-shrink: 0;
}
-.chats-page .emoji-btn:hover {
- background: var(--bg-light);
+.chats-page .group-info-heading {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
}
-.chats-page .message-bubble.media-type {
- border-start-start-radius: 12px;
- border-start-end-radius: 12px;
+.chats-page .group-info-subtitle {
+ font-size: 1rem;
+ font-weight: 400;
+ color: var(--chat-meta);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
-/* =============================================================================
- RESPONSIVENESS
- ============================================================================= */
-@media (max-width: 768px) {
- .chats-page {
- padding: 1rem;
- height: calc(100dvh - 3.5rem);
- }
-
- .chats-page .chats-layout {
- flex-direction: column;
- height: calc(100vh - 7rem);
- }
-
- /* Single-pane on mobile: the list and the open conversation each take the full panel
- instead of being squeezed into one short stacked column. */
- .chats-page .chats-sidebar {
- width: 100%;
- height: 100%;
- border-inline-end: none;
- }
-
- .chats-page .chats-room {
- height: 100%;
- }
-
- /* Opening a chat replaces the list with the thread; the back button returns to the list. */
- .chats-page .chats-layout.has-active-chat .chats-sidebar {
- display: none;
- }
-
- .chats-page .chats-layout:not(.has-active-chat) .chats-room {
- display: none;
- }
-
- .chats-page .room-back {
- display: inline-flex;
- }
-
- .chats-page .room-header {
- height: 60px;
- }
+.chats-page .group-info-toolbar {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ flex-wrap: wrap;
+ padding-block: 1rem 0;
+ padding-inline: 1.5rem;
}
-/* Between the mobile breakpoint and 889px the two-pane layout leaves the room narrower than the
- composer's 244px minimum, so the send button fell outside the panel's clip with no scrollbar to
- recover it. In that band the panes swap one at a time instead, the way they already do on a phone.
- Bounded on both sides on purpose: at 768px and below the mobile shell owns the layout, and from 890px
- the room fits the composer again. The room is `viewport - 646`, so the bound is 646 + 244 - 1; it
- moves if the composer's own minimum does. Keyed to the navigation as well as the viewport, because
- that arithmetic only holds while the nav is expanded; collapsed it already fits and none of this
- should apply. `.main-content.expanded` is Layout's class for the COLLAPSED nav. */
-@media (min-width: 769px) and (max-width: 889px) {
- .main-content:not(.expanded) .chats-page .chats-layout {
- flex-direction: column;
- }
-
- .main-content:not(.expanded) .chats-page .chats-sidebar {
- width: 100%;
- height: 100%;
- border-inline-end: none;
- }
+.chats-page .group-info-toolbar .chats-tabs {
+ flex: none;
+}
- .main-content:not(.expanded) .chats-page .chats-layout.has-active-chat .chats-sidebar {
- display: none;
- }
+.chats-page .group-info-toolbar .chats-tab {
+ padding-block: 0.5rem;
+ padding-inline: 0.875rem;
+ font-size: 0.9375rem;
+}
- .main-content:not(.expanded) .chats-page .chats-layout:not(.has-active-chat) .chats-room {
- display: none;
- }
+.chats-page .group-info-toolbar .icon-btn {
+ margin-inline-start: auto;
+}
- .main-content:not(.expanded) .chats-page .room-back {
- display: inline-flex;
- }
+.chats-page .group-info-badge {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5rem;
+ padding-block: 0.5rem;
+ padding-inline: 0.875rem;
+ border-radius: 10px;
+ border: 1px solid var(--chat-divider);
+ background: var(--chat-panel-header);
+ color: var(--chat-meta);
+ font-size: 0.9375rem;
}
-/* =============================================================================
- MEDIA RENDERING STYLES
- ============================================================================= */
-.chats-page .chat-image-media {
- max-width: 100%;
- max-height: 250px;
- border-radius: 8px;
- display: block;
- margin-bottom: 0.5rem;
- cursor: pointer;
- object-fit: cover;
+.chats-page .group-info-badge.admin {
+ border-color: color-mix(in srgb, var(--chat-accent) 35%, transparent);
+ background: color-mix(in srgb, var(--chat-accent) 10%, var(--chat-panel));
+ color: var(--chat-pill-active-text);
}
-/* An archived preview swaps a 14px spinner (plus .25rem of margin) for an image that has no box until it
- decodes. Holding that box at the difference to the image's own .5rem of margin keeps the swap from
- shortening the thread: a shorter thread clamps a scroll position pinned to the bottom, and the clamp
- reaches the scroll hook as the reader scrolling away. It also makes the box the hook seeds at mount
- exactly what the thread gains once the image decodes. */
-.chats-page .chat-image-media-archived {
- min-height: calc(14px - 0.25rem);
+.chats-page .group-info-state {
+ display: flex;
+ justify-content: center;
+ padding: 2rem;
+ color: var(--chat-meta);
}
-/* A button, not a label: the bytes are fetchable from the per-message media route, so this is the
- viewer's handle on media the list did not inline. Styled to keep the previous inert appearance
- apart from the affordance. */
-.chats-page .message-media-omitted {
+.chats-page .group-info-form {
display: flex;
- align-items: center;
- gap: 0.3rem;
- padding: 0;
- border: none;
- background: none;
- color: var(--text-muted);
- font-style: italic;
- font-size: 0.9em;
- font-family: inherit;
- margin-bottom: 0.25rem;
- cursor: pointer;
- text-decoration: underline dotted;
+ flex-direction: column;
+ gap: 1.25rem;
}
-.chats-page .message-media-omitted:disabled {
- cursor: default;
- text-decoration: none;
+.chats-page .group-info-field {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ font-size: 1rem;
+ font-weight: 600;
+ color: var(--text-primary);
}
-/* The archived audio and video placeholders hold the height of the element that replaces them, so the
- bubble does not grow when the bytes land and move a thread that was pinned to the bottom or being read.
- The element's own bottom margin is 0.5rem and the placeholder's 0.25rem, so the quarter rem that is
- missing from the margin is added to the box: a native audio player is 54px tall, and a video element
- that has no metadata yet has the default 150px replaced-element height. */
-.chats-page .message-media-archived-loading-audio {
- min-height: calc(54px + 0.25rem);
+.chats-page .group-info-field .required {
+ color: var(--error);
}
-.chats-page .message-media-archived-loading-video {
- min-height: calc(150px + 0.25rem);
+.chats-page .group-info-field input,
+.chats-page .group-info-field textarea,
+.chats-page .group-info-add input {
+ width: 100%;
+ box-sizing: border-box;
+ padding-block: 0.75rem;
+ padding-inline: 1rem;
+ border: 1px solid var(--chat-divider);
+ border-radius: 10px;
+ background: var(--chat-panel-header);
+ color: var(--text-primary);
+ font: inherit;
+ font-weight: 400;
+ outline: none;
}
-/* The map preview keeps its own modest cap, but bounded by the bubble the way every other media type
- here is. As a bare pixel width it stayed 220px wide in a narrower room and ran past the panel edge. */
-.chats-page .chat-location-media {
- max-width: min(220px, 100%);
- border-radius: 8px;
- display: block;
- margin-bottom: 0.25rem;
+.chats-page .group-info-field textarea {
+ resize: vertical;
+ min-height: 7rem;
}
-.chats-page .chat-video-media {
- max-width: 100%;
- max-height: 250px;
- border-radius: 8px;
- display: block;
- margin-bottom: 0.5rem;
+.chats-page .group-info-field input:focus,
+.chats-page .group-info-field textarea:focus,
+.chats-page .group-info-add input:focus {
+ border-color: var(--chat-accent);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--chat-accent) 15%, transparent);
}
-.chats-page .chat-audio-media {
- max-width: 100%;
- display: block;
- margin-bottom: 0.5rem;
+.chats-page .group-info-field input:disabled,
+.chats-page .group-info-field textarea:disabled {
+ opacity: 0.7;
+ cursor: not-allowed;
}
-.chats-page .chat-document-media {
- display: inline-flex;
+.chats-page .group-info-picture {
+ display: flex;
align-items: center;
- gap: 0.5rem;
- padding: 0.5rem 0.75rem;
- background: var(--bg-light);
- border: 1px solid var(--border);
- border-radius: 6px;
+ gap: 1.25rem;
+ padding: 1rem;
+ border: 1px solid var(--chat-divider);
+ border-radius: 12px;
+ background: var(--chat-panel-header);
color: var(--text-primary);
- text-decoration: none;
- font-size: 0.875rem;
- font-weight: 500;
- margin-bottom: 0.5rem;
- transition: all 0.2s;
- word-break: break-all;
+ font: inherit;
+ font-weight: 400;
+ text-align: start;
+ cursor: pointer;
}
-.chats-page .chat-document-media:hover {
- background: var(--border);
+.chats-page .group-info-picture:hover:not(:disabled) {
+ border-color: var(--chat-accent);
}
-[data-theme='dark'] .chats-page .chat-document-media {
- background: #202c33;
- border-color: #2f3b43;
+.chats-page .group-info-picture:disabled {
+ cursor: default;
}
-@media (prefers-color-scheme: dark) {
- :root:not([data-theme='light']) .chats-page .chat-document-media {
- background: #202c33;
- border-color: #2f3b43;
- }
+.chats-page .group-info-picture .chat-avatar {
+ width: 96px;
+ height: 96px;
+ background: var(--chat-panel);
+ border: 1px solid var(--chat-divider);
}
-.chats-page .message-bubble.media-type {
- padding: 0.5rem;
+.chats-page .group-info-members {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
}
-/* =============================================================================
- HOVER MENU, REPLIES, REACTIONS, AND DELETIONS
- ============================================================================= */
-.chats-page .message-bubble-container {
- position: relative;
+.chats-page .group-info-add {
display: flex;
- align-items: center;
gap: 0.5rem;
- max-width: 70%;
}
-.chats-page .message-bubble-wrapper.outgoing .message-bubble-container {
- flex-direction: row-reverse;
+.chats-page .group-info-add button {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.375rem;
+ flex-shrink: 0;
+}
+
+.chats-page .group-info-count {
+ font-size: 0.875rem;
+ font-weight: 600;
+ color: var(--chat-meta);
+}
+
+.chats-page .group-info-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.chats-page .group-info-list li {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ padding-block: 0.5rem;
+ border-bottom: 1px solid var(--chat-divider);
+}
+
+.chats-page .group-info-member {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ flex: 1;
+}
+
+.chats-page .group-info-member .name {
+ font-weight: 500;
+ color: var(--text-primary);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.chats-page .group-info-member .number {
+ font-size: 0.8125rem;
+ color: var(--chat-meta);
+}
+
+.chats-page .group-info-role {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.25rem;
+ padding-block: 0.125rem;
+ padding-inline: 0.5rem;
+ border-radius: 999px;
+ background: var(--chat-pill-active-bg);
+ color: var(--chat-pill-active-text);
+ font-size: 0.75rem;
+ font-weight: 600;
+ flex-shrink: 0;
+}
+
+.chats-page .group-info-actions {
+ display: flex;
+ gap: 0.125rem;
+ flex-shrink: 0;
+}
+
+.chats-page .icon-btn.danger:hover {
+ color: var(--error-text);
+ background: rgba(239, 68, 68, 0.12);
+}
+
+/* =============================================================================
+ NEW CHAT / NEW GROUP PANEL (sidebar sub-view)
+ ============================================================================= */
+.chats-page .new-chat-panel {
+ flex: 1;
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+}
+
+.chats-page .new-chat-header {
+ height: 64px;
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ padding-block: 0;
+ padding-inline: 0.75rem;
+ border-bottom: 1px solid var(--chat-divider);
+ font-size: 1rem;
+ font-weight: 600;
+ color: var(--text-primary);
+ box-sizing: border-box;
+ flex-shrink: 0;
+}
+
+.chats-page .new-chat-search {
+ margin-block: 0.75rem 0;
+ margin-inline: 1rem;
+ flex-shrink: 0;
+}
+
+.chats-page .new-chat-hint {
+ margin-block: 0.375rem 0;
+ margin-inline: 1rem;
+ font-size: 0.8125rem;
+ color: var(--chat-meta);
+}
+
+.chats-page .new-chat-list {
+ padding-block-start: 0.5rem;
+}
+
+.chats-page .new-chat-section-label {
+ padding-block: 0.875rem 0.375rem;
+ padding-inline: 0.75rem;
+ font-size: 0.8125rem;
+ font-weight: 600;
+ color: var(--chat-accent);
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+}
+
+.chats-page .select-check {
+ width: 22px;
+ height: 22px;
+ box-sizing: border-box;
+ border-radius: 6px;
+ border: 2px solid color-mix(in srgb, var(--chat-meta) 60%, transparent);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ color: #fff;
+}
+
+.chats-page .select-check.checked {
+ background: var(--chat-accent);
+ border-color: var(--chat-accent);
+}
+
+.chats-page .new-group-fields {
+ display: flex;
+ flex-direction: column;
+ gap: 0.625rem;
+ padding-block: 0.875rem 0;
+ padding-inline: 1rem;
+ flex-shrink: 0;
+}
+
+.chats-page .new-group-name {
+ height: 42px;
+ padding-block: 0;
+ padding-inline: 0.875rem;
+ border: none;
+ border-bottom: 2px solid var(--chat-accent);
+ background: transparent;
+ font-size: 1rem;
+ color: var(--text-primary);
+ outline: none;
+}
+
+.chats-page .new-group-name::placeholder {
+ color: var(--chat-meta);
+}
+
+.chats-page .participant-chips {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.375rem;
+ max-height: 96px;
+ overflow-y: auto;
+}
+
+.chats-page .participant-chip {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.25rem;
+ padding-block: 0.25rem;
+ padding-inline: 0.75rem 0.25rem;
+ background: var(--chat-active);
+ border-radius: 999px;
+ font-size: 0.8125rem;
+ color: var(--text-primary);
+}
+
+.chats-page .participant-chip button {
+ display: flex;
+ padding: 2px;
+ background: transparent;
+ border: none;
+ border-radius: 50%;
+ color: var(--chat-meta);
+ cursor: pointer;
+}
+
+.chats-page .participant-chip button:hover {
+ background: color-mix(in srgb, var(--chat-icon) 14%, transparent);
+}
+
+.chats-page .new-group-footer {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.75rem;
+ padding-block: 0.75rem;
+ padding-inline: 1rem;
+ border-top: 1px solid var(--chat-divider);
+ flex-shrink: 0;
+}
+
+.chats-page .new-group-count {
+ font-size: 0.875rem;
+ color: var(--chat-meta);
+}
+
+.chats-page .new-group-create {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.375rem;
+ padding-block: 0.5rem;
+ padding-inline: 1rem;
+ background: var(--chat-accent);
+ border: none;
+ border-radius: 999px;
+ color: #fff;
+ font-size: 0.875rem;
+ font-weight: 600;
+ cursor: pointer;
+}
+
+.chats-page .new-group-create:hover:not(:disabled) {
+ background: var(--chat-accent-hover);
+}
+
+.chats-page .new-group-create:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
+
+/* =============================================================================
+ CHAT ROOM: Right Column
+ ============================================================================= */
+.chats-page .chats-room {
+ flex: 1;
+ min-width: 0;
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+ background: var(--chat-wallpaper);
+}
+
+.chats-page .chats-room-placeholder {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 3rem;
+ text-align: center;
+ color: var(--chat-meta);
+ background: var(--chat-panel-header);
+ border-bottom: 6px solid var(--chat-accent);
+}
+
+.chats-page .placeholder-icon {
+ margin-bottom: 1.5rem;
+ opacity: 0.35;
+}
+
+.chats-page .chats-room-placeholder h2 {
+ font-size: 1.5rem;
+ font-weight: 300;
+ color: var(--text-primary);
+ /* Reset the global h2 eyebrow treatment: this is an empty-state title, not a section label. */
+ text-transform: none;
+ letter-spacing: -0.01em;
+ margin: 0 0 0.5rem;
+}
+
+.chats-page .chats-room-placeholder p {
+ font-size: 0.9375rem;
+ max-width: 420px;
+ margin: 0;
+}
+
+.chats-page .room-container {
+ flex: 1;
+ min-height: 0;
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+}
+
+.chats-page .room-header,
+.chats-page .chats-room-header {
+ height: 64px;
+ background: var(--chat-panel-header);
+ border-bottom: 1px solid var(--chat-divider);
+ padding-block: 0;
+ padding-inline: 1rem 0.75rem;
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ box-sizing: border-box;
+ flex-shrink: 0;
+}
+
+/* Back-to-list control: only needed in the single-pane mobile layout; hidden on the two-pane desktop. */
+.chats-page .room-back {
+ display: none;
+ align-items: center;
+ justify-content: center;
+ width: 36px;
+ height: 36px;
+ /* Reset the global `button` padding (0.6em 1.2em): with box-sizing:border-box it would consume
+ the whole 36px width and collapse the arrow icon to 0px wide, making the button look empty. */
+ padding: 0;
+ margin-inline-start: -0.5rem;
+ background: transparent;
+ border: none;
+ border-radius: 50%;
+ color: var(--chat-icon);
+ cursor: pointer;
+ flex-shrink: 0;
+}
+
+.chats-page .room-back:hover {
+ background: color-mix(in srgb, var(--chat-icon) 14%, transparent);
+}
+
+.chats-page .room-contact {
+ flex: 1;
+ min-width: 0;
+ display: flex;
+ align-items: center;
+ gap: 0.875rem;
+ padding: 0;
+ background: transparent;
+ border: none;
+ cursor: pointer;
+ text-align: start;
+ color: inherit;
+}
+
+.chats-page .room-contact-info {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ line-height: 1.25;
+}
+
+.chats-page .room-contact-name {
+ font-size: 1rem;
+ font-weight: 600;
+ color: var(--text-primary);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.chats-page .room-contact-phone {
+ font-size: 0.8125rem;
+ color: var(--chat-meta);
+}
+
+.chats-page .room-header-actions {
+ display: flex;
+ align-items: center;
+ gap: 0.25rem;
+ flex-shrink: 0;
+}
+
+.chats-page .room-menu {
+ position: relative;
+}
+
+.chats-page .room-menu-popover {
+ position: absolute;
+ top: calc(100% + 6px);
+ inset-inline-end: 0;
+ z-index: 30;
+ min-width: 200px;
+ padding: 0.375rem;
+ display: flex;
+ flex-direction: column;
+ background: var(--chat-panel);
+ border: 1px solid var(--chat-divider);
+ border-radius: 12px;
+ box-shadow: var(--shadow-lg);
+}
+
+.chats-page .room-menu-popover button {
+ display: flex;
+ align-items: center;
+ gap: 0.625rem;
+ padding-block: 0.625rem;
+ padding-inline: 0.75rem;
+ background: transparent;
+ border: none;
+ border-radius: 8px;
+ font-size: 0.875rem;
+ color: var(--text-primary);
+ cursor: pointer;
+ text-align: start;
+ white-space: nowrap;
+}
+
+.chats-page .room-menu-popover button:hover {
+ background: var(--chat-hover);
+}
+
+.chats-page .room-menu-popover svg {
+ color: var(--chat-icon);
+}
+
+/* =============================================================================
+ THREAD
+ ============================================================================= */
+.chats-page .room-messages {
+ flex: 1;
+ min-height: 0;
+ /* Load-bearing on every side: the older-page pill is lifted into the top padding, and the width its
+ failure text is measured against assumes 1.5rem inline (see .messages-loading-older). */
+ padding: 1.5rem;
+ overflow-y: auto;
+ /* Chrome/Firefox already adjust scrollTop on their own when content is prepended above the
+ viewport (CSS scroll anchoring). The older-page handler applies its own correction for the
+ same event, so leaving the browser's default on double-applies it. WebKit implements no
+ scroll anchoring, so this is a no-op there and the manual correction is the only one that runs. */
+ overflow-anchor: none;
+ display: flex;
+ flex-direction: column;
+ /* The space between two bubbles of one run; a new run adds its own margin. The older-page pill and the
+ scroll-to-bottom button take it back in their margins. */
+ gap: 2px;
+ background-color: var(--chat-wallpaper);
+ background-image: var(--chat-wallpaper-pattern);
+ background-size: 240px 240px;
+ position: relative;
+ /* The failure indicator's text is set against the width of the thread (the container query below), not the
+ viewport: beside the list at an 890px viewport its client width is narrower than a phone's. */
+ container-type: inline-size;
+}
+
+/* Floating scroll-to-bottom button. It is the last child of the scroller and sticky, not absolute: an
+ absolute child of the scroller moves with the content, so it sat at the bottom of the first screen of
+ the thread, off screen whenever it was shown. In flow it would add its own height and one flex gap to
+ the thread, which the negative margin takes back, so the scroll height is the same with and without it.
+ It sits below a bubble's actions menu (z-index 5), which it would otherwise cover: it is later in the
+ DOM, and the Delete icon of a message near the bottom edge of the pane lies under it. */
+.chats-page .scroll-to-bottom-btn {
+ position: sticky;
+ bottom: 0.75rem;
+ align-self: flex-end;
+ flex: none;
+ margin-top: calc(-42px - 2px);
+ z-index: 4;
+ width: 42px;
+ height: 42px;
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--chat-bubble-in);
+ color: var(--chat-icon);
+ border: none;
+ box-shadow: 0 2px 6px rgba(11, 20, 26, 0.2);
+ cursor: pointer;
+ transition:
+ color 0.15s,
+ transform 0.1s;
+ padding: 0;
+}
+
+.chats-page .scroll-to-bottom-btn:hover {
+ color: var(--chat-accent);
+}
+
+.chats-page .scroll-to-bottom-btn:active {
+ transform: scale(0.94);
+}
+
+.chats-page .messages-loading {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ flex: 1;
+ color: var(--chat-meta);
+ font-size: 0.9375rem;
+ gap: 0.75rem;
+}
+
+/* The older-page indicator (ChatThread): a pill that holds to the top edge of the pane while a page loads,
+ and the failure to load one. Neither takes room in the thread: a row in flow adds its height and one flex
+ gap above the oldest bubble, which pushed the reader's content down by that much when the page was
+ requested and back up when it landed. The loading pill's height is explicit, and its margins take it and
+ the gap back, as the scroll-to-bottom button does, so the thread lays out the same with and without the
+ row. The top margin lifts it into the 1.5rem of padding, clear of the first bubble when the thread is at
+ its top, whatever its height; the bottom margin is what is left to add up to minus the gap. It never takes
+ a pointer event from a bubble under it, and it must not take the flex remainder either. */
+.chats-page .messages-loading-older {
+ --older-row-height: 1.25rem;
+ position: sticky;
+ /* Sticky offsets are measured from the scroller's padding edge: the 1.5rem of padding back out, less
+ the 0.125rem the pill keeps from the pane's edge. */
+ top: -1.375rem;
+ z-index: 4;
+ align-self: center;
+ flex: none;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.375rem;
+ max-width: 100%;
+ height: var(--older-row-height);
+ margin-top: -1.375rem;
+ margin-bottom: calc(1.375rem - 2px - var(--older-row-height));
+ padding: 0 0.75rem;
+ border: 1px solid var(--chat-divider);
+ border-radius: 999px;
+ background: var(--chat-bubble-in);
+ box-shadow: var(--chat-shadow-bubble);
+ color: var(--chat-meta);
+ font-size: 0.75rem;
+ line-height: 1.25;
+ pointer-events: none;
+}
+
+.chats-page .messages-loading-older > svg {
+ flex: none;
+ width: 0.875rem;
+ height: 0.875rem;
+}
+
+/* The text has to clip (the ellipsis, and the line limit of the failure, need overflow other than visible),
+ and a line box is shorter than the glyphs of some scripts: the tails of g and p, Telugu conjuncts below the
+ base, Arabic marks above and below the letters. The padding is the room the clip leaves them, and the
+ negative margin takes it back, so the span lays out as the line it is. */
+.chats-page .messages-loading-older > span {
+ min-width: 0;
+ padding-block: 0.25em;
+ padding-inline: 0.15em;
+ margin-block: -0.25em;
+ margin-inline: -0.15em;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+/* The failure carries the retry hint, so it wraps; its height is not known, and no margin can take it back. It
+ is out of flow instead, so it takes no room at any height. It is not the reader's to carry through the
+ thread: it stays at the top of the thread, where scrolling up again retries. Centred by its auto margins, as
+ wide as its text up to the pane less its inset. It is held to two lines, which end inside the 1.5rem of
+ padding and the top padding of the first bubble: a reader at the top of the thread is on that message, and a
+ third line would run over its first line of text. Two lines hold the whole sentence of every translation
+ in a thread wider than the container query below says; at that width or less only the retry instruction is
+ shown. */
+.chats-page .messages-loading-older.failed {
+ position: absolute;
+ top: 0.125rem;
+ inset-inline: 0.25rem;
+ width: max-content;
+ max-width: calc(100% - 0.5rem);
+ height: auto;
+ min-height: var(--older-row-height);
+ margin: 0 auto;
+ padding: 0 0.5rem;
+ border-radius: 0.875rem;
+ font-size: 0.6875rem;
}
-.chats-page .message-bubble-wrapper.incoming .message-bubble-container {
- flex-direction: row;
+.chats-page .messages-loading-older.failed > span {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow-wrap: anywhere;
+ text-align: center;
+ white-space: normal;
}
-/* Hover Menu */
-.chats-page .message-actions-menu {
- position: absolute;
- top: 0.5rem;
- inset-inline-end: 0.5rem;
+.chats-page .messages-loading-older.failed > .older-failure-hint {
display: none;
- align-items: center;
- gap: 0.25rem;
- background: var(--bg-white);
- border: 1px solid var(--border);
- box-shadow: var(--shadow-sm);
- border-radius: 20px;
- padding: 2px 6px;
- z-index: 5;
}
-.chats-page .message-bubble-container:hover .message-actions-menu,
-.chats-page .room-messages:not([data-pointer]) .message-bubble-container:focus-within .message-actions-menu {
- display: flex;
+/* In a thread of 17rem of content or less, two lines may not hold the whole sentence, and only the retry
+ instruction is shown. The width queried is the content box of the thread: its client width, which leaves
+ out a scrollbar, less its inline padding. The longest sentence, the German one, needs 308px of client
+ width for two lines in every engine with 1.5rem of padding on each side. display: none takes the hidden
+ text out of the accessibility tree as well, so what is read is what is shown. */
+@container (max-width: 17rem) {
+ .chats-page .messages-loading-older.failed > .older-failure-full {
+ display: none;
+ }
+
+ .chats-page .messages-loading-older.failed > .older-failure-hint {
+ display: -webkit-box;
+ }
}
-/* A bubble is a keyboard stop (ChatThread): the ring says which message the arrow keys act on. */
-.chats-page .message-bubble-container:focus-visible {
- outline: 2px solid var(--primary);
- outline-offset: 2px;
- border-radius: 12px;
+/* The loading label is one line while the pill fits it: the longest translation, the French one, is 285px
+ wide with its icon and padding, and 18rem of content box is 288px. At 18rem or less the label may wrap
+ onto a second line, at the size of the failure text. The pill is 1.875rem high there instead of 1.25rem
+ whether or not the label wraps: its margins take that back (see above), and the two lines end where the
+ failure's do, above the first message's text. */
+@container (max-width: 18rem) {
+ .chats-page .messages-loading-older:not(.failed) {
+ --older-row-height: 1.875rem;
+ font-size: 0.6875rem;
+ }
+
+ .chats-page .messages-loading-older:not(.failed) > span {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow-wrap: anywhere;
+ text-align: center;
+ white-space: normal;
+ }
}
-.chats-page .action-btn {
- background: transparent;
- border: none;
- color: var(--text-muted);
- cursor: pointer;
- padding: 4px;
- border-radius: 50%;
+.chats-page .messages-empty {
display: flex;
+ flex-direction: column;
align-items: center;
justify-content: center;
- transition: all 0.15s ease;
-}
-
-.chats-page .action-btn:hover {
- background: var(--bg-light);
- color: var(--text-primary);
-}
-
-.chats-page .action-btn.delete-btn:hover {
- color: var(--error-text);
- background: rgba(239, 68, 68, 0.12);
-}
-
-/* Reaction Quick Popover */
-.chats-page .reaction-trigger-wrapper {
- position: relative;
+ flex: 1;
+ color: var(--chat-meta);
+ font-size: 0.9375rem;
+ gap: 0.75rem;
+ text-align: center;
+ padding: 2rem;
}
-.chats-page .reaction-quick-popover {
- display: none;
- position: absolute;
- bottom: 100%;
- left: 50%;
- /* --popover-shift is set when it opens, by the amount it would run past the pane (ChatThread). */
- transform: translateX(calc(-50% + var(--popover-shift, 0px))) translateY(-6px);
- background: var(--bg-white);
- border: 1px solid var(--border);
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
- border-radius: 24px;
- padding: 0.375rem 0.625rem;
- gap: 0.375rem;
- z-index: 50;
- white-space: nowrap;
+.chats-page .messages-empty span {
+ background: var(--chat-bubble-in);
+ padding-block: 0.5rem;
+ padding-inline: 0.875rem;
+ border-radius: 8px;
+ box-shadow: var(--chat-shadow-bubble);
}
-/* The pill sits at the end of its bubble and an own bubble is at the end of the pane, so a popover centred
- on the react icon runs past the pane and clips the last emoji, which cannot then be picked. Anchored to
- the end of the icon it grows toward the middle of the pane, in either text direction. */
-.chats-page .message-bubble-wrapper.outgoing .reaction-quick-popover {
- left: auto;
- inset-inline-end: 0;
- transform: translateX(var(--popover-shift, 0px)) translateY(-6px);
+/* Day separator pill */
+.chats-page .day-separator {
+ display: flex;
+ justify-content: center;
+ margin-block: 0.75rem 0.5rem;
}
-/* Opened below the icon when there is no room above it in the pane (ChatThread sets data-below). */
-.chats-page .reaction-quick-popover[data-below] {
- bottom: auto;
- top: 100%;
- transform: translateX(calc(-50% + var(--popover-shift, 0px))) translateY(6px);
+.chats-page .day-separator span {
+ padding-block: 0.3rem;
+ padding-inline: 0.75rem;
+ background: var(--chat-bubble-in);
+ color: var(--chat-bubble-text);
+ border-radius: 8px;
+ font-size: 0.8125rem;
+ font-weight: 600;
+ box-shadow: var(--chat-shadow-bubble);
}
-.chats-page .message-bubble-wrapper.outgoing .reaction-quick-popover[data-below] {
- transform: translateX(var(--popover-shift, 0px)) translateY(6px);
+/* Bubbles */
+.chats-page .message-bubble-wrapper {
+ display: flex;
+ width: 100%;
}
-.chats-page .reaction-quick-popover[data-below]::after {
- top: auto;
- bottom: 100%;
+.chats-page .message-bubble-wrapper.run-start {
+ margin-top: 0.5rem;
}
-.chats-page .reaction-quick-popover::after {
- content: '';
- position: absolute;
- top: 100%;
- left: 0;
- right: 0;
- height: 12px;
- background: transparent;
+.chats-page .day-separator + .message-bubble-wrapper.run-start {
+ margin-top: 0;
}
-.chats-page .reaction-trigger-wrapper:hover .reaction-quick-popover,
-.chats-page .room-messages:not([data-pointer]) .reaction-trigger-wrapper:focus-within .reaction-quick-popover {
- display: flex;
+.chats-page .message-bubble-wrapper.has-reactions {
+ margin-bottom: 0.875rem;
}
-.chats-page .reaction-quick-popover button {
- background: transparent;
- border: none;
- font-size: 1.25rem;
- padding: 2px;
- cursor: pointer;
- transition: transform 0.1s ease;
+.chats-page .message-bubble-wrapper.incoming {
+ justify-content: flex-start;
}
-.chats-page .reaction-quick-popover button:hover {
- transform: scale(1.3);
+.chats-page .message-bubble-wrapper.outgoing {
+ justify-content: flex-end;
}
-/* Reactions Badge */
-.chats-page .message-reactions-badge {
- position: absolute;
- bottom: -12px;
- background: var(--bg-white);
- border: 1px solid var(--border);
- box-shadow: var(--shadow-sm);
- border-radius: 12px;
- padding: 2px 6px;
+.chats-page .message-bubble-container {
+ position: relative;
display: flex;
align-items: center;
- gap: 2px;
- font-size: 0.75rem;
- z-index: 2;
- cursor: pointer;
- user-select: none;
+ gap: 0.5rem;
+ max-width: min(65%, 640px);
}
-.chats-page .message-bubble-wrapper.outgoing .message-reactions-badge {
- inset-inline-end: 12px;
+.chats-page .message-bubble-wrapper.outgoing .message-bubble-container {
+ flex-direction: row-reverse;
}
-.chats-page .message-bubble-wrapper.incoming .message-reactions-badge {
- inset-inline-start: 12px;
+.chats-page .message-bubble-wrapper.incoming .message-bubble-container {
+ flex-direction: row;
}
-.chats-page .reaction-emoji-span {
- font-size: 0.8125rem;
+.chats-page .message-bubble {
+ position: relative;
+ min-width: 0;
+ max-width: 100%;
+ padding: 0.375rem 0.5rem 0.5rem;
+ border-radius: 8px;
+ font-size: 0.9375rem;
+ line-height: 1.4;
+ color: var(--chat-bubble-text);
+ box-shadow: var(--chat-shadow-bubble);
}
-.chats-page .reactions-count-span {
- font-weight: 600;
- color: var(--text-secondary);
- margin-inline-start: 2px;
+.chats-page .message-bubble.incoming {
+ background: var(--chat-bubble-in);
}
-/* Quoted Box inside Bubble */
-.chats-page .message-quote-box {
- background: rgba(0, 0, 0, 0.04);
- border-inline-start: 4px solid var(--primary);
- border-radius: 4px;
- padding: 0.375rem 0.625rem;
- margin-bottom: 0.5rem;
- font-size: 0.8125rem;
- color: var(--text-secondary);
- cursor: pointer;
+.chats-page .message-bubble.outgoing {
+ background: var(--chat-bubble-out);
}
-.chats-page .message-bubble.outgoing .message-quote-box {
- background: rgba(0, 0, 0, 0.05);
- border-inline-start-color: #008069;
+/* The tail on the first bubble of a run, on the side the bubble comes from. */
+.chats-page .run-start .message-bubble.incoming {
+ border-start-start-radius: 0;
}
-[data-theme='dark'] .chats-page .message-quote-box {
- background: rgba(255, 255, 255, 0.08);
+.chats-page .run-start .message-bubble.outgoing {
+ border-start-end-radius: 0;
}
-/* Outgoing-bubble quote boxes: the plain dark rule loses the specificity tie with the light
- outgoing rule below, so both dark modes apply the same treatment explicitly. */
-[data-theme='dark'] .chats-page .message-bubble.outgoing .message-quote-box {
- background: rgba(255, 255, 255, 0.08);
+
+.chats-page .run-start .message-bubble::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ width: 8px;
+ height: 13px;
}
-@media (prefers-color-scheme: dark) {
- :root:not([data-theme='light']) .chats-page .message-quote-box {
- background: rgba(255, 255, 255, 0.08);
- }
+.chats-page .run-start .message-bubble.incoming::before {
+ inset-inline-start: -8px;
+ background: var(--chat-bubble-in);
+ clip-path: polygon(0 0, 100% 0, 100% 100%);
}
-.chats-page .quote-body {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 250px;
+.chats-page .run-start .message-bubble.outgoing::before {
+ inset-inline-end: -8px;
+ background: var(--chat-bubble-out);
+ clip-path: polygon(0 0, 100% 0, 0 100%);
}
-/* Inbound business prompt buttons (Baileys click-button) */
-.chats-page .message-prompt-buttons {
- display: flex;
- flex-direction: column;
- gap: 0.375rem;
- margin-top: 0.5rem;
- width: 100%;
+/* clip-path does not follow the writing direction, so a right-to-left layout mirrors both triangles. */
+[dir='rtl'] .chats-page .run-start .message-bubble.incoming::before {
+ clip-path: polygon(0 0, 100% 0, 0 100%);
}
-.chats-page .message-prompt-button {
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 0.375rem;
- width: 100%;
- padding: 0.5rem 0.75rem;
- border: 1px solid var(--border);
- border-radius: 8px;
- background: var(--bg-white);
- color: var(--primary);
- font-size: 0.875rem;
- font-weight: 500;
- cursor: pointer;
- transition:
- background 0.15s ease,
- border-color 0.15s ease,
- opacity 0.15s ease;
+[dir='rtl'] .chats-page .run-start .message-bubble.outgoing::before {
+ clip-path: polygon(0 0, 100% 0, 100% 100%);
}
-.chats-page .message-prompt-button:hover:not(:disabled) {
- background: rgba(0, 0, 0, 0.04);
- border-color: var(--primary);
+.chats-page .message-bubble.media-type {
+ padding-block: 0.25rem 0.375rem;
+ padding-inline: 0.25rem;
}
-.chats-page .message-prompt-button:disabled {
- cursor: default;
- opacity: 0.55;
+.chats-page .message-bubble.media-type .message-content {
+ padding-inline: 0.3125rem;
}
-.chats-page .message-prompt-button.selected {
- opacity: 1;
- border-color: var(--primary);
- background: rgba(0, 128, 105, 0.08);
+/* Revoked / Deleted message type */
+.chats-page .message-bubble.revoked-type .message-text {
+ font-style: italic;
+ color: var(--chat-meta);
+}
+
+/* Group sender label: the poster's name atop an incoming group bubble (colour set inline per sender). */
+.chats-page .message-sender {
+ font-size: 0.8125rem;
font-weight: 600;
+ line-height: 1.2;
+ margin-bottom: 0.15rem;
+ word-break: break-word;
}
-.chats-page .message-prompt-button.answered:not(.selected) {
- opacity: 0.4;
+/* Inline text plus trailing time and ticks. The spacer reserves the meta's width at the end of the last
+ line, and the meta sits absolutely over it, so it tucks into that line when it fits and wraps below. */
+.chats-page .message-content {
+ position: relative;
+ word-break: break-word;
}
-[data-theme='dark'] .chats-page .message-prompt-button {
- background: rgba(255, 255, 255, 0.06);
+.chats-page .message-content > .message-text {
+ display: inline;
+ white-space: pre-wrap;
}
-[data-theme='dark'] .chats-page .message-prompt-button:hover:not(:disabled) {
- background: rgba(255, 255, 255, 0.1);
+.chats-page .message-content > .message-poll-options {
+ display: block;
+ margin-block: 0.25rem;
+ padding-inline-start: 1.25rem;
}
-[data-theme='dark'] .chats-page .message-prompt-button.selected {
- background: rgba(0, 168, 132, 0.18);
+.chats-page .message-text a {
+ color: var(--chat-link);
+ text-decoration: underline;
}
-@media (prefers-color-scheme: dark) {
- :root:not([data-theme='light']) .chats-page .message-prompt-button {
- background: rgba(255, 255, 255, 0.06);
- }
+.chats-page .message-masked {
+ color: var(--chat-meta);
+}
- :root:not([data-theme='light']) .chats-page .message-prompt-button:hover:not(:disabled) {
- background: rgba(255, 255, 255, 0.1);
- }
+.chats-page .meta-spacer {
+ display: inline-block;
+ width: 3.25rem;
+ height: 1px;
+ vertical-align: baseline;
+}
- :root:not([data-theme='light']) .chats-page .message-prompt-button.selected {
- background: rgba(0, 168, 132, 0.18);
- }
+.chats-page .meta-spacer.with-status {
+ width: 4.5rem;
}
-/* Replying Preview Banner above Input Footer */
-.chats-page .replying-preview-banner {
- background: var(--bg-white);
- border-top: 1px solid var(--border);
- padding: 0.75rem 1.5rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 1rem;
- box-sizing: border-box;
+/* An edited label widens the room by its own text: a hidden copy sits in the spacer ahead of the fixed part. */
+.chats-page .meta-spacer:has(.meta-spacer-edited) {
+ width: auto;
+ overflow: hidden;
+ padding-inline-end: 3.25rem;
}
-.chats-page .replying-preview-content {
- flex: 1;
- border-inline-start: 4px solid var(--primary);
- padding-inline-start: 0.75rem;
- display: flex;
- flex-direction: column;
- min-width: 0;
+.chats-page .meta-spacer.with-status:has(.meta-spacer-edited) {
+ padding-inline-end: 4.5rem;
}
-.chats-page .replying-to-title {
- font-size: 0.8125rem;
- font-weight: 700;
- color: var(--primary-text);
- /* Same treatment as `.replying-to-body` below. Without it a quoted name with no break opportunity
- keeps its box but paints straight through the close button and out of the panel. */
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
+.chats-page .meta-spacer-edited {
+ visibility: hidden;
+ font-size: 0.6875rem;
+ padding-inline-end: 0.25rem;
}
-.chats-page .replying-to-body {
- font-size: 0.875rem;
- color: var(--text-secondary);
+.chats-page .message-meta {
+ position: absolute;
+ inset-inline-end: 0;
+ bottom: -0.3125rem;
+ display: inline-flex;
+ align-items: center;
+ gap: 0.1875rem;
white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
}
-.chats-page .btn-close-reply {
- background: transparent;
- border: none;
- color: var(--text-muted);
- cursor: pointer;
- padding: 0.375rem;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: all 0.2s;
+.chats-page .message-edited,
+.chats-page .message-time {
+ font-size: 0.6875rem;
+ color: var(--chat-meta);
}
-.chats-page .btn-close-reply:hover {
- background: var(--bg-light);
- color: var(--text-primary);
+/* A styled status bubble sets its own inline background + white text; let its timestamp inherit
+ instead of staying the muted gray meant for the default bubble. */
+.chats-page .message-bubble[style] .message-edited,
+.chats-page .message-bubble[style] .message-time {
+ color: inherit;
+ opacity: 0.75;
}
-/* Revoked / Deleted message type */
-.chats-page .message-bubble.revoked-type {
- font-style: italic;
- opacity: 0.6;
+.chats-page .message-status-icon {
+ display: inline-flex;
+ color: var(--chat-meta);
}
-[data-theme='dark'] .chats-page .message-actions-menu,
-[data-theme='dark'] .chats-page .reaction-quick-popover,
-[data-theme='dark'] .chats-page .message-reactions-badge {
- background: #202c33;
- border-color: #2f3b43;
+.chats-page .message-status-icon.read {
+ color: var(--chat-tick-read);
}
-@media (prefers-color-scheme: dark) {
- :root:not([data-theme='light']) .chats-page .message-actions-menu,
- :root:not([data-theme='light']) .chats-page .reaction-quick-popover,
- :root:not([data-theme='light']) .chats-page .message-reactions-badge {
- background: #202c33;
- border-color: #2f3b43;
- }
+.chats-page .message-status-icon.failed {
+ color: var(--error-text);
}
/* Inline code inside a message body. */
.chats-page .message-text code,
.chats-page .quote-body code {
- background: var(--bg-light);
- padding: 0.1em 0.35em;
+ background: color-mix(in srgb, var(--chat-bubble-text) 8%, transparent);
+ padding-block: 0.1em;
+ padding-inline: 0.35em;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-size: 0.9em;
@@ -1599,11 +2139,14 @@
/* Code block. */
.chats-page .message-text pre {
- background: var(--bg-light);
- padding: 0.5em 0.75em;
+ display: block;
+ background: color-mix(in srgb, var(--chat-bubble-text) 8%, transparent);
+ padding-block: 0.5em;
+ padding-inline: 0.75em;
border-radius: 6px;
- margin: 0.25em 0;
+ margin-block: 0.25em;
overflow-x: auto;
+ white-space: pre;
}
.chats-page .message-text pre code {
@@ -1611,997 +2154,1064 @@
padding: 0;
}
-/* Clickable photo cue. */
-.chats-page .chat-image-media {
- cursor: zoom-in;
-}
-
-/* =============================================================================
- CHANNELS: read-only post pane
- ============================================================================= */
-.chats-page .channel-room {
- flex: 1;
- display: flex;
- flex-direction: column;
- height: 100%;
-}
-
-.chats-page .chats-room-header {
- height: 70px;
- background: var(--bg-white);
- border-bottom: 1px solid var(--border);
- padding: 0 1.5rem;
- display: flex;
- align-items: center;
- gap: 0.75rem;
- box-sizing: border-box;
- color: var(--text-secondary);
+/* Quoted message inside a bubble */
+.chats-page .message-quote-box {
+ background: color-mix(in srgb, var(--chat-bubble-text) 6%, transparent);
+ border-inline-start: 4px solid var(--chat-quote-accent);
+ border-radius: 6px;
+ padding-block: 0.375rem;
+ padding-inline: 0.625rem;
+ margin-bottom: 0.375rem;
+ font-size: 0.8125rem;
+ color: var(--chat-meta);
+ cursor: pointer;
}
-/* The pane icon's only in-flow sibling here is the heading, which has never opted out of shrinking,
- so without this opt-out the row takes width from the icon as well. The heading absorbs most of the
- deficit but not all of it, and on the narrowest pane the icon is squeezed to a couple of pixels. */
-.chats-page .chats-room-header > svg {
- flex-shrink: 0;
+.chats-page .message-bubble.outgoing .message-quote-box {
+ border-inline-start-color: #008069;
}
-.chats-page .chats-room-header h2 {
- font-size: 1rem;
- font-weight: 600;
- color: var(--text-primary);
- text-transform: none;
- letter-spacing: normal;
- margin: 0;
- /* Same treatment as the chat header's h3. `overflow: hidden` is the load-bearing declaration: it
- both clips and zeroes this flex item's automatic minimum, so no min-width is needed here or on
- an ancestor. Without it the other two are inert and a long title runs past the panel edge. */
+.chats-page .quote-body {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
+ max-width: 320px;
}
-.chats-page .messages-list {
- flex: 1;
- padding: 1.5rem;
- overflow-y: auto;
+/* Inbound business prompt buttons (Baileys click-button) */
+.chats-page .message-prompt-buttons {
display: flex;
flex-direction: column;
- gap: 0.75rem;
- align-items: flex-start;
-}
-
-.chats-page .messages-list .message-bubble {
- max-width: 480px;
-}
-
-.chats-page .channel-media {
- max-width: 100%;
- max-height: 320px;
- border-radius: 8px;
- display: block;
- margin-bottom: 0.5rem;
- object-fit: cover;
-}
-
-/* Shown in place of media that cannot be shown: a status media blob that fails to load, or a
- channel post whose media has no URL. */
-.chats-page .status-media-placeholder {
- display: block;
- font-size: 0.85rem;
- color: var(--text-muted);
+ gap: 0.375rem;
+ margin-top: 0.5rem;
margin-bottom: 0.5rem;
+ width: 100%;
}
-/* =============================================================================
- STATUS COMPOSE MODAL
- ============================================================================= */
-.chats-page .status-compose-trigger {
+.chats-page .message-prompt-button {
display: flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
width: 100%;
- padding: 0.5rem 0.75rem;
- font-size: 0.8125rem;
-}
-
-.chats-page .status-compose-modal .compose-type-toggle {
- display: flex;
- border: 1px solid var(--border);
- border-radius: var(--radius, 8px);
- overflow: hidden;
- margin-bottom: 1rem;
-}
-
-.chats-page .status-compose-modal .compose-type-toggle button {
- flex: 1;
- padding: 0.625rem 1rem;
+ padding-block: 0.5rem;
+ padding-inline: 0.75rem;
+ border: 1px solid var(--chat-divider);
+ border-radius: 8px;
+ background: color-mix(in srgb, var(--chat-bubble-text) 4%, var(--chat-bubble-in));
+ color: var(--chat-pill-active-text);
font-size: 0.875rem;
font-weight: 500;
- background: var(--bg-white);
- border: none;
cursor: pointer;
- transition: all 0.2s;
- color: var(--text-secondary);
+ transition:
+ background 0.15s ease,
+ border-color 0.15s ease,
+ opacity 0.15s ease;
}
-.chats-page .status-compose-modal .compose-type-toggle button:first-child {
- border-inline-end: 1px solid var(--border);
+.chats-page .message-prompt-button:hover:not(:disabled) {
+ background: color-mix(in srgb, var(--chat-bubble-text) 8%, var(--chat-bubble-in));
+ border-color: var(--chat-accent);
}
-.chats-page .status-compose-modal .compose-type-toggle button.active {
- background: var(--primary);
- color: white;
+.chats-page .message-prompt-button:disabled {
+ cursor: default;
+ opacity: 0.55;
}
-.chats-page .status-compose-modal .compose-field {
- display: flex;
- flex-direction: column;
- gap: 0.375rem;
- margin-bottom: 1rem;
+.chats-page .message-prompt-button.selected {
+ opacity: 1;
+ border-color: var(--chat-accent);
+ background: color-mix(in srgb, var(--chat-accent) 14%, var(--chat-bubble-in));
+ font-weight: 600;
}
-.chats-page .status-compose-modal .compose-field label {
- font-size: 0.8125rem;
- font-weight: 600;
- color: var(--text-secondary);
+.chats-page .message-prompt-button.answered:not(.selected) {
+ opacity: 0.4;
}
-.chats-page .status-compose-modal textarea,
-.chats-page .status-compose-modal input[type='text'],
-.chats-page .status-compose-modal input[type='url'],
-.chats-page .status-compose-modal select {
- width: 100%;
- padding: 0.625rem 0.75rem;
- border: 1px solid var(--border);
- border-radius: var(--radius, 8px);
- background: var(--bg-light);
- color: var(--text-primary);
- font-size: 0.875rem;
- outline: none;
- box-sizing: border-box;
- font-family: inherit;
+/* =============================================================================
+ MEDIA RENDERING STYLES
+ ============================================================================= */
+.chats-page .chat-image-media {
+ max-width: 100%;
+ max-height: 340px;
+ border-radius: 6px;
+ display: block;
+ margin-bottom: 0.5rem;
+ cursor: zoom-in;
+ object-fit: cover;
}
-.chats-page .status-compose-modal textarea:focus,
-.chats-page .status-compose-modal input:focus,
-.chats-page .status-compose-modal select:focus {
- border-color: var(--primary);
- background: var(--bg-white);
- box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
+/* An archived preview swaps a 14px spinner (plus .25rem of margin) for an image that has no box until it
+ decodes. Holding that box at the difference to the image's own .5rem of margin keeps the swap from
+ shortening the thread: a shorter thread clamps a scroll position pinned to the bottom, and the clamp
+ reaches the scroll hook as the reader scrolling away. It also makes the box the hook seeds at mount
+ exactly what the thread gains once the image decodes. */
+.chats-page .chat-image-media-archived {
+ min-height: calc(14px - 0.25rem);
}
-.chats-page .status-compose-modal textarea {
- min-height: 100px;
- resize: vertical;
+/* A button, not a label: the bytes are fetchable from the per-message media route, so this is the
+ viewer's handle on media the list did not inline. Styled to keep the previous inert appearance
+ apart from the affordance. */
+.chats-page .message-media-omitted {
+ display: flex;
+ align-items: center;
+ gap: 0.3rem;
+ padding: 0;
+ border: none;
+ background: none;
+ color: var(--chat-meta);
+ font-style: italic;
+ font-size: 0.9em;
+ font-family: inherit;
+ margin-bottom: 0.25rem;
+ cursor: pointer;
+ text-decoration: underline dotted;
}
-.chats-page .status-compose-modal .compose-row {
- display: flex;
- gap: 1rem;
+.chats-page .message-media-omitted:disabled {
+ cursor: default;
+ text-decoration: none;
}
-.chats-page .status-compose-modal .compose-row .compose-field {
- flex: 1;
+/* The archived audio and video placeholders hold the height of the element that replaces them, so the
+ bubble does not grow when the bytes land and move a thread that was pinned to the bottom or being read.
+ The element's own bottom margin is 0.5rem and the placeholder's 0.25rem, so the quarter rem that is
+ missing from the margin is added to the box: a native audio player is 54px tall, and a video element
+ that has no metadata yet has the default 150px replaced-element height. */
+.chats-page .message-media-archived-loading-audio {
+ min-height: calc(54px + 0.25rem);
}
-.chats-page .status-compose-modal input[type='color'] {
- width: 100%;
- height: 38px;
- padding: 2px;
- border: 1px solid var(--border);
- border-radius: var(--radius, 8px);
- background: var(--bg-light);
- cursor: pointer;
- box-sizing: border-box;
+.chats-page .message-media-archived-loading-video {
+ min-height: calc(150px + 0.25rem);
}
-.chats-page .status-compose-modal input[type='file'] {
- width: 100%;
- font-size: 0.8125rem;
- color: var(--text-secondary);
+/* The map preview keeps its own modest cap, but bounded by the bubble the way every other media type
+ here is. As a bare pixel width it stayed wide in a narrower room and ran past the panel edge. */
+.chats-page .chat-location-media {
+ max-width: min(260px, 100%);
+ border-radius: 6px;
+ display: block;
+ margin-bottom: 0.25rem;
}
-.chats-page .status-compose-modal .compose-image-or {
- font-size: 0.75rem;
- color: var(--text-muted);
- text-align: center;
- margin: 0.5rem 0;
+.chats-page .chat-video-media {
+ max-width: 100%;
+ max-height: 340px;
+ border-radius: 6px;
+ display: block;
+ margin-bottom: 0.5rem;
}
-.chats-page .status-compose-modal .compose-recipients {
- border: 1px solid var(--border);
- border-radius: var(--radius, 8px);
- max-height: 180px;
- overflow-y: auto;
- background: var(--bg-light);
- margin-top: 0.5rem;
+.chats-page .chat-audio-media {
+ max-width: 100%;
+ display: block;
+ margin-bottom: 0.5rem;
}
-.chats-page .status-compose-modal .compose-recipient-row {
+.chats-page .chat-document-media {
display: flex;
align-items: center;
gap: 0.5rem;
- padding: 0.5rem 0.75rem;
+ padding-block: 0.625rem;
+ padding-inline: 0.75rem;
+ margin-bottom: 0.5rem;
+ background: color-mix(in srgb, var(--chat-bubble-text) 6%, transparent);
+ border-radius: 6px;
+ color: var(--chat-bubble-text);
+ text-decoration: none;
font-size: 0.875rem;
- color: var(--text-primary);
- cursor: pointer;
- border-bottom: 1px solid var(--border);
+ font-weight: 500;
+ word-break: break-all;
}
-.chats-page .status-compose-modal .compose-recipient-row:last-child {
- border-bottom: none;
+.chats-page .chat-document-media:hover {
+ background: color-mix(in srgb, var(--chat-bubble-text) 10%, transparent);
}
-.chats-page .status-compose-modal .compose-recipient-row:hover {
- background: var(--bg-white);
+/* =============================================================================
+ HOVER MENU, REPLIES, REACTIONS, AND DELETIONS
+ ============================================================================= */
+/* Laid over the bubble's top corner, not beside it: in flow it would squeeze a full-width bubble on hover. */
+.chats-page .message-actions-menu {
+ position: absolute;
+ top: 0.375rem;
+ inset-inline-end: 0.375rem;
+ display: none;
+ align-items: center;
+ gap: 0.125rem;
+ background: var(--chat-panel);
+ box-shadow: var(--shadow-md);
+ border-radius: 20px;
+ padding-block: 2px;
+ padding-inline: 4px;
+ z-index: 5;
}
-.chats-page .status-compose-modal .compose-recipients-empty {
- padding: 1rem;
- text-align: center;
- color: var(--text-muted);
- font-size: 0.8125rem;
+.chats-page .message-bubble-container:hover .message-actions-menu,
+.chats-page .room-messages:not([data-pointer]) .message-bubble-container:focus-within .message-actions-menu {
display: flex;
- align-items: center;
- justify-content: center;
}
-.chats-page .status-compose-modal .input-hint {
- display: block;
- font-size: 0.75rem;
- color: var(--text-muted);
- margin-top: 0.375rem;
+/* A bubble is a keyboard stop (ChatThread): the ring says which message the arrow keys act on. */
+.chats-page .message-bubble-container:focus-visible {
+ outline: 2px solid var(--chat-accent);
+ outline-offset: 2px;
+ border-radius: 8px;
}
-/* =============================================================================
- CHAT ACTIONS: new chat, quick filters, archive, row and room menus, dialogs
- ============================================================================= */
-.chats-page .icon-btn {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- width: 36px;
- height: 36px;
- padding: 0;
+.chats-page .action-btn {
background: transparent;
border: none;
- border-radius: var(--radius, 8px);
- color: var(--text-secondary);
+ color: var(--chat-icon);
cursor: pointer;
- flex-shrink: 0;
+ padding: 5px;
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
transition: background 0.15s ease;
}
-.chats-page .icon-btn:hover,
-.chats-page .icon-btn.active {
- background: var(--bg-light);
- color: var(--text-primary);
+.chats-page .action-btn:hover {
+ background: var(--chat-hover);
}
-.chats-page .icon-btn:focus-visible {
- outline: 2px solid var(--primary);
- outline-offset: 2px;
+.chats-page .action-btn.delete-btn:hover {
+ color: var(--error-text);
+ background: rgba(239, 68, 68, 0.12);
}
-.chats-page .icon-btn.small {
- width: 28px;
- height: 28px;
+/* Reaction Quick Popover */
+.chats-page .reaction-trigger-wrapper {
+ position: relative;
}
-.chats-page .icon-btn.danger:hover {
- background: rgba(239, 68, 68, 0.12);
- color: var(--error-text);
+.chats-page .reaction-quick-popover {
+ display: none;
+ position: absolute;
+ bottom: 100%;
+ left: 50%;
+ /* --popover-shift is set when it opens, by the amount it would run past the pane (ChatThread). */
+ transform: translateX(calc(-50% + var(--popover-shift, 0px))) translateY(-6px);
+ background: var(--chat-panel);
+ box-shadow: var(--shadow-lg);
+ border-radius: 24px;
+ padding-block: 0.375rem;
+ padding-inline: 0.625rem;
+ gap: 0.375rem;
+ z-index: 50;
+ white-space: nowrap;
}
-/* Search and the New chat button share a row. */
-.chats-page .chat-search-row {
- display: flex;
- align-items: center;
- gap: 0.5rem;
+/* The pill sits at the end of its bubble and an own bubble is at the end of the pane, so a popover centred
+ on the react icon runs past the pane and clips the last emoji, which cannot then be picked. Anchored to
+ the end of the icon it grows toward the middle of the pane, in either text direction. */
+.chats-page .message-bubble-wrapper.outgoing .reaction-quick-popover {
+ left: auto;
+ inset-inline-end: 0;
+ transform: translateX(var(--popover-shift, 0px)) translateY(-6px);
}
-.chats-page .chat-search-row .chat-search-input {
- flex: 1;
- min-width: 0;
+/* Opened below the icon when there is no room above it in the pane (ChatThread sets data-below). */
+.chats-page .reaction-quick-popover[data-below] {
+ bottom: auto;
+ top: 100%;
+ transform: translateX(calc(-50% + var(--popover-shift, 0px))) translateY(6px);
}
-.chats-page .chat-new-button {
- width: 40px;
- height: 40px;
- border: 1px solid var(--border);
- background: var(--bg-light);
+.chats-page .message-bubble-wrapper.outgoing .reaction-quick-popover[data-below] {
+ transform: translateX(var(--popover-shift, 0px)) translateY(6px);
}
-/* Quick filters */
-.chats-page .chat-filters {
- display: flex;
- flex-wrap: wrap;
- gap: 0.375rem;
+.chats-page .reaction-quick-popover[data-below]::after {
+ top: auto;
+ bottom: 100%;
}
-.chats-page .chat-filter-pill {
- padding-block: 0.25rem;
- padding-inline: 0.75rem;
- border: 1px solid var(--border);
- border-radius: 999px;
- background: var(--bg-white);
- color: var(--text-secondary);
- font-size: 0.8125rem;
- cursor: pointer;
- transition:
- background 0.15s ease,
- color 0.15s ease;
+/* Hover bridge so the pointer can travel from the trigger into the popover. */
+.chats-page .reaction-quick-popover::after {
+ content: '';
+ position: absolute;
+ top: 100%;
+ left: 0;
+ right: 0;
+ height: 12px;
+ background: transparent;
}
-.chats-page .chat-filter-pill:hover {
- background: var(--bg-light);
- color: var(--text-primary);
+.chats-page .reaction-trigger-wrapper:hover .reaction-quick-popover,
+.chats-page .room-messages:not([data-pointer]) .reaction-trigger-wrapper:focus-within .reaction-quick-popover {
+ display: flex;
}
-.chats-page .chat-filter-pill.active {
- background: var(--primary-soft);
- border-color: transparent;
- color: var(--primary-text);
- font-weight: 600;
+.chats-page .reaction-quick-popover button {
+ background: transparent;
+ border: none;
+ font-size: 1.25rem;
+ padding: 2px;
+ cursor: pointer;
+ transition: transform 0.1s ease;
}
-/* The archive's entry at the head of the list, and the way back from its view. */
-.chats-page .chat-archive-entry {
+.chats-page .reaction-quick-popover button:hover {
+ transform: scale(1.3);
+}
+
+/* Reactions Badge */
+.chats-page .message-reactions-badge {
+ position: absolute;
+ bottom: -16px;
+ background: var(--chat-panel);
+ border: 1px solid var(--chat-divider);
+ box-shadow: var(--chat-shadow-bubble);
+ border-radius: 12px;
+ padding-block: 1px;
+ padding-inline: 6px;
display: flex;
align-items: center;
- gap: 0.75rem;
- width: 100%;
- padding-block: 0.75rem;
- padding-inline: 1.25rem;
- border: none;
- border-bottom: 1px solid var(--border);
- background: transparent;
- color: var(--text-primary);
- font: inherit;
- font-weight: 500;
- text-align: start;
+ gap: 2px;
+ font-size: 0.75rem;
+ z-index: 2;
cursor: pointer;
+ user-select: none;
}
-.chats-page .chat-archive-entry:hover {
- background: var(--bg-light);
+.chats-page .message-bubble-wrapper.outgoing .message-reactions-badge {
+ inset-inline-end: 10px;
}
-.chats-page .chat-archive-entry svg {
- color: var(--primary-text);
+.chats-page .message-bubble-wrapper.incoming .message-reactions-badge {
+ inset-inline-start: 10px;
}
-.chats-page .chat-archive-count {
- margin-inline-start: auto;
+.chats-page .reaction-emoji-span {
font-size: 0.8125rem;
+}
+
+.chats-page .reactions-count-span {
font-weight: 600;
- color: var(--primary-text);
+ color: var(--chat-meta);
+ margin-inline-start: 2px;
}
-/* Pin and mute marks on a row */
-.chats-page .chat-item-flags {
- display: inline-flex;
+/* =============================================================================
+ COMPOSER: attachment, emoji and reply panels, and the input bar
+ ============================================================================= */
+.chats-page .composer-banner {
+ background: var(--chat-panel-header);
+ padding-block: 0.625rem;
+ padding-inline: 1rem;
+ display: flex;
align-items: center;
- gap: 0.25rem;
- margin-inline-start: auto;
- color: var(--text-muted);
+ gap: 0.875rem;
+ box-sizing: border-box;
+ border-top: 1px solid var(--chat-divider);
flex-shrink: 0;
}
-.chats-page .chat-item-flags + .chat-unread-badge {
- margin-inline-start: 0.375rem;
+.chats-page .preview-thumbnail,
+.chats-page .preview-file-icon {
+ width: 48px;
+ height: 48px;
+ border-radius: 6px;
+ flex-shrink: 0;
}
-/* A row's chevron: shown on hover, on keyboard focus and while its menu is open. Its room is kept clear on
- every row that has one, so the time does not move when it appears. */
-.chats-page .chat-item-wrap {
- position: relative;
+.chats-page .preview-thumbnail {
+ object-fit: cover;
}
-.chats-page .chat-item-wrap.has-menu .chat-item-top {
- padding-inline-end: 1.75rem;
+.chats-page .preview-file-icon {
+ background: var(--chat-panel);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 1.5rem;
}
-.chats-page .chat-row-menu {
- position: absolute;
- top: 0.75rem;
- inset-inline-end: 0.75rem;
+.chats-page .preview-file-info {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
}
-.chats-page .chat-row-menu-trigger {
+.chats-page .preview-filename {
+ font-size: 0.875rem;
+ font-weight: 600;
+ color: var(--text-primary);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.chats-page .preview-filesize {
+ font-size: 0.75rem;
+ color: var(--chat-meta);
+}
+
+.chats-page .btn-banner-close {
+ background: transparent;
+ border: none;
+ color: var(--chat-icon);
+ cursor: pointer;
+ padding: 0.375rem;
+ border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
- width: 26px;
- height: 26px;
- padding: 0;
- border: 1px solid var(--border);
- border-radius: 6px;
- background: var(--bg-white);
- color: var(--text-secondary);
- cursor: pointer;
- opacity: 0;
- transition: opacity 0.12s ease;
+ flex-shrink: 0;
}
-.chats-page .chat-item-wrap:hover .chat-row-menu-trigger,
-.chats-page .chat-row-menu.open .chat-row-menu-trigger,
-.chats-page .chat-row-menu-trigger:focus-visible {
- opacity: 1;
+.chats-page .btn-banner-close:hover {
+ background: color-mix(in srgb, var(--chat-icon) 14%, transparent);
}
-.chats-page .chat-row-menu-trigger:focus-visible {
- outline: 2px solid var(--primary);
- outline-offset: 1px;
+.chats-page .chats-emoji-picker {
+ max-height: 140px;
+ overflow-y: auto;
}
-/* The row's and the room's menus share their entries (ChatActionList). */
-.chats-page .room-header-actions {
- margin-inline-start: auto;
+.chats-page .emoji-grid {
display: flex;
- align-items: center;
+ flex-wrap: wrap;
gap: 0.25rem;
- flex-shrink: 0;
-}
-
-.chats-page .room-menu {
- position: relative;
}
-.chats-page .chat-row-menu-popover,
-.chats-page .room-menu-popover {
- position: absolute;
- top: calc(100% + 0.375rem);
- inset-inline-end: 0;
- z-index: 30;
- min-width: 240px;
+.chats-page .emoji-btn {
+ background: transparent;
+ border: none;
+ font-size: 1.375rem;
padding: 0.375rem;
+ border-radius: 8px;
+ cursor: pointer;
display: flex;
- flex-direction: column;
- background: var(--bg-white);
- border: 1px solid var(--border);
- border-radius: 12px;
- box-shadow: var(--shadow-lg);
+ align-items: center;
+ justify-content: center;
}
-.chats-page .chat-row-menu-group,
-.chats-page .room-menu-group {
+.chats-page .emoji-btn:hover {
+ background: var(--chat-hover);
+}
+
+.chats-page .replying-preview-content {
+ flex: 1;
+ min-width: 0;
+ background: var(--chat-panel);
+ border-inline-start: 4px solid var(--chat-quote-accent);
+ border-radius: 6px;
+ padding-block: 0.375rem;
+ padding-inline: 0.75rem;
display: flex;
flex-direction: column;
}
-.chats-page .chat-row-menu-popover button,
-.chats-page .room-menu-popover button {
- display: flex;
- align-items: center;
- gap: 0.75rem;
- padding-block: 0.5rem;
- padding-inline: 0.75rem;
- border: none;
- border-radius: 8px;
- background: transparent;
- color: var(--text-primary);
- font: inherit;
- font-size: 0.875rem;
- text-align: start;
+.chats-page .replying-to-title {
+ font-size: 0.8125rem;
+ font-weight: 700;
+ color: var(--chat-pill-active-text);
+ /* Same treatment as `.replying-to-body` below. Without it a quoted name with no break opportunity
+ keeps its box but paints straight through the close button and out of the panel. */
white-space: nowrap;
- cursor: pointer;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
-.chats-page .chat-row-menu-popover button:hover:not(:disabled),
-.chats-page .chat-row-menu-popover button:focus-visible,
-.chats-page .room-menu-popover button:hover:not(:disabled),
-.chats-page .room-menu-popover button:focus-visible {
- background: var(--bg-light);
- outline: none;
+.chats-page .replying-to-body {
+ font-size: 0.875rem;
+ color: var(--chat-meta);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
-.chats-page .chat-row-menu-popover button svg,
-.chats-page .room-menu-popover button svg {
- color: var(--text-secondary);
+.chats-page .room-input-footer {
+ background: var(--chat-panel-header);
+ padding-block: 0.625rem;
+ padding-inline: 1rem;
+ box-sizing: border-box;
flex-shrink: 0;
}
-.chats-page .chat-row-menu-popover button:disabled,
-.chats-page .room-menu-popover button:disabled {
- cursor: not-allowed;
- opacity: 0.6;
+.chats-page .input-form {
+ display: flex;
+ gap: 0.5rem;
+ align-items: center;
}
-.chats-page .chat-row-menu-popover hr,
-.chats-page .room-menu-popover hr {
- width: 100%;
- margin-block: 0.25rem;
+.chats-page .btn-input-accessory {
+ background: transparent;
border: none;
- border-top: 1px solid var(--border);
+ color: var(--chat-icon);
+ cursor: pointer;
+ width: 42px;
+ height: 42px;
+ padding: 0;
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ transition: background 0.15s;
}
-/* A disabled entry carries the reason under its label. */
-.chats-page .chat-action-label {
- display: flex;
- flex-direction: column;
- white-space: normal;
+.chats-page .btn-input-accessory:hover:not(:disabled),
+.chats-page .btn-input-accessory.active {
+ background: color-mix(in srgb, var(--chat-icon) 14%, transparent);
}
-.chats-page .chat-action-label small {
- max-width: 16rem;
- font-size: 0.75rem;
- color: var(--text-muted);
+.chats-page .btn-input-accessory.active {
+ color: var(--chat-accent);
}
-/* New chat / new group panel (sidebar sub-view) */
-.chats-page .new-chat-panel {
- flex: 1;
- min-height: 0;
- display: flex;
- flex-direction: column;
+.chats-page .btn-input-accessory:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
}
-.chats-page .new-chat-header {
+.chats-page .btn-input-accessory.inside {
+ width: 36px;
+ height: 36px;
+}
+
+.chats-page .message-input-pill {
+ flex: 1;
+ min-width: 0;
display: flex;
align-items: center;
- gap: 0.5rem;
- padding: 1rem 1.25rem;
- border-bottom: 1px solid var(--border);
- font-size: 1rem;
- font-weight: 600;
- color: var(--text-primary);
+ gap: 0.25rem;
+ padding-block: 0;
+ padding-inline: 1rem 0.25rem;
+ height: 46px;
+ box-sizing: border-box;
+ background: var(--chat-panel);
+ border: 1px solid var(--chat-divider);
+ border-radius: 24px;
+ transition:
+ border-color 0.15s,
+ box-shadow 0.15s;
}
-.chats-page .new-chat-search {
- margin-block: 0.75rem 0;
- margin-inline: 1.25rem;
+.chats-page .message-input-pill:focus-within {
+ border-color: var(--chat-accent);
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--chat-accent) 15%, transparent);
}
-.chats-page .new-chat-hint {
- margin-block: 0.375rem 0;
- margin-inline: 1.25rem;
- font-size: 0.8125rem;
- color: var(--text-muted);
+.chats-page .message-text-input {
+ flex: 1;
+ /* An input keeps its intrinsic width as its automatic minimum, which pinned the whole composer wider than
+ a narrow pane and pushed the send button outside the layout's clip. The floor replaces that with one small
+ enough to let the composer fit and large enough to keep a caret and a few characters visible. */
+ min-width: 64px;
+ padding: 0;
+ border: none;
+ background: none;
+ font-size: 0.9375rem;
+ color: var(--text-primary);
+ outline: none;
}
-.chats-page .new-chat-section-label {
- padding-block: 0.875rem 0.375rem;
- padding-inline: 1.25rem;
- font-size: 0.75rem;
- font-weight: 600;
- letter-spacing: 0.04em;
- text-transform: uppercase;
- color: var(--primary-text);
+.chats-page .message-text-input::placeholder {
+ color: var(--chat-meta);
}
-/* The panel's rows are buttons: they take the list row's look, not the global button's. */
-.chats-page button.chat-item-card {
- width: 100%;
- background: transparent;
+.chats-page .btn-send-message {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 46px;
+ height: 46px;
+ padding: 0;
+ background: var(--chat-accent);
border: none;
- border-bottom: 1px solid var(--border);
- color: inherit;
- font: inherit;
- text-align: start;
+ border-radius: 50%;
+ color: #fff;
+ cursor: pointer;
+ flex-shrink: 0;
+ transition:
+ background 0.15s,
+ transform 0.1s,
+ opacity 0.15s;
}
-.chats-page button.chat-item-card:disabled {
- cursor: progress;
- opacity: 0.75;
+.chats-page .btn-send-message:hover:not(:disabled) {
+ background: var(--chat-accent-hover);
}
-.chats-page .action-row .chat-item-name {
- font-weight: 500;
+.chats-page .btn-send-message:active:not(:disabled) {
+ transform: scale(0.94);
}
-.chats-page .chat-avatar.action-avatar {
- background: var(--primary);
- border-color: var(--primary);
- color: #fff;
+.chats-page .btn-send-message:disabled {
+ /* Keep the brand silhouette readable while clearly inactive — a bare gray-on-gray glyph
+ reads as "no button here" rather than "send, disabled". */
+ opacity: 0.55;
+ cursor: not-allowed;
}
-.chats-page .select-check {
- width: 20px;
- height: 20px;
- box-sizing: border-box;
- margin-inline-start: auto;
- border: 2px solid var(--border);
- border-radius: 5px;
- display: flex;
- align-items: center;
- justify-content: center;
+/* =============================================================================
+ CONTACT INFO PANEL
+ ============================================================================= */
+.chats-page .contact-info-panel {
+ width: 340px;
flex-shrink: 0;
- color: #fff;
+ display: flex;
+ flex-direction: column;
+ background: var(--chat-panel);
+ border-inline-start: 1px solid var(--chat-divider);
}
-.chats-page .select-check.checked {
- background: var(--primary);
- border-color: var(--primary);
+.chats-page .contact-info-header {
+ height: 64px;
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ padding-block: 0;
+ padding-inline: 0.75rem;
+ background: var(--chat-panel-header);
+ border-bottom: 1px solid var(--chat-divider);
+ font-weight: 500;
+ color: var(--text-primary);
+ box-sizing: border-box;
+ flex-shrink: 0;
}
-.chats-page .new-group-fields {
+.chats-page .contact-info-body {
display: flex;
flex-direction: column;
- gap: 0.625rem;
- padding-block: 0.875rem 0;
- padding-inline: 1.25rem;
+ align-items: center;
+ padding-block: 1.75rem;
+ padding-inline: 1.5rem;
+ overflow-y: auto;
+ text-align: center;
}
-.chats-page .new-group-name {
- padding-block: 0.625rem;
- padding-inline: 0.75rem;
- border: 1px solid var(--border);
- border-radius: var(--radius, 8px);
- background: var(--bg-light);
+.chats-page .contact-info-body h3 {
+ margin-block: 1rem 0.25rem;
+ font-size: 1.25rem;
+ font-weight: 500;
color: var(--text-primary);
+ word-break: break-word;
+}
+
+.chats-page .contact-info-sub {
+ margin: 0;
+ color: var(--chat-meta);
font-size: 0.9375rem;
- outline: none;
}
-.chats-page .new-group-name:focus {
- border-color: var(--primary);
- background: var(--bg-white);
+.chats-page .contact-info-list {
+ width: 100%;
+ margin-block: 1.5rem 0;
+ padding-top: 1rem;
+ border-top: 1px solid var(--chat-divider);
+ text-align: start;
}
-.chats-page .participant-chips {
- display: flex;
- flex-wrap: wrap;
- gap: 0.375rem;
- max-height: 96px;
- overflow-y: auto;
+.chats-page .contact-info-list dt {
+ font-size: 0.8125rem;
+ color: var(--chat-meta);
+ margin-top: 0.875rem;
}
-.chats-page .participant-chip {
- display: inline-flex;
+.chats-page .contact-info-list dt:first-child {
+ margin-top: 0;
+}
+
+.chats-page .contact-info-list dd {
+ margin-block: 0.125rem 0;
+ margin-inline: 0;
+ font-size: 0.9375rem;
+ color: var(--text-primary);
+ display: flex;
align-items: center;
gap: 0.25rem;
- padding-block: 0.125rem;
- padding-inline: 0.625rem 0.25rem;
- border-radius: 999px;
- background: var(--primary-soft);
- color: var(--primary-text);
+ min-width: 0;
+}
+
+.chats-page .contact-info-list dd.mono span {
+ font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.8125rem;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ min-width: 0;
}
-.chats-page .participant-chip button {
+/* =============================================================================
+ CHANNELS AND STATUS: read-only post panes
+ ============================================================================= */
+.chats-page .channel-room {
+ flex: 1;
+ min-height: 0;
display: flex;
- padding: 2px;
- border: none;
- border-radius: 50%;
- background: transparent;
- color: inherit;
- cursor: pointer;
+ flex-direction: column;
+ height: 100%;
}
-.chats-page .new-group-footer {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 0.75rem;
- padding: 0.75rem 1.25rem;
- border-top: 1px solid var(--border);
+.chats-page .chats-room-header {
+ color: var(--chat-icon);
}
-.chats-page .new-group-count {
- font-size: 0.875rem;
- color: var(--text-muted);
+/* The pane icon's only in-flow sibling here is the heading, which has never opted out of shrinking,
+ so without this opt-out the row takes width from the icon as well. The heading absorbs most of the
+ deficit but not all of it, and on the narrowest pane the icon is squeezed to a couple of pixels. */
+.chats-page .chats-room-header > svg {
+ flex-shrink: 0;
}
-.chats-page .new-group-create {
- display: inline-flex;
- align-items: center;
- gap: 0.375rem;
- padding-block: 0.5rem;
- padding-inline: 1rem;
- border: none;
- border-radius: var(--radius, 8px);
- background: var(--primary);
- color: #fff;
+.chats-page .chats-room-header h2 {
+ font-size: 1rem;
font-weight: 600;
- cursor: pointer;
+ color: var(--text-primary);
+ text-transform: none;
+ letter-spacing: normal;
+ margin: 0;
+ /* `overflow: hidden` is the load-bearing declaration: it both clips and zeroes this flex item's automatic
+ minimum, so no min-width is needed here or on an ancestor. Without it the other two are inert and a long
+ title runs past the panel edge. */
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
-.chats-page .new-group-create:disabled {
- opacity: 0.55;
- cursor: not-allowed;
+.chats-page .messages-list {
+ flex: 1;
+ min-height: 0;
+ padding: 1.5rem;
+ overflow-y: auto;
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ align-items: flex-start;
+ background-color: var(--chat-wallpaper);
+ background-image: var(--chat-wallpaper-pattern);
+ background-size: 240px 240px;
}
-/* Group info dialog (the global .modal card, inside the page) */
-.chats-page .group-info-modal {
- max-width: 640px;
+.chats-page .messages-list .message-bubble {
+ max-width: 480px;
}
-.chats-page .group-info-title {
- display: flex;
- align-items: center;
- gap: 0.875rem;
+/* A feed post's time sits under its text: there is no tick to tuck in beside it. */
+.chats-page .messages-list .message-time {
+ display: block;
+ margin-top: 0.25rem;
+ text-align: end;
}
-.chats-page .group-info-tile {
- width: 44px;
- height: 44px;
- border-radius: 12px;
- background: var(--primary);
- color: #fff;
+.chats-page .channel-media {
+ max-width: 100%;
+ max-height: 320px;
+ border-radius: 6px;
+ display: block;
+ margin-bottom: 0.5rem;
+ object-fit: cover;
+}
+
+/* Shown in place of media that cannot be shown: a status media blob that fails to load, or a
+ channel post whose media has no URL. */
+.chats-page .status-media-placeholder {
+ display: block;
+ font-size: 0.85rem;
+ color: var(--chat-meta);
+ margin-bottom: 0.5rem;
+}
+
+/* =============================================================================
+ GENERAL CHATS STYLES & ERROR STATES
+ ============================================================================= */
+.chats-page .chats-loading-container,
+.chats-page .chats-error-state {
display: flex;
+ flex-direction: column;
align-items: center;
justify-content: center;
- flex-shrink: 0;
+ background: var(--bg-white);
+ padding-block: 4rem;
+ padding-inline: 2rem;
+ text-align: center;
+ color: var(--text-secondary);
+ flex: 1;
}
-.chats-page .group-info-heading {
- display: flex;
- flex-direction: column;
- min-width: 0;
+.chats-page .chats-error-state h3 {
+ font-size: 1.25rem;
+ margin-block: 1rem 0.5rem;
+ color: var(--text-primary);
}
-.chats-page .group-info-subtitle {
- font-size: 0.875rem;
- font-weight: 400;
+.chats-page .chats-error-state p {
+ font-size: 0.9375rem;
+ max-width: 450px;
+ margin: 0;
color: var(--text-muted);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
}
-.chats-page .group-info-toolbar {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: 0.75rem;
- padding-block: 1rem 0;
- padding-inline: 1.5rem;
+.chats-page .text-warn {
+ color: var(--warning-text);
}
-.chats-page .group-info-toolbar .chats-tab {
- display: inline-flex;
+/* Real-time connection-lost banner */
+.chats-page .chats-reconnect-banner {
+ display: flex;
align-items: center;
- gap: 0.375rem;
- padding-inline: 0.875rem;
+ gap: 0.5rem;
+ padding-block: 0.5rem;
+ padding-inline: 1rem;
+ background: rgba(234, 88, 12, 0.1);
+ color: var(--warning-text);
+ font-size: 0.875rem;
+ flex-shrink: 0;
}
-.chats-page .group-info-toolbar .icon-btn {
+.chats-page .chats-reconnect-banner button {
margin-inline-start: auto;
}
-.chats-page .group-info-badge {
- display: inline-flex;
- align-items: center;
- gap: 0.375rem;
- padding-block: 0.375rem;
- padding-inline: 0.75rem;
+/* =============================================================================
+ STATUS COMPOSE MODAL
+ ============================================================================= */
+.chats-page .status-compose-modal .compose-type-toggle {
+ display: flex;
border: 1px solid var(--border);
border-radius: var(--radius, 8px);
- background: var(--bg-light);
- color: var(--text-secondary);
- font-size: 0.8125rem;
+ overflow: hidden;
+ margin-bottom: 1rem;
}
-.chats-page .group-info-badge.admin {
- background: var(--primary-soft);
- border-color: transparent;
- color: var(--primary-text);
+.chats-page .status-compose-modal .compose-type-toggle button {
+ flex: 1;
+ padding-block: 0.625rem;
+ padding-inline: 1rem;
+ font-size: 0.875rem;
+ font-weight: 500;
+ background: var(--bg-white);
+ border: none;
+ cursor: pointer;
+ transition: all 0.2s;
+ color: var(--text-secondary);
}
-.chats-page .group-info-state {
- display: flex;
- justify-content: center;
- padding: 2rem;
- color: var(--text-muted);
+.chats-page .status-compose-modal .compose-type-toggle button:first-child {
+ border-inline-end: 1px solid var(--border);
}
-.chats-page .group-info-form {
- display: flex;
- flex-direction: column;
- gap: 1rem;
+.chats-page .status-compose-modal .compose-type-toggle button.active {
+ background: var(--primary);
+ color: white;
}
-.chats-page .group-info-field {
+.chats-page .status-compose-modal .compose-field {
display: flex;
flex-direction: column;
gap: 0.375rem;
- font-size: 0.875rem;
- font-weight: 600;
- color: var(--text-secondary);
+ margin-bottom: 1rem;
}
-.chats-page .group-info-field .required {
- color: var(--error);
+.chats-page .status-compose-modal .compose-field label {
+ font-size: 0.8125rem;
+ font-weight: 600;
+ color: var(--text-secondary);
}
-.chats-page .group-info-field input,
-.chats-page .group-info-field textarea,
-.chats-page .group-info-add input,
-.chats-page .chat-dialog-form input {
+.chats-page .status-compose-modal textarea,
+.chats-page .status-compose-modal input[type='text'],
+.chats-page .status-compose-modal input[type='url'],
+.chats-page .status-compose-modal select {
width: 100%;
- box-sizing: border-box;
padding-block: 0.625rem;
padding-inline: 0.75rem;
border: 1px solid var(--border);
border-radius: var(--radius, 8px);
background: var(--bg-light);
color: var(--text-primary);
- font: inherit;
- font-weight: 400;
+ font-size: 0.875rem;
outline: none;
+ box-sizing: border-box;
+ font-family: inherit;
}
-.chats-page .group-info-field textarea {
- min-height: 6rem;
- resize: vertical;
-}
-
-.chats-page .group-info-field input:focus,
-.chats-page .group-info-field textarea:focus,
-.chats-page .group-info-add input:focus,
-.chats-page .chat-dialog-form input:focus {
+.chats-page .status-compose-modal textarea:focus,
+.chats-page .status-compose-modal input:focus,
+.chats-page .status-compose-modal select:focus {
border-color: var(--primary);
background: var(--bg-white);
- box-shadow: 0 0 0 3px var(--primary-soft);
+ box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}
-.chats-page .group-info-field input:disabled,
-.chats-page .group-info-field textarea:disabled {
- opacity: 0.7;
- cursor: not-allowed;
+.chats-page .status-compose-modal textarea {
+ min-height: 100px;
+ resize: vertical;
}
-.chats-page .group-info-picture {
+.chats-page .status-compose-modal .compose-row {
display: flex;
- align-items: center;
gap: 1rem;
- padding: 0.875rem;
- border: 1px solid var(--border);
- border-radius: var(--radius, 8px);
- background: var(--bg-light);
- color: var(--text-primary);
- font: inherit;
- font-weight: 400;
- text-align: start;
- cursor: pointer;
-}
-
-.chats-page .group-info-picture:hover:not(:disabled) {
- border-color: var(--primary);
-}
-
-.chats-page .group-info-picture:disabled {
- cursor: default;
-}
-
-.chats-page .chat-avatar.avatar-lg {
- width: 88px;
- height: 88px;
}
-.chats-page .group-info-members {
- display: flex;
- flex-direction: column;
- gap: 0.75rem;
+.chats-page .status-compose-modal .compose-row .compose-field {
+ flex: 1;
}
-.chats-page .group-info-add {
- display: flex;
- gap: 0.5rem;
+.chats-page .status-compose-modal input[type='color'] {
+ width: 100%;
+ height: 38px;
+ padding: 2px;
+ border: 1px solid var(--border);
+ border-radius: var(--radius, 8px);
+ background: var(--bg-light);
+ cursor: pointer;
+ box-sizing: border-box;
}
-.chats-page .group-info-add button {
- display: inline-flex;
- align-items: center;
- gap: 0.375rem;
- flex-shrink: 0;
+.chats-page .status-compose-modal input[type='file'] {
+ width: 100%;
+ font-size: 0.8125rem;
+ color: var(--text-secondary);
}
-.chats-page .group-info-count {
- font-size: 0.8125rem;
- font-weight: 600;
+.chats-page .status-compose-modal .compose-image-or {
+ font-size: 0.75rem;
color: var(--text-muted);
+ text-align: center;
+ margin-block: 0.5rem;
}
-.chats-page .group-info-list {
- margin: 0;
- padding: 0;
- list-style: none;
+.chats-page .status-compose-modal .compose-recipients {
+ border: 1px solid var(--border);
+ border-radius: var(--radius, 8px);
+ max-height: 180px;
+ overflow-y: auto;
+ background: var(--bg-light);
+ margin-top: 0.5rem;
}
-.chats-page .group-info-list li {
+.chats-page .status-compose-modal .compose-recipient-row {
display: flex;
align-items: center;
- gap: 0.75rem;
+ gap: 0.5rem;
padding-block: 0.5rem;
+ padding-inline: 0.75rem;
+ font-size: 0.875rem;
+ color: var(--text-primary);
+ cursor: pointer;
border-bottom: 1px solid var(--border);
}
-.chats-page .group-info-member {
- flex: 1;
- min-width: 0;
- display: flex;
- flex-direction: column;
+.chats-page .status-compose-modal .compose-recipient-row:last-child {
+ border-bottom: none;
}
-.chats-page .group-info-member .name {
- font-weight: 500;
- color: var(--text-primary);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
+.chats-page .status-compose-modal .compose-recipient-row:hover {
+ background: var(--bg-white);
}
-.chats-page .group-info-member .number {
- font-size: 0.8125rem;
+.chats-page .status-compose-modal .compose-recipients-empty {
+ padding: 1rem;
+ text-align: center;
color: var(--text-muted);
+ font-size: 0.8125rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
}
-.chats-page .group-info-role {
- display: inline-flex;
- align-items: center;
- gap: 0.25rem;
- padding-block: 0.125rem;
- padding-inline: 0.5rem;
- border-radius: 999px;
- background: var(--primary-soft);
- color: var(--primary-text);
+.chats-page .status-compose-modal .input-hint {
+ display: block;
font-size: 0.75rem;
- font-weight: 600;
- flex-shrink: 0;
+ color: var(--text-muted);
+ margin-top: 0.375rem;
}
-.chats-page .group-info-actions {
- display: flex;
- gap: 0.125rem;
- flex-shrink: 0;
-}
+/* =============================================================================
+ RESPONSIVENESS
+ ============================================================================= */
-/* Confirmation, mute and save-contact dialogs: the confirm-modal shape the Sessions page uses. */
-.chats-page .confirm-modal {
- max-width: 420px;
-}
+/* Not enough room for three columns: the contact panel overlays the room instead. */
+@media (max-width: 1200px) {
+ .chats-page .chats-layout {
+ position: relative;
+ }
-.chats-page .confirm-modal .modal-body p {
- margin: 0 0 0.5rem;
+ .chats-page .contact-info-panel {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ inset-inline-end: 0;
+ z-index: 20;
+ box-shadow: var(--shadow-lg);
+ }
}
-.chats-page .confirm-modal .text-muted {
- color: var(--text-muted);
- font-size: 0.875rem;
-}
+@media (max-width: 768px) {
+ .chats-page {
+ height: calc(100dvh - 3.5rem);
+ }
-.chats-page .chat-dialog-options {
- display: flex;
- flex-direction: column;
- gap: 0.625rem;
- margin: 0.75rem 0 0;
- padding: 0;
- border: none;
-}
+ /* Single-pane on mobile: the list and the open conversation each take the full panel
+ instead of being squeezed into one short stacked column. */
+ .chats-page .chats-sidebar {
+ width: 100%;
+ max-width: none;
+ min-width: 0;
+ border-inline-end: none;
+ }
-.chats-page .chat-dialog-options label {
- display: flex;
- align-items: center;
- gap: 0.625rem;
- font-size: 0.9375rem;
- color: var(--text-primary);
- cursor: pointer;
-}
+ /* Opening a chat replaces the list with the thread; the back button returns to the list. */
+ .chats-page .chats-layout.has-active-chat .chats-sidebar {
+ display: none;
+ }
-.chats-page .chat-dialog-options input {
- accent-color: var(--primary);
-}
+ .chats-page .chats-layout:not(.has-active-chat) .chats-room {
+ display: none;
+ }
-.chats-page .chat-dialog-form {
- display: flex;
- flex-direction: column;
- gap: 0.875rem;
-}
+ .chats-page .room-back {
+ display: inline-flex;
+ }
-.chats-page .chat-dialog-form label {
- display: flex;
- flex-direction: column;
- gap: 0.375rem;
- font-size: 0.875rem;
- font-weight: 600;
- color: var(--text-secondary);
+ .chats-page .message-bubble-container {
+ max-width: 85%;
+ }
+
+ .chats-page .contact-info-panel {
+ width: 100%;
+ }
}
-.chats-page .chat-dialog-form .text-muted {
- margin: 0;
- font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
- font-size: 0.8125rem;
+/* Between the mobile breakpoint and 889px the two-pane layout leaves the room narrower than the composer
+ once the list takes its 300px minimum beside the 260px navigation, so the send button fell outside the
+ panel's clip with no scrollbar to recover it. In that band the panes swap one at a time instead, the way
+ they already do on a phone. Bounded on both sides on purpose: at 768px and below the mobile shell owns the
+ layout, and from 890px the room fits the composer again. Keyed to the navigation as well as the viewport,
+ because that arithmetic only holds while the nav is expanded; collapsed it already fits and none of this
+ should apply. `.main-content.expanded` is Layout's class for the COLLAPSED nav. */
+@media (min-width: 769px) and (max-width: 889px) {
+ .main-content:not(.expanded) .chats-page .chats-sidebar {
+ width: 100%;
+ max-width: none;
+ min-width: 0;
+ border-inline-end: none;
+ }
+
+ .main-content:not(.expanded) .chats-page .chats-layout.has-active-chat .chats-sidebar {
+ display: none;
+ }
+
+ .main-content:not(.expanded) .chats-page .chats-layout:not(.has-active-chat) .chats-room {
+ display: none;
+ }
+
+ .main-content:not(.expanded) .chats-page .room-back {
+ display: inline-flex;
+ }
+
+ .main-content:not(.expanded) .chats-page .contact-info-panel {
+ width: 100%;
+ }
}
diff --git a/dashboard/src/pages/Chats.features.test.ts b/dashboard/src/pages/Chats.features.test.ts
index 3c8db51b4..62ffc1a02 100644
--- a/dashboard/src/pages/Chats.features.test.ts
+++ b/dashboard/src/pages/Chats.features.test.ts
@@ -1,5 +1,6 @@
-// Render tests for what the chat page offers beyond its data flow, which Chats.test.ts covers: the quick
-// filters, the new-chat panel, and the chat row actions with their dialogs, each with its wire effect. The page is wrapped in the providers
+// Render tests for what the chat page offers beyond its data flow, which Chats.test.ts covers: the session
+// switcher, the contact panel, the message search behind its toggle, the quick filters, the new-chat panel, and
+// the chat row actions with their dialogs, each with its wire effect. The page is wrapped in the providers
// App.tsx uses and the backend is stubbed at the fetch layer; runs under the bare `node --test` runner.
import '../test-helpers/register-hooks.ts';
import { test, before, afterEach } from 'node:test';
@@ -18,6 +19,16 @@ const SESSION: Session = {
updatedAt: '2026-01-01T00:00:00.000Z',
};
+// A second account the gateway lists but that is not connected: the switcher shows it, and does not open it.
+const OFFLINE_SESSION: Session = {
+ ...SESSION,
+ id: 'session-2',
+ name: 'Marie Haas',
+ phone: '491741565212',
+ status: 'disconnected',
+};
+let listOffline = false;
+
// A second connected account, served when a test turns `listSecond` on. Its routes answer with the first
// session's fixtures, so both list the same chats: the shared chat id a late result must not cross over.
const SECOND_SESSION: Session = { ...SESSION, id: 'session-3', name: 'Second', phone: '15559876543' };
@@ -119,7 +130,9 @@ function installFetchStub(): void {
gates.get(name)?.then(response) ?? Promise.resolve(response());
if (method === 'GET' && path === '/api/sessions') {
- return Promise.resolve(jsonResponse([SESSION, ...(listSecond ? [SECOND_SESSION] : [])]));
+ return Promise.resolve(
+ jsonResponse([SESSION, ...(listSecond ? [SECOND_SESSION] : []), ...(listOffline ? [OFFLINE_SESSION] : [])]),
+ );
}
if (method === 'GET' && path.startsWith(`${base}/chats?`)) {
return Promise.resolve(
@@ -237,6 +250,7 @@ afterEach(async () => {
client.clear();
}
fetchCalls.length = 0;
+ listOffline = false;
listSecond = false;
listExtra = false;
listDuplicateContact = false;
@@ -264,11 +278,34 @@ function renderPage({ reactStrictMode = false } = {}): ReturnType<RTL['render']>
);
}
-test('a read-only key is offered no new chat', async () => {
- const { screen } = rtl;
+test('the contact panel opens from the room header and Escape closes it before the room', async () => {
+ const { screen, fireEvent, waitFor, within } = rtl;
+ const { container } = renderPage();
+ fireEvent.click(await screen.findByText('Alice'));
+ await waitFor(() => assert.ok(container.querySelector('.room-header'), 'the room did not open'));
+
+ fireEvent.click(within(container.querySelector('.room-header') as HTMLElement).getByText('Alice'));
+ const panel = await waitFor(() => container.querySelector('.contact-info-panel') as HTMLElement);
+ assert.ok(within(panel).getByText(CHAT.id), 'the panel shows the raw chat id');
+
+ fireEvent.keyDown(document, { key: 'Escape' });
+ await waitFor(() => assert.equal(container.querySelector('.contact-info-panel'), null, 'the panel stayed open'));
+ assert.ok(container.querySelector('.room-header'), 'Escape closed the room along with the panel');
+});
+
+test('the message search sits behind its toggle, and a read-only key is offered neither it nor a new chat', async () => {
+ const { screen, fireEvent } = rtl;
+ renderPage();
+ await screen.findByText('Alice');
+ assert.ok(!screen.queryByLabelText('Search messages…'), 'the search was open before its toggle was pressed');
+ fireEvent.click(screen.getByRole('button', { name: 'Search messages' }));
+ assert.ok(screen.getByLabelText('Search messages…'), 'the toggle did not open the search');
+ rtl.cleanup();
+
window.sessionStorage.setItem('openwa_user_role', 'viewer');
renderPage();
await screen.findByText('Alice');
+ assert.ok(!screen.queryByRole('button', { name: 'Search messages' }), 'a viewer key was offered message search');
assert.ok(!screen.queryByRole('button', { name: 'New chat' }), 'a viewer key was offered a new chat');
});
@@ -346,6 +383,48 @@ for (const reactStrictMode of [false, true]) {
});
}
+test('the session switcher lists every session with its state, and only a connected one can be picked', async () => {
+ const { screen, fireEvent } = rtl;
+ listOffline = true;
+ renderPage();
+ await screen.findByText('Alice');
+
+ const trigger = screen.getByRole('button', { name: /Main/ });
+ fireEvent.click(trigger);
+ const options = screen.getAllByRole('option');
+ assert.deepEqual(
+ options.map(option => [
+ option.textContent?.includes('Main'),
+ option.getAttribute('aria-selected'),
+ option.matches(':disabled'),
+ ]),
+ [
+ [true, 'true', false],
+ [false, 'false', true],
+ ],
+ );
+ assert.ok(
+ screen.getByRole('img', { name: 'Disconnected' }),
+ 'the offline session does not say why it cannot be opened',
+ );
+
+ fireEvent.change(screen.getByLabelText('Search sessions...'), { target: { value: 'marie' } });
+ assert.equal(screen.getAllByRole('option').length, 1, 'the search did not narrow the list');
+});
+
+test('Escape closes the session switcher, not the open chat', async () => {
+ const { screen, fireEvent, waitFor } = rtl;
+ const { container } = renderPage();
+ fireEvent.click(await screen.findByText('Alice'));
+ await waitFor(() => assert.ok(container.querySelector('.room-header'), 'the room did not open'));
+
+ fireEvent.click(screen.getByRole('button', { name: /Main/ }));
+ assert.ok(screen.getByRole('listbox'));
+ fireEvent.keyDown(document, { key: 'Escape' });
+ assert.ok(!screen.queryByRole('listbox'), 'Escape left the switcher open');
+ assert.ok(container.querySelector('.room-header'), 'Escape closed the chat behind the switcher');
+});
+
test('a group row offers its actions, and marking it unread badges the row', async () => {
const { screen, fireEvent, waitFor } = rtl;
listGroup = true;
@@ -458,8 +537,12 @@ test('a member who is no admin sees the group read-only, and a viewer key gets n
window.sessionStorage.setItem('openwa_user_role', 'viewer');
renderPage();
await screen.findByText('Team');
- // Every 1:1 action writes, so a viewer's 1:1 row carries no menu at all.
- assert.ok(!screen.queryByRole('button', { name: 'Actions for Alice' }), 'a viewer was offered 1:1 actions');
+ // A viewer may look at a 1:1 contact, and nothing else.
+ fireEvent.click(screen.getByRole('button', { name: 'Actions for Alice' }));
+ assert.ok(screen.getByRole('button', { name: 'Contact info' }));
+ assert.ok(!screen.queryByRole('button', { name: 'Block contact' }), 'a viewer was offered blocking');
+ assert.ok(!screen.queryByRole('button', { name: 'Pin chat' }), 'a viewer was offered pinning');
+ fireEvent.keyDown(document, { key: 'Escape' });
fireEvent.click(screen.getByRole('button', { name: 'Actions for Team' }));
assert.ok(!screen.queryByRole('button', { name: 'Mark as unread' }), 'a viewer was offered mark-as-unread');
assert.ok(!screen.queryByRole('button', { name: 'Leave group' }), 'a viewer was offered leaving the group');
@@ -616,11 +699,12 @@ test('saving a contact sends its name to the address book and renames the row',
// ── Review regressions: late results stay with their session, declined writes change nothing, and the
// address book decides what is saved and what can be. ──
-/** Switch to another session through the page's session selector. */
-function switchSession(container: HTMLElement, id: string): void {
- rtl.fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: id },
- });
+/** Switch to another session through the session switcher. */
+function switchSession(container: HTMLElement, name: string): void {
+ const { fireEvent, within } = rtl;
+ fireEvent.click(container.querySelector('.session-switcher-btn') as HTMLElement);
+ const list = container.querySelector('[role="listbox"]') as HTMLElement;
+ fireEvent.click(within(list).getByRole('option', { name: new RegExp(name) }));
}
const settle = async () => {
@@ -648,9 +732,9 @@ test('a number lookup that answers after the panel closed and the session change
);
fireEvent.click(screen.getByRole('button', { name: 'Back' }));
- switchSession(container, SECOND_SESSION.id);
+ switchSession(container, SECOND_SESSION.name);
await waitFor(() =>
- assert.equal((container.querySelector('select.session-selector') as HTMLSelectElement).value, SECOND_SESSION.id),
+ assert.equal(container.querySelector('.session-switcher-btn .session-name')?.textContent, SECOND_SESSION.name),
);
release();
await settle();
@@ -676,9 +760,9 @@ test('a group created after the session changed is not opened on the new session
fireEvent.click(screen.getByRole('button', { name: 'Back' }));
fireEvent.click(screen.getByRole('button', { name: 'Back' }));
await waitFor(() => assert.equal(container.querySelector('.new-chat-panel'), null, 'the panel stayed open'));
- switchSession(container, SECOND_SESSION.id);
+ switchSession(container, SECOND_SESSION.name);
await waitFor(() =>
- assert.equal((container.querySelector('select.session-selector') as HTMLSelectElement).value, SECOND_SESSION.id),
+ assert.equal(container.querySelector('.session-switcher-btn .session-name')?.textContent, SECOND_SESSION.name),
);
release();
await settle();
@@ -697,9 +781,9 @@ test("a pin that answers after a switch does not pin the other session's chat wi
await waitFor(() => assert.ok(fetchCalls.some(c => c.path === `/api/sessions/${SESSION.id}/chats/pin`)));
// Both sessions list Alice under the same chat id.
- switchSession(container, SECOND_SESSION.id);
+ switchSession(container, SECOND_SESSION.name);
await waitFor(() =>
- assert.equal((container.querySelector('select.session-selector') as HTMLSelectElement).value, SECOND_SESSION.id),
+ assert.equal(container.querySelector('.session-switcher-btn .session-name')?.textContent, SECOND_SESSION.name),
);
await screen.findByText('Alice');
release();
diff --git a/dashboard/src/pages/Chats.test.ts b/dashboard/src/pages/Chats.test.ts
index 0697f1241..fea3a5a9b 100644
--- a/dashboard/src/pages/Chats.test.ts
+++ b/dashboard/src/pages/Chats.test.ts
@@ -459,6 +459,33 @@ function renderChats(): ReturnType<RTL['render']> {
);
}
+/**
+ * The session switcher: its trigger names the selected session, and its list picks another. Sessions are
+ * told apart by name, which every fixture session has its own of.
+ */
+const FIXTURE_SESSIONS = [SESSION, SESSION_2, SESSION_3];
+
+function selectSession(container: HTMLElement, id: string): void {
+ const { fireEvent, within } = rtl;
+ const name = FIXTURE_SESSIONS.find(s => s.id === id)!.name;
+ fireEvent.click(container.querySelector('.session-switcher-btn') as HTMLElement);
+ const list = container.querySelector('[role="listbox"]') as HTMLElement;
+ fireEvent.click(within(list).getByRole('option', { name: new RegExp(name) }));
+}
+
+function selectedSessionId(container: HTMLElement): string | undefined {
+ const name = container.querySelector('.session-switcher-btn .session-name')?.textContent;
+ return FIXTURE_SESSIONS.find(s => s.name === name)?.id;
+}
+
+/** The message search sits behind a toggle in the sidebar header; open it unless it already is. */
+function openMessageSearch(): void {
+ const { screen, fireEvent } = rtl;
+ if (!screen.queryByLabelText('Search messages…')) {
+ fireEvent.click(screen.getByRole('button', { name: 'Search messages' }));
+ }
+}
+
// ── Smoke tests ──────────────────────────────────────────────────────────────
test('Chats renders: session/chat list loads, a chat opens, and a message sends', async () => {
@@ -468,7 +495,7 @@ test('Chats renders: session/chat list loads, a chat opens, and a message sends'
// Sidebar: the session selector shows the stubbed ready session, and the chat list row
// appears once /sessions and /sessions/:id/chats have resolved.
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
const chatRow = await screen.findByText('Alice');
// Open the chat: the message thread renders the stubbed DB message (both the DB and the
@@ -505,7 +532,7 @@ test('status compose modal posts a text status with the baileys recipient allow-
// The compose trigger lives in the sidebar's Status tab. The engine stub answers 'baileys',
// so the modal enables its contacts query and requires an explicit recipient allow-list.
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(screen.getByRole('tab', { name: 'Status' }));
fireEvent.click(screen.getByRole('button', { name: 'Post a status' }));
@@ -545,7 +572,7 @@ test('Refresh on a feed that never connected refetches the open thread once the
holdConnect();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
const threadReads = (): number =>
@@ -575,7 +602,7 @@ test('a typed draft survives closing and reopening the room', async () => {
const { container } = renderChats();
// Open the chat and type (but do NOT send) a draft.
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
fireEvent.change(screen.getByPlaceholderText('Type a message...'), { target: { value: 'draft survives' } });
@@ -597,7 +624,7 @@ test('Escape dismisses the emoji picker instead of the conversation behind it',
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
@@ -625,7 +652,7 @@ test('the emoji picker yields Escape to a surface layered above it', async () =>
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
@@ -660,7 +687,7 @@ test('Escape closes the open room, and is left alone while a dialog owns it', as
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
@@ -684,10 +711,11 @@ test('Escape dismisses the message search results instead of the conversation be
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
+ openMessageSearch();
const search = container.querySelector('.global-search-input') as HTMLInputElement;
search.focus();
fireEvent.change(search, { target: { value: 'invoice' } });
@@ -707,7 +735,7 @@ test('a read-only key is offered no status compose trigger', async () => {
window.sessionStorage.setItem('openwa_user_role', 'viewer');
try {
renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(screen.getByRole('tab', { name: 'Status' }));
// Reading statuses stays open to a viewer; only posting one is withheld.
await screen.findByText('No contacts have an active status.');
@@ -737,7 +765,7 @@ test('an operator key on whatsapp-web.js posts a status without the admin-only e
try {
resetFetchCalls();
renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(screen.getByRole('tab', { name: 'Status' }));
fireEvent.click(screen.getByRole('button', { name: 'Post a status' }));
@@ -767,7 +795,7 @@ test('an operator key on whatsapp-web.js lists its channels', async () => {
window.sessionStorage.setItem('openwa_engine_type', 'whatsapp-web.js');
try {
renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(screen.getByRole('tab', { name: 'Channels' }));
await screen.findByText(CHANNEL.name);
assert.equal(screen.queryByText('Channels are not supported on the Baileys engine.') === null, true);
@@ -780,7 +808,7 @@ test('an operator key on whatsapp-web.js lists its channels', async () => {
test('a writer key opening a chat clears its unread badge', async () => {
const { screen, fireEvent, within, waitFor } = rtl;
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
assert.ok(await screen.findByLabelText('2 unread messages'), 'the fixture chat shows no unread badge');
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
@@ -790,7 +818,7 @@ test('a writer key opening a chat clears its unread badge', async () => {
test('a chat whose newest message has no text does not claim to have no messages', async () => {
const { screen, waitFor } = rtl;
renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
const row = (await screen.findByText('Alice')).closest('.chat-item-card') as HTMLElement;
// A voice note or an uncaptioned photo arrives with an empty body on both engines.
@@ -943,7 +971,7 @@ test('a message that lands while a reconnect refetch is out survives the older s
test('a row a send stamped with the browser clock does not outrank a later reconnect snapshot', async () => {
const { screen, fireEvent, within, act, waitFor } = rtl;
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
@@ -968,7 +996,7 @@ test('a row a send stamped with the browser clock does not outrank a later recon
test('a socket reconnect keeps the open chat read instead of badging it with the gap count', async () => {
const { screen, fireEvent, within, act, waitFor } = rtl;
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
await waitFor(() => assert.ok(!screen.queryByLabelText('2 unread messages'), 'opening the chat kept its badge'));
@@ -993,7 +1021,7 @@ test('a socket reconnect keeps the open chat read instead of badging it with the
test('a reconnect whose refetch fails while the engine starts sends no mark-as-read', async () => {
const { screen, fireEvent, within, act } = rtl;
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
await new Promise(resolve => setTimeout(resolve, 1_000));
@@ -1018,7 +1046,7 @@ test('a reconnect whose refetch fails while the engine starts sends no mark-as-r
test('a reconnect refetch that settles after the open chat was left keeps its unread count', async () => {
const { screen, fireEvent, within, act, waitFor } = rtl;
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
await new Promise(resolve => setTimeout(resolve, 1_000));
@@ -1056,7 +1084,7 @@ test('a reconnect refetch that settles after the open chat was left keeps its un
test('a reconnect refetch that settles after the page was left sends no mark-as-read', async () => {
const { screen, fireEvent, within, act, waitFor } = rtl;
const { container, unmount } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
await new Promise(resolve => setTimeout(resolve, 1_000));
@@ -1088,7 +1116,7 @@ async function leaveWithPendingRead(loggedOut: boolean): Promise<number> {
const { screen, fireEvent, within } = rtl;
resetFetchCalls();
const { container, unmount } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
// Opening the chat queued its read behind the quiet window; the page goes away inside it.
@@ -1118,7 +1146,7 @@ test('logging out sends no pending mark-as-read without a key', async () => {
test('a reconnect that arrives while another reload is out is answered by the trailing one, which marks the open chat read', async () => {
const { screen, fireEvent, within, act, waitFor } = rtl;
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
await new Promise(resolve => setTimeout(resolve, 1_000));
@@ -1175,7 +1203,7 @@ test("a reconnect refetch that settles after a session switch leaves the new ses
twoSessions = true;
try {
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
@@ -1197,9 +1225,7 @@ test("a reconnect refetch that settles after a session switch leaves the new ses
assert.equal(countFetchCalls('GET', `/api/sessions/${SESSION.id}/chats?limit=1000&offset=0`) >= 2, true),
);
- fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: SESSION_2.id },
- });
+ selectSession(container, SESSION_2.id);
await screen.findByText('alice on two');
assert.ok(screen.queryByLabelText('3 unread messages'), "session 2's unread count is not shown");
@@ -1233,13 +1259,11 @@ test('switching session with a chat open marks only the chats opened on the new
}) as typeof fetch;
try {
const { container, unmount } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
- fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: SESSION_2.id },
- });
+ selectSession(container, SESSION_2.id);
await screen.findByText('alice on two');
fireEvent.click(await screen.findByText('Carol'));
await waitFor(() => assert.ok(container.querySelector('.room-messages')));
@@ -1263,7 +1287,7 @@ test('a read-only key opening a chat sends no mark-as-read', async () => {
window.sessionStorage.setItem('openwa_user_role', 'viewer');
try {
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
// Past the mark-as-read quiet window, so a queued call would have gone out.
@@ -1326,7 +1350,7 @@ test('a staged attachment survives closing and reopening the same room', async (
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
await stageAttachment(container, 'contract.pdf');
@@ -1346,7 +1370,7 @@ test('text typed with an audio attachment stays in the input instead of showing
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
const thread = container.querySelector('.room-messages') as HTMLElement;
await within(thread).findByText('hello from alice');
@@ -1377,7 +1401,7 @@ test('sends answered with no message id each keep their own bubble', async () =>
sendTextId = '';
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
const thread = container.querySelector('.room-messages') as HTMLElement;
await within(thread).findByText('hello from alice');
@@ -1401,7 +1425,7 @@ test('a caption sent with a document shows in its bubble', async () => {
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
const thread = container.querySelector('.room-messages') as HTMLElement;
await within(thread).findByText('hello from alice');
@@ -1426,7 +1450,7 @@ test('a file the browser cannot type goes out as a document with a generic MIME
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
// File.type is '' for an extension the browser has no mapping for, and the gateway refuses base64
@@ -1445,7 +1469,7 @@ test('the reply banner and the sent snippet name a media type in words, not as a
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
const row = (await screen.findByText('Alice')).closest('.chat-item-card') as HTMLElement;
fireEvent.click(row);
const thread = container.querySelector('.room-messages') as HTMLElement;
@@ -1481,7 +1505,7 @@ test('a staged attachment is dropped when a different chat is opened', async ()
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
await stageAttachment(container, 'for-alice.pdf');
@@ -1502,7 +1526,7 @@ test('a staged reply is kept on reopening its chat and dropped when a different
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
let row: HTMLElement | null = await within(container.querySelector('.room-messages') as HTMLElement).findByText(
'hello from alice',
@@ -1542,22 +1566,18 @@ async function reopenAfterSessionSwitch(): Promise<void> {
}) as typeof fetch;
try {
const { container } = renderChats();
- const selectSession = (id: string) =>
- fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: id },
- });
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
assert.equal(threadFetches, 1);
// Session 1's events are not delivered while session 2 is selected, so its cached threads may
// have missed messages by the time it is selected again.
- selectSession(SESSION_2.id);
+ selectSession(container, SESSION_2.id);
await screen.findByText('Carol');
await waitFor(() => assert.equal(screen.queryByText('Alice') === null, true));
- selectSession(SESSION.id);
+ selectSession(container, SESSION.id);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
await waitFor(() => assert.equal(threadFetches, 2, 'the cached thread was shown without a refetch'));
@@ -1604,7 +1624,7 @@ test('a staged reply is dropped when another session is opened', async () => {
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
let row: HTMLElement | null = await within(container.querySelector('.room-messages') as HTMLElement).findByText(
'hello from alice',
@@ -1615,9 +1635,7 @@ test('a staged reply is dropped when another session is opened', async () => {
// The session switch closes the room. The chat opened next has the same id in the other session
// (a contact both accounts share), so only the session switch, not a change of chat id, can drop it.
- fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: SESSION_2.id },
- });
+ selectSession(container, SESSION_2.id);
await waitFor(() => assert.equal(container.querySelector('.room-header') === null, true));
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-header') as HTMLElement).findByText('Alice');
@@ -1643,16 +1661,14 @@ test("a send that resolves after a session switch does not promote the other ses
try {
resetFetchCalls();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
fireEvent.change(screen.getByPlaceholderText('Type a message...'), { target: { value: 'from session one' } });
fireEvent.click(screen.getByRole('button', { name: 'Send' }));
await waitFor(() => assert.ok(findFetchCall('POST', `/api/sessions/${SESSION.id}/messages/send-text`)));
- fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: SESSION_2.id },
- });
+ selectSession(container, SESSION_2.id);
await screen.findByText('alice on two');
releaseSend();
await flush();
@@ -1668,7 +1684,7 @@ test("a send that resolves after a session switch does not promote the other ses
});
test('a chat list that answers after the user switched sessions does not replace the new one', async () => {
- const { screen, fireEvent, waitFor } = rtl;
+ const { screen, waitFor } = rtl;
twoSessions = true;
let releaseFirst!: () => void;
const firstGate = new Promise<void>(resolve => {
@@ -1678,13 +1694,11 @@ test('a chat list that answers after the user switched sessions does not replace
sessionId === SESSION.id ? firstGate.then(() => jsonResponse([CHAT])) : Promise.resolve(jsonResponse([CHAT_2]));
try {
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
await waitFor(() => assert.ok(container.querySelector('.chats-list-loading'), 'the first list never started'));
// Session 2's list lands first; session 1's slower answer arrives after it.
- fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: SESSION_2.id },
- });
+ selectSession(container, SESSION_2.id);
await screen.findByText('Carol');
releaseFirst();
await flush();
@@ -1698,7 +1712,7 @@ test('a chat list that answers after the user switched sessions does not replace
});
test("a chat list that answers after a switch leaves the new session's spinner up", async () => {
- const { screen, fireEvent, waitFor } = rtl;
+ const { screen, waitFor } = rtl;
twoSessions = true;
let releaseFirst!: () => void;
const firstGate = new Promise<void>(resolve => {
@@ -1714,11 +1728,9 @@ test("a chat list that answers after a switch leaves the new session's spinner u
: secondGate.then(() => jsonResponse([CHAT_2]));
try {
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
await waitFor(() => assert.ok(container.querySelector('.chats-list-loading'), 'the first list never started'));
- fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: SESSION_2.id },
- });
+ selectSession(container, SESSION_2.id);
// Session 1's list settles while session 2's is still out.
releaseFirst();
@@ -1740,7 +1752,7 @@ test("a chat list that answers after a switch leaves the new session's spinner u
});
test("a failed background refetch during a session switch keeps the spinner over the previous session's list", async () => {
- const { screen, fireEvent, waitFor } = rtl;
+ const { screen, waitFor } = rtl;
twoSessions = true;
let releaseSecond!: () => void;
const secondGate = new Promise<void>(resolve => {
@@ -1757,9 +1769,7 @@ test("a failed background refetch during a session switch keeps the spinner over
try {
const { container } = renderChats();
await screen.findByText('Alice');
- fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: SESSION_2.id },
- });
+ selectSession(container, SESSION_2.id);
await waitFor(() => assert.ok(container.querySelector('.chats-list-loading'), 'the switch showed no spinner'));
const DAVE = '[email protected]';
@@ -2145,6 +2155,7 @@ const THIRD_SESSION_HIT: SearchHit = {
async function clickSearchHit(container: HTMLElement): Promise<void> {
const { screen, fireEvent, waitFor } = rtl;
+ openMessageSearch();
fireEvent.change(screen.getByLabelText('Search messages…'), { target: { value: 'third' } });
const hit = await waitFor(() => {
const found = container.querySelector('.global-search-hit');
@@ -2166,8 +2177,7 @@ test('a search hit in a session that is not connected stays on the selected sess
await screen.findByText('The session of this message is not connected');
await waitFor(() => assert.equal(countFetchCalls('GET', '/api/sessions'), 2, 'the session list was not reread'));
await flush();
- const select = container.querySelector('select.session-selector') as HTMLSelectElement;
- assert.equal(select.value, SESSION.id);
+ assert.equal(selectedSessionId(container), SESSION.id);
assert.ok(screen.queryByText('Alice'), 'the chat list of the selected session is gone');
assert.ok(!screen.queryByText('Failed to load chats'), 'the page tried to load the unconnected session');
});
@@ -2181,8 +2191,7 @@ test('a search hit in a session that connected after the page loaded opens it',
thirdSessionStatus = 'ready';
await clickSearchHit(container);
- const select = container.querySelector('select.session-selector') as HTMLSelectElement;
- await waitFor(() => assert.equal(select.value, SESSION_3.id));
+ await waitFor(() => assert.equal(selectedSessionId(container), SESSION_3.id));
await waitFor(() => assert.ok(container.querySelector('.room-header'), "the hit's chat did not open"));
await within(container.querySelector('.room-header') as HTMLElement).findByText('Alice');
});
@@ -2207,8 +2216,7 @@ test("a search hit in another session opens that session's chat, not the one the
await waitFor(() => assert.ok(container.querySelector('.room-header'), 'Carol did not open'));
await clickSearchHit(container);
- const select = container.querySelector('select.session-selector') as HTMLSelectElement;
- await waitFor(() => assert.equal(select.value, SESSION_2.id));
+ await waitFor(() => assert.equal(selectedSessionId(container), SESSION_2.id));
await flush();
releaseSecond();
@@ -2233,8 +2241,7 @@ test("a search hit whose chat the other session's list lacks does not open it la
const { container } = renderChats();
await screen.findByText('Alice');
await clickSearchHit(container);
- const select = container.querySelector('select.session-selector') as HTMLSelectElement;
- await waitFor(() => assert.equal(select.value, SESSION_2.id));
+ await waitFor(() => assert.equal(selectedSessionId(container), SESSION_2.id));
await flush();
fireEvent.click(await screen.findByText('Carol'));
@@ -2310,16 +2317,15 @@ test('a search hit in another session on the chat open in this one opens it ther
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
};
await screen.findByText('Carol');
- const select = container.querySelector('select.session-selector') as HTMLSelectElement;
- fireEvent.change(select, { target: { value: SESSION_2.id } });
+ selectSession(container, SESSION_2.id);
await waitFor(() => assert.equal(screen.queryByText('Carol') === null, true));
await openAlice();
- fireEvent.change(select, { target: { value: SESSION.id } });
+ selectSession(container, SESSION.id);
await screen.findByText('Carol');
await openAlice();
await clickSearchHit(container);
- await waitFor(() => assert.equal(select.value, SESSION_2.id));
+ await waitFor(() => assert.equal(selectedSessionId(container), SESSION_2.id));
await flush();
await waitFor(() => assert.ok(container.querySelector('.room-header'), "the hit's chat did not open"));
await within(container.querySelector('.room-header') as HTMLElement).findByText('Alice');
@@ -2360,9 +2366,8 @@ test('changing the UI language keeps the selected session and the open chat', as
twoSessions = true;
try {
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
- const selector = container.querySelector('select.session-selector') as HTMLSelectElement;
- fireEvent.change(selector, { target: { value: SESSION_2.id } });
+ await screen.findByText(SESSION.name);
+ selectSession(container, SESSION_2.id);
fireEvent.click(await screen.findByText('Alice'));
await within(container.querySelector('.room-messages') as HTMLElement).findByText('hello from alice');
@@ -2373,7 +2378,7 @@ test('changing the UI language keeps the selected session and the open chat', as
await flush();
assert.equal(countFetchCalls('GET', '/api/sessions'), sessionLoads, 'the language change reloaded the sessions');
- assert.equal(selector.value, SESSION_2.id, 'the language change reselected the first session');
+ assert.equal(selectedSessionId(container), SESSION_2.id, 'the language change reselected the first session');
await waitFor(() => assert.ok(container.querySelector('.room-header'), 'the language change closed the chat'));
} finally {
await act(async () => {
@@ -2616,7 +2621,7 @@ function makeScrollable(thread: HTMLElement, scrollTop: number): void {
/** Open Carol's thread and return its scroll container, with the first page rendered. */
async function openPagedChat(container: HTMLElement): Promise<HTMLElement> {
const { screen, fireEvent, within } = rtl;
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Carol'));
const thread = container.querySelector('.room-messages') as HTMLElement;
await within(thread).findByText('paged message 119');
@@ -2923,7 +2928,7 @@ test('a message sent while the first page is still loading survives the page lan
});
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await screen.findByText(SESSION.name);
fireEvent.click(await screen.findByText('Alice'));
// The composer is live before the thread has loaded, so a send can land in a cache with no data.
fireEvent.change(await screen.findByPlaceholderText('Type a message...'), {
@@ -3004,9 +3009,7 @@ for (const action of ['switch session', 'unmount'] as const) {
const view = renderChats();
await rtl.waitFor(() => assert.deepEqual(offsets, [0, 1000]));
if (action === 'switch session') {
- rtl.fireEvent.change(view.container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: SESSION_2.id },
- });
+ selectSession(view.container, SESSION_2.id);
await rtl.screen.findByText('Carol');
} else view.unmount();
assert.equal(signal?.aborted, true);
diff --git a/dashboard/src/pages/Chats.tsx b/dashboard/src/pages/Chats.tsx
index 47b0ac900..207cbac6d 100644
--- a/dashboard/src/pages/Chats.tsx
+++ b/dashboard/src/pages/Chats.tsx
@@ -6,11 +6,11 @@ import { applyIncomingToChatList, promoteChatWithSnippet } from '../utils/chatLi
import {
applyChatListFilter,
contactKey,
+ phoneContactId,
+ savedContactKeySet,
filterChats,
filterChannels,
groupStatusesByContact,
- phoneContactId,
- savedContactKeySet,
type ChatListFilter,
} from '../utils/chatFilters';
import {
@@ -22,6 +22,7 @@ import {
MessageSquare,
CircleEllipsis,
Copy,
+ PanelRight,
X,
} from 'lucide-react';
import { useProfilePicture } from '../hooks/useProfilePicture';
@@ -57,7 +58,6 @@ import { useWebSocket } from '../hooks/useWebSocket';
import { useDocumentTitle } from '../hooks/useDocumentTitle';
import { useToast } from '../hooks/useToast';
import { useRole } from '../hooks/useRole';
-import { PageHeader } from '../components/PageHeader';
import { GlobalSearch } from '../components/GlobalSearch';
import {
useChatMessages,
@@ -73,18 +73,18 @@ import { createTrailingCoalescer } from '../utils/trailingCoalescer';
import { createReloadCoalescer, type ReloadCoalescer } from '../utils/reloadCoalescer';
import MessageBody from '../components/chats/MessageBody';
import MediaLightbox, { type LightboxItem } from '../components/chats/MediaLightbox';
-import KindIcon from '../components/chats/KindIcon';
+import ChatAvatar from '../components/chats/ChatAvatar';
import ChatSidebar from '../components/chats/ChatSidebar';
-import ChatThread from '../components/chats/ChatThread';
-import ChatComposer, { type StagedAttachment } from '../components/chats/ChatComposer';
-import StatusMedia from '../components/chats/StatusMedia';
-import StatusComposeModal from '../components/chats/StatusComposeModal';
import NewChatPanel from '../components/chats/NewChatPanel';
import GroupInfoDialog from '../components/chats/GroupInfoDialog';
import { MuteChatDialog, SaveContactDialog, type MuteDuration } from '../components/chats/ChatDialogs';
import type { ChatRowActions } from '../components/chats/chatActionItems';
import { ChatActions } from '../components/chats/ChatRowMenu';
import { Modal } from '../components/Modal';
+import ChatThread from '../components/chats/ChatThread';
+import ChatComposer, { type StagedAttachment } from '../components/chats/ChatComposer';
+import StatusMedia from '../components/chats/StatusMedia';
+import StatusComposeModal from '../components/chats/StatusComposeModal';
import './Chats.css';
// Quiet window for coalescing mark-as-read RPCs (see markReadCoalescer below).
@@ -175,13 +175,15 @@ const statusFontStyle = (font?: number): { fontFamily?: string; fontWeight?: num
};
export function Chats() {
- const { t } = useTranslation();
+ const { t, i18n } = useTranslation();
useDocumentTitle(t('nav.chats'));
const { error: showErrorToast, warning: showWarningToast, success: showSuccessToast } = useToast();
const { canWrite, engineType } = useRole();
// Sessions list & active session
const [sessions, setSessions] = useState<Session[]>([]);
+ // Every listed session, ready or not: the switcher shows the others with their state.
+ const [listedSessions, setListedSessions] = useState<Session[]>([]);
const [selectedSessionId, setSelectedSessionId] = useState<string>('');
const [loadingSessions, setLoadingSessions] = useState<boolean>(true);
@@ -191,10 +193,11 @@ export function Chats() {
const [searchQuery, setSearchQuery] = useState<string>('');
const [chatFilter, setChatFilter] = useState<ChatListFilter>('all');
- // The new-chat panel replaces the sidebar lists while open; the room's overflow menu drops from its header.
+ // The new-chat panel replaces the sidebar lists while open; the contact panel sits beside the room,
+ // and the room's overflow menu drops from its header.
const [showNewChat, setShowNewChat] = useState<boolean>(false);
+ const [showContactInfo, setShowContactInfo] = useState<boolean>(false);
const [roomMenuOpen, setRoomMenuOpen] = useState<boolean>(false);
- const roomMenuRef = useRef<HTMLDivElement | null>(null);
// The group whose info dialog is open, from its row's menu or from the open room's.
const [groupDialogChat, setGroupDialogChat] = useState<Chat | null>(null);
// A destructive row action awaiting confirmation, and whether it is in flight.
@@ -202,12 +205,13 @@ export function Chats() {
kind: 'leave' | 'clear' | 'delete' | 'block';
chat: Chat;
} | null>(null);
- const [confirmBusy, setConfirmBusy] = useState<boolean>(false);
// The archive view of the Chats tab, and the chats whose mute or contact dialog is open.
const [showArchived, setShowArchived] = useState<boolean>(false);
const [muteDialogChat, setMuteDialogChat] = useState<Chat | null>(null);
const [contactDialogChat, setContactDialogChat] = useState<Chat | null>(null);
const [dialogBusy, setDialogBusy] = useState<boolean>(false);
+ const [confirmBusy, setConfirmBusy] = useState<boolean>(false);
+ const roomMenuRef = useRef<HTMLDivElement | null>(null);
// Selected chat & message history
const [activeChat, setActiveChat] = useState<Chat | null>(null);
@@ -351,6 +355,7 @@ export function Chats() {
);
const activePhoneText =
activePhoneDisplay ?? (resolvedPhoneQ.data ? formatPhoneForDisplay(resolvedPhoneQ.data) : null);
+ const activeChatTitle = activeChat ? activeChat.name || activeChat.id.split('@')[0] : '';
// The list loaders below reach the translator and the error toast through a ref, not as
// dependencies: both change identity on a language switch, which re-ran the session load (it
@@ -373,6 +378,7 @@ export function Chats() {
const list = await sessionApi.list();
const readySessions = list.filter(s => s.status === 'ready');
setSessions(readySessions);
+ setListedSessions(list);
if (readySessions.length > 0) {
setSelectedSessionId(readySessions[0].id);
}
@@ -507,8 +513,8 @@ export function Chats() {
setPreviewUrl(null);
setReplyingTo(null);
lastRoomIdRef.current = null;
- // The new-chat panel lists the address book of the session being left, and an open dialog acts
- // through it.
+ // The new-chat panel lists the address book of the session being left, and an open group dialog
+ // edits a group through it.
setShowNewChat(false);
setGroupDialogChat(null);
setConfirmAction(null);
@@ -1019,7 +1025,9 @@ export function Chats() {
if (hit.sessionId !== selectedSessionId && !sessions.some(s => s.id === hit.sessionId)) {
let ready: Session[];
try {
- ready = (await sessionApi.list()).filter(s => s.status === 'ready');
+ const listed = await sessionApi.list();
+ setListedSessions(listed);
+ ready = listed.filter(s => s.status === 'ready');
} catch (err) {
showLoadError('chats.errors.loadSessions', err);
return;
@@ -1109,28 +1117,43 @@ export function Chats() {
pendingHitRef.current = null;
}, [activeChat, loadingMessages, messages, messagesContainerRef, hitSeq]);
- // Helper formats
+ // Helper formats. The list time follows WhatsApp's ladder, so the list scans the way operators
+ // expect: the clock for today, "Yesterday", the weekday within the last week, else a short date.
+ // In the dashboard's language rather than the browser's.
const formatChatTime = useCallback(
(timestamp?: number) => {
if (!timestamp) return '';
const date = new Date(timestamp * 1000);
const today = new Date();
if (date.toDateString() === today.toDateString()) {
- return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
+ return date.toLocaleTimeString(i18n.language, { hour: '2-digit', minute: '2-digit' });
}
const yesterday = new Date(today);
yesterday.setDate(yesterday.getDate() - 1);
if (date.toDateString() === yesterday.toDateString()) {
return t('chats.yesterday');
}
- return date.toLocaleDateString([], { month: 'short', day: 'numeric' });
+ const weekAgo = new Date(today);
+ weekAgo.setHours(0, 0, 0, 0);
+ weekAgo.setDate(weekAgo.getDate() - 6);
+ if (date >= weekAgo) {
+ return date.toLocaleDateString(i18n.language, { weekday: 'long' });
+ }
+ return date.toLocaleDateString(i18n.language, {
+ weekday: 'short',
+ day: '2-digit',
+ month: 'short',
+ ...(date.getFullYear() !== today.getFullYear() ? { year: 'numeric' } : {}),
+ });
},
- [t],
+ [t, i18n.language],
);
// One search box drives all three tabs; each matches on its own fields. Plain consts (not useMemo)
// because chats/channelsQuery.data/statusesQuery.data are already stable, query-cached references,
// so re-filtering on every render is cheap. See utils/chatFilters for the two status orderings.
+ // The quick filter narrows the Chats tab further. Archived chats are their own view, as in WhatsApp,
+ // except while searching, which finds a chat wherever it is; pinned chats lead the main list.
// Whether a 1:1 chat's contact is saved comes from the address book (`isMyContact`), not from its
// display name: Baileys names an unsaved contact by its bare push name too. Undefined until it loads.
const contactsQuery = useQuery({
@@ -1315,6 +1338,11 @@ export function Chats() {
const rowActions: ChatRowActions = {
onGroupInfo: setGroupDialogChat,
+ onContactInfo: chat => {
+ setActiveTab('chats');
+ setActiveChat(chat);
+ setShowContactInfo(true);
+ },
onSaveContact: canWrite ? setContactDialogChat : undefined,
canSaveContact: chat => addressbookIdOf(chat) !== null,
isSavedContact: chat => savedContactKeys?.has(contactKey(chat.id)) ?? false,
@@ -1448,6 +1476,7 @@ export function Chats() {
if (document.querySelector('[role="dialog"], [role="menu"]')) return;
if (activeStatusContactId !== null) setActiveStatusContactId(null);
else if (activeChannel) setActiveChannel(null);
+ else if (activeChat && showContactInfo) setShowContactInfo(false);
else if (activeChat) setActiveChat(null);
else if (showNewChat) setShowNewChat(false);
else return;
@@ -1455,7 +1484,7 @@ export function Chats() {
};
document.addEventListener('keydown', closeOpenViewOnEscape);
return () => document.removeEventListener('keydown', closeOpenViewOnEscape);
- }, [activeStatusContactId, activeChannel, activeChat, showNewChat]);
+ }, [activeStatusContactId, activeChannel, activeChat, showContactInfo, showNewChat]);
// Image media items for the lightbox, in render order. `getMediaSrc` reconstructs a usable src
// from either a base64 payload or a URL — the ChatMessageView shape stores both in `data`.
@@ -1476,15 +1505,6 @@ export function Chats() {
return (
<div className="chats-page">
- <PageHeader
- title={t('nav.chats')}
- subtitle={t('chats.subtitle')}
- actions={
- sessions.length > 0 &&
- canWrite && <GlobalSearch currentSessionId={selectedSessionId} onHit={handleSearchHit} />
- }
- />
-
{/* Real-time connection permanently dropped — let the user re-establish it instead of
silently showing stale chats. */}
{connectionFailed && (
@@ -1513,10 +1533,15 @@ export function Chats() {
</p>
</div>
) : (
- <div className={`chats-layout ${activeChat || activeChannel || activeStatusGroup ? 'has-active-chat' : ''}`}>
+ <div
+ className={`chats-layout ${activeChat || activeChannel || activeStatusGroup ? 'has-active-chat' : ''} ${
+ activeChat && showContactInfo ? 'has-contact-info' : ''
+ }`}
+ >
{/* LEFT SIDEBAR: session & chat rooms */}
<ChatSidebar
sessions={sessions}
+ pickerSessions={listedSessions}
selectedSessionId={selectedSessionId}
onSelectSession={setSelectedSessionId}
activeTab={activeTab}
@@ -1524,6 +1549,10 @@ export function Chats() {
searchQuery={searchQuery}
onSearchQueryChange={setSearchQuery}
onComposeStatus={() => setComposeOpen(true)}
+ formatChatTime={formatChatTime}
+ messageSearch={
+ canWrite ? <GlobalSearch currentSessionId={selectedSessionId} onHit={handleSearchHit} /> : null
+ }
onNewChat={canWrite ? () => setShowNewChat(true) : undefined}
newChatPanel={
canWrite && showNewChat ? (
@@ -1534,17 +1563,16 @@ export function Chats() {
/>
) : null
}
- formatChatTime={formatChatTime}
chatsTab={{
loading: loadingChats,
chats: filteredChats,
- activeChatId: activeChat?.id,
- pictures: listPics.data,
- onSelectChat: setActiveChat,
filter: chatFilter,
onFilterChange: setChatFilter,
rowActions,
archive: { count: archivedCount, showing: showArchived, onToggle: () => setShowArchived(v => !v) },
+ activeChatId: activeChat?.id,
+ pictures: listPics.data,
+ onSelectChat: setActiveChat,
}}
channelsTab={{
engineLoading: engineType === null,
@@ -1572,40 +1600,41 @@ export function Chats() {
<button className="room-back" onClick={() => setActiveChat(null)} aria-label={t('common.back')}>
<ArrowLeft size={20} />
</button>
- <div className="room-avatar">
- {activePp.data ? (
- <img
- src={activePp.data}
- alt=""
- // Signed CDN URLs rotate every few hours; refetch the slice on a stale load.
- onError={() => activePp.refetch()}
- />
- ) : (
- <KindIcon kind={activeChat.kind} />
- )}
- </div>
- <div className="room-contact-info">
- <h3>{activeChat.name || activeChat.id.split('@')[0]}</h3>
- {/* Personal chats show the prettified phone number — local formatting for
- @c.us ids, engine-resolved for @lid privacy ids (which are NOT phones and
- must never be formatted as one). Groups fall back to a semantic label;
- the raw JID follows below for the technical case. */}
- <span className="room-contact-phone">
- {activePhoneText ??
- (activeChat.isGroup ? t('chats.groupSubtitle') : t('chats.privateContactSubtitle'))}
- </span>
- {/* Raw JID preserved for the technical case (the gateway speaks JIDs everywhere:
- webhooks, message rows, lid resolution). Monospace + muted so it doesn't compete
- with the human-facing name/number. */}
- <span className="room-contact-jid" title={activeChat.id}>
- {activeChat.id}
+ {/* The contact itself opens the info panel, as in WhatsApp. */}
+ <button
+ type="button"
+ className="room-contact"
+ onClick={() => setShowContactInfo(open => !open)}
+ title={t('chats.contactInfo')}
+ aria-expanded={showContactInfo}
+ >
+ <ChatAvatar
+ chatId={activeChat.id}
+ pictureUrl={activePp.data}
+ kind={activeChat.kind}
+ size="sm"
+ // Signed CDN URLs rotate every few hours; refetch the slice on a stale load.
+ onImageError={() => activePp.refetch()}
+ />
+ <span className="room-contact-info">
+ <span className="room-contact-name">{activeChatTitle}</span>
+ {/* Personal chats show the prettified phone number — local formatting for
+ @c.us ids, engine-resolved for @lid privacy ids (which are NOT phones and
+ must never be formatted as one). Only under a saved name: an unnamed chat's
+ title already is the number. The raw JID is in the contact panel. */}
+ {activePhoneText && activeChat.name && (
+ <span className="room-contact-phone">
+ <bdi dir="ltr">{activePhoneText}</bdi>
+ </span>
+ )}
</span>
- </div>
+ </button>
+
<div className="room-header-actions">
<div className="room-menu" ref={roomMenuRef}>
<button
type="button"
- className={`icon-btn room-menu-trigger ${roomMenuOpen ? 'active' : ''}`}
+ className={`icon-btn ${roomMenuOpen ? 'active' : ''}`}
onClick={() => setRoomMenuOpen(open => !open)}
title={t('chats.moreActions')}
aria-label={t('chats.moreActions')}
@@ -1631,6 +1660,16 @@ export function Chats() {
</div>
)}
</div>
+ <button
+ type="button"
+ className={`icon-btn ${showContactInfo ? 'active' : ''}`}
+ onClick={() => setShowContactInfo(open => !open)}
+ title={t('chats.contactInfo')}
+ aria-label={t('chats.contactInfo')}
+ aria-pressed={showContactInfo}
+ >
+ <PanelRight size={22} />
+ </button>
</div>
</header>
@@ -1775,6 +1814,68 @@ export function Chats() {
</div>
)}
</main>
+
+ {/* Contact panel beside the room, toggled from its header. */}
+ {activeChat && showContactInfo && (
+ <aside className="contact-info-panel" aria-label={t('chats.contactInfo')}>
+ <header className="contact-info-header">
+ <button
+ type="button"
+ className="icon-btn"
+ onClick={() => setShowContactInfo(false)}
+ aria-label={t('common.close')}
+ title={t('common.close')}
+ >
+ <X size={20} />
+ </button>
+ <span>{t('chats.contactInfo')}</span>
+ </header>
+ <div className="contact-info-body">
+ <ChatAvatar
+ chatId={activeChat.id}
+ pictureUrl={activePp.data}
+ kind={activeChat.kind}
+ size="lg"
+ onImageError={() => activePp.refetch()}
+ />
+ <h3>{activeChatTitle}</h3>
+ <p className="contact-info-sub">
+ {activePhoneText ? (
+ <bdi dir="ltr">{activePhoneText}</bdi>
+ ) : activeChat.isGroup ? (
+ t('chats.groupSubtitle')
+ ) : (
+ t('chats.privateContactSubtitle')
+ )}
+ </p>
+ <dl className="contact-info-list">
+ {activePhoneText && (
+ <>
+ <dt>{t('chats.phone')}</dt>
+ <dd>
+ <bdi dir="ltr">{activePhoneText}</bdi>
+ </dd>
+ </>
+ )}
+ {/* Raw JID preserved for the technical case (the gateway speaks JIDs everywhere:
+ webhooks, message rows, lid resolution). */}
+ <dt>{t('chats.chatId')}</dt>
+ <dd className="mono">
+ <span title={activeChat.id}>{activeChat.id}</span>
+ <button
+ type="button"
+ className="icon-btn small"
+ onClick={() => void handleCopyChatId()}
+ title={t('chats.copyChatId')}
+ aria-label={t('chats.copyChatId')}
+ >
+ <Copy size={14} />
+ </button>
+ </dd>
+ </dl>
+ </div>
+ </aside>
+ )}
</div>
)}
diff --git a/dashboard/src/utils/phoneCountry.test.ts b/dashboard/src/utils/phoneCountry.test.ts
new file mode 100644
index 000000000..27a89205c
--- /dev/null
+++ b/dashboard/src/utils/phoneCountry.test.ts
@@ -0,0 +1,28 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { flagOfRegion, regionOfPhone } from './phoneCountry.ts';
+
+test('a number resolves to the country its two- or three-digit code dials', () => {
+ assert.equal(regionOfPhone('491747127865'), 'DE');
+ assert.equal(regionOfPhone('+43 664 1234567'), 'AT');
+ assert.equal(regionOfPhone('351912345678'), 'PT');
+ assert.equal(regionOfPhone('971501234567'), 'AE');
+});
+
+test('a code several countries share, or one that is unknown or too short, has no country', () => {
+ // NANP: the United States, Canada and the Caribbean all dial 1.
+ assert.equal(regionOfPhone('14155552671'), null);
+ assert.equal(regionOfPhone('8001234567'), null);
+ assert.equal(regionOfPhone('4912'), null);
+ assert.equal(regionOfPhone(null), null);
+});
+
+test('7 is Russia, except the 76 and 77 ranges, which are Kazakhstan', () => {
+ assert.equal(regionOfPhone('79161234567'), 'RU');
+ assert.equal(regionOfPhone('77011234567'), 'KZ');
+});
+
+test('a region becomes its flag emoji', () => {
+ assert.equal(flagOfRegion('DE'), '🇩🇪');
+ assert.equal(flagOfRegion('gb'), '🇬🇧');
+});
diff --git a/dashboard/src/utils/phoneCountry.ts b/dashboard/src/utils/phoneCountry.ts
new file mode 100644
index 000000000..69246901e
--- /dev/null
+++ b/dashboard/src/utils/phoneCountry.ts
@@ -0,0 +1,232 @@
+// The country a phone number dials into, for a flag beside it. Like formatPhone, this reads the E.164
+// country code off the leading digits rather than pulling in libphonenumber: WhatsApp numbers arrive
+// digits-only with the code in place, and a flag is decoration, so a code shared by several countries
+// (1 for the whole NANP) answers no country rather than a wrong one.
+
+// Country code → ISO 3166-1 alpha-2 region. Codes are prefix-free, so the first match by length wins.
+const REGION_BY_CODE: Record<string, string> = {
+ // Two digits
+ '20': 'EG',
+ '27': 'ZA',
+ '30': 'GR',
+ '31': 'NL',
+ '32': 'BE',
+ '33': 'FR',
+ '34': 'ES',
+ '36': 'HU',
+ '39': 'IT',
+ '40': 'RO',
+ '41': 'CH',
+ '43': 'AT',
+ '44': 'GB',
+ '45': 'DK',
+ '46': 'SE',
+ '47': 'NO',
+ '48': 'PL',
+ '49': 'DE',
+ '51': 'PE',
+ '52': 'MX',
+ '53': 'CU',
+ '54': 'AR',
+ '55': 'BR',
+ '56': 'CL',
+ '57': 'CO',
+ '58': 'VE',
+ '60': 'MY',
+ '61': 'AU',
+ '62': 'ID',
+ '63': 'PH',
+ '64': 'NZ',
+ '65': 'SG',
+ '66': 'TH',
+ '81': 'JP',
+ '82': 'KR',
+ '84': 'VN',
+ '86': 'CN',
+ '90': 'TR',
+ '91': 'IN',
+ '92': 'PK',
+ '93': 'AF',
+ '94': 'LK',
+ '95': 'MM',
+ '98': 'IR',
+ // Three digits: Africa and the Atlantic
+ '211': 'SS',
+ '212': 'MA',
+ '213': 'DZ',
+ '216': 'TN',
+ '218': 'LY',
+ '220': 'GM',
+ '221': 'SN',
+ '222': 'MR',
+ '223': 'ML',
+ '224': 'GN',
+ '225': 'CI',
+ '226': 'BF',
+ '227': 'NE',
+ '228': 'TG',
+ '229': 'BJ',
+ '230': 'MU',
+ '231': 'LR',
+ '232': 'SL',
+ '233': 'GH',
+ '234': 'NG',
+ '235': 'TD',
+ '236': 'CF',
+ '237': 'CM',
+ '238': 'CV',
+ '239': 'ST',
+ '240': 'GQ',
+ '241': 'GA',
+ '242': 'CG',
+ '243': 'CD',
+ '244': 'AO',
+ '245': 'GW',
+ '246': 'IO',
+ '248': 'SC',
+ '249': 'SD',
+ '250': 'RW',
+ '251': 'ET',
+ '252': 'SO',
+ '253': 'DJ',
+ '254': 'KE',
+ '255': 'TZ',
+ '256': 'UG',
+ '257': 'BI',
+ '258': 'MZ',
+ '260': 'ZM',
+ '261': 'MG',
+ '262': 'RE',
+ '263': 'ZW',
+ '264': 'NA',
+ '265': 'MW',
+ '266': 'LS',
+ '267': 'BW',
+ '268': 'SZ',
+ '269': 'KM',
+ '290': 'SH',
+ '291': 'ER',
+ '297': 'AW',
+ '298': 'FO',
+ '299': 'GL',
+ // Europe
+ '350': 'GI',
+ '351': 'PT',
+ '352': 'LU',
+ '353': 'IE',
+ '354': 'IS',
+ '355': 'AL',
+ '356': 'MT',
+ '357': 'CY',
+ '358': 'FI',
+ '359': 'BG',
+ '370': 'LT',
+ '371': 'LV',
+ '372': 'EE',
+ '373': 'MD',
+ '374': 'AM',
+ '375': 'BY',
+ '376': 'AD',
+ '377': 'MC',
+ '378': 'SM',
+ '379': 'VA',
+ '380': 'UA',
+ '381': 'RS',
+ '382': 'ME',
+ '383': 'XK',
+ '385': 'HR',
+ '386': 'SI',
+ '387': 'BA',
+ '389': 'MK',
+ '420': 'CZ',
+ '421': 'SK',
+ '423': 'LI',
+ // The Americas
+ '500': 'FK',
+ '501': 'BZ',
+ '502': 'GT',
+ '503': 'SV',
+ '504': 'HN',
+ '505': 'NI',
+ '506': 'CR',
+ '507': 'PA',
+ '508': 'PM',
+ '509': 'HT',
+ '590': 'GP',
+ '591': 'BO',
+ '592': 'GY',
+ '593': 'EC',
+ '594': 'GF',
+ '595': 'PY',
+ '596': 'MQ',
+ '597': 'SR',
+ '598': 'UY',
+ '599': 'CW',
+ // Oceania and Asia
+ '670': 'TL',
+ '672': 'NF',
+ '673': 'BN',
+ '674': 'NR',
+ '675': 'PG',
+ '676': 'TO',
+ '677': 'SB',
+ '678': 'VU',
+ '679': 'FJ',
+ '680': 'PW',
+ '681': 'WF',
+ '682': 'CK',
+ '683': 'NU',
+ '685': 'WS',
+ '686': 'KI',
+ '687': 'NC',
+ '688': 'TV',
+ '689': 'PF',
+ '690': 'TK',
+ '691': 'FM',
+ '692': 'MH',
+ '850': 'KP',
+ '852': 'HK',
+ '853': 'MO',
+ '855': 'KH',
+ '856': 'LA',
+ '880': 'BD',
+ '886': 'TW',
+ '960': 'MV',
+ '961': 'LB',
+ '962': 'JO',
+ '963': 'SY',
+ '964': 'IQ',
+ '965': 'KW',
+ '966': 'SA',
+ '967': 'YE',
+ '968': 'OM',
+ '970': 'PS',
+ '971': 'AE',
+ '972': 'IL',
+ '973': 'BH',
+ '974': 'QA',
+ '975': 'BT',
+ '976': 'MN',
+ '977': 'NP',
+ '992': 'TJ',
+ '993': 'TM',
+ '994': 'AZ',
+ '995': 'GE',
+ '996': 'KG',
+ '998': 'UZ',
+};
+
+/** The region of a digits-only international number, or null when the code is unknown or shared. */
+export function regionOfPhone(phone: string | null | undefined): string | null {
+ const digits = phone?.replace(/\D/g, '') ?? '';
+ if (digits.length < 7) return null;
+ // 7 is Russia, except 76 and 77, which Kazakhstan took. 1 is the whole NANP: no single country.
+ if (digits[0] === '7') return /^7[67]/.test(digits) ? 'KZ' : 'RU';
+ if (digits[0] === '1') return null;
+ return REGION_BY_CODE[digits.slice(0, 2)] ?? REGION_BY_CODE[digits.slice(0, 3)] ?? null;
+}
+
+/** The flag emoji of a region: its two letters as regional indicator symbols. */
+export function flagOfRegion(region: string): string {
+ return String.fromCodePoint(...[...region.toUpperCase()].map(letter => 0x1f1e6 + letter.charCodeAt(0) - 65));
+}
diff --git a/docs/17-dashboard-design.md b/docs/17-dashboard-design.md
index 1037c3e48..60ad195ab 100644
--- a/docs/17-dashboard-design.md
+++ b/docs/17-dashboard-design.md
@@ -108,12 +108,13 @@ mounted for any admin key.
```
/ → Dashboard (overview + charts)
/sessions → Sessions (create / start / stop / QR / delete)
-/chats → Chats (Chats / Channels / Status tabs, quick filters and an Archived view on
- Chats; chat list + message thread live via WebSocket; thread pages older
- history in on scroll-up; per-chat menu (pin, mute, archive, mark unread,
- block, leave group; clear and delete on whatsapp-web.js only) [operator];
- group info dialog; new chat / new group [operator]; read-only channel feed
- on whatsapp-web.js)
+/chats → Chats (full height, no page header; session switcher listing every session;
+ Chats / Channels / Status tabs, quick filters and an Archived view on Chats;
+ chat list + message thread live via WebSocket; thread pages older history in
+ on scroll-up; per-chat menu (pin, mute, archive, mark unread, block, leave
+ group; clear and delete on whatsapp-web.js only) [operator]; contact info
+ panel and group info dialog; new chat / new group [operator]; read-only
+ channel feed on whatsapp-web.js)
/webhooks → Webhooks (per-session webhook endpoints)
/templates → Message Templates
/message-tester → Message Tester (ad-hoc send-* + check-number)
@@ -126,7 +127,9 @@ mounted for any admin key.
> There is **no Settings page** and no `/sessions/:id`, `/sessions/:id/chat`, or `/webhooks/:id`
> route. Theme (light/dark/system) is a one-click toggle in the sidebar footer (`Layout.tsx`),
-> persisted client-side by the `useTheme` hook.
+> persisted client-side by the `useTheme` hook. The button that collapses the sidebar to its icon rail
+> sits in the sidebar header, beside the logo, and under the logo once collapsed; its panel icon is
+> mirrored for right-to-left languages.
## 17.3 Wireframes
@@ -406,7 +409,7 @@ is no design-system package to pull from.
| `CustomSelect` | `components/CustomSelect.tsx` | Keyboard-navigable select replacement (type-ahead, arrow keys) used by Sessions / Logs / Login |
| `DashboardCharts` | `components/DashboardCharts.tsx` | `recharts`-based message-volume / activity charts on the Dashboard |
| `FilterBuilder` | `components/FilterBuilder.tsx` | Visual condition builder for webhook event filters |
-| `GlobalSearch` | `components/GlobalSearch.tsx` | Debounced message-search box in the Chats header, with all-sessions / current-session scope |
+| `GlobalSearch` | `components/GlobalSearch.tsx` | Debounced message search behind a toggle in the Chats sidebar header, with all-sessions / current-session scope |
| `PluginInstances` | `components/PluginInstances.tsx` | Per-plugin instance list: create / edit / delete and secret regeneration |
| `ErrorBoundary` | `components/ErrorBoundary.tsx` | Top-level React error boundary wrapping the whole app |
| `GithubIcon` | `components/GithubIcon.tsx` | Inline brand SVG |
@@ -415,18 +418,19 @@ is no design-system package to pull from.
| `RoleProvider` | `components/RoleProvider.tsx` | Context holding the logged-in key's role, read with `useRole` (`canWrite` gates write actions) |
Chat-specific pieces live one level down in `components/chats/`: `MessageBody` (WhatsApp text
-formatting + link detection), `ChatThread` (bubble list, including inbound Baileys prompt buttons
-that call `POST /sessions/:id/messages/click-button`), and `MediaLightbox` (the media viewer, built
-on `yet-another-react-lightbox`). The rest of the room is split the same way: `ChatSidebar`,
-`NewChatPanel` (new chat, and new group on Baileys), `ChatRowMenu` (a chat row's actions;
-`chatActionItems` lists them for the row and for the room's menu alike), `GroupInfoDialog` (a group's
-name, picture, description and participants), `ChatDialogs` (mute and save-contact dialogs),
-`ChatComposer`, `ChatAvatar`, `KindIcon`, `StatusComposeModal` and `StatusMedia`. Prompt choices
-arrive on live `message.received` as top-level `buttons` and are also stored in message
-`metadata.buttons` so a reload can re-render them. Clicking still requires the prompt to be in the
-engine store; an evicted prompt 404s. A read-only key sees the choices disabled and gets no reply,
-react or delete actions, the same as the disabled composer, no New chat button, and of a chat's
-actions only a group's info.
+formatting + link detection), `ChatThread` (bubble list with day separators, including inbound
+Baileys prompt buttons that call `POST /sessions/:id/messages/click-button`), and `MediaLightbox`
+(the media viewer, built on `yet-another-react-lightbox`). The rest of the room is split the same
+way: `ChatSidebar`, `SessionPicker` (the session switcher in the sidebar header), `NewChatPanel`
+(new chat, and new group on Baileys), `ChatRowMenu` (a chat row's actions; `chatActionItems` lists
+them for the row and for the room's menu alike), `GroupInfoDialog` (a group's name, picture,
+description and participants), `ChatDialogs` (mute and save-contact dialogs), `ChatComposer`,
+`ChatAvatar`, `KindIcon`, `StatusComposeModal` and `StatusMedia`. Prompt choices arrive on live
+`message.received` as top-level `buttons` and are also stored in message `metadata.buttons` so a
+reload can re-render them. Clicking still requires the prompt to be in the engine store; an evicted
+prompt 404s. A read-only key sees the choices disabled and gets no reply, react or delete actions,
+the same as the disabled composer, no message search, no New chat button, and of a chat's actions
+only its contact or group info.
The message thread is paged. `useChatMessages` is a `useInfiniteQuery` whose cursor is the number
of DB rows fetched so far, not the length of the rendered list — the thread also carries engine
@@ -485,9 +489,10 @@ Three pages keep a server list in local state instead of the query cache:
own row writes and socket pushes, so an older answer never overwrites a newer row. After each read
it applies, it invalidates the `['sessions']` key prefix so the Dashboard and per-session views
refetch.
-- **Chats** (`Chats.tsx`) reads the ready sessions directly on mount, and again when a search hit
- names a session that list lacks, and keeps the chat list in local state that socket pushes, sends,
- marking a chat read and the chat actions (pin, mute, archive, rename) update.
+- **Chats** (`Chats.tsx`) reads the sessions directly on mount, and again when a search hit names a
+ session that list lacks. The session switcher lists all of them, but only a ready one can be
+ selected. The page keeps the chat list in local state that socket pushes, sends, marking a chat
+ read and the chat actions (pin, mute, archive, rename) update.
- **Plugins** (`Plugins.tsx`) keeps the catalog in local state. It prefetches it silently on mount
so installed cards can show an update chip, fetches it again when the Catalog tab opens with an
empty list, and reloads it after any install, update or uninstall.
@@ -701,7 +706,10 @@ export function useTheme() {
The actual colors live in `src/App.css` as variables keyed off `[data-theme]` —
e.g. `:root { --bg-light: #f8fafc; } [data-theme='dark'] { --bg-light: #0f172a; }` — so
-switching mode is a single attribute write with no re-render of the tree.
+switching mode is a single attribute write with no re-render of the tree. The Chats page adds its
+own chat palette (bubbles, wallpaper, avatar tones) as variables scoped to the page in
+`pages/Chats.css`, keyed off the same `data-theme` attribute and `prefers-color-scheme`, so it
+follows the mode too.
## 17.8 Build & Deployment