Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
feat(dashboard): add chat actions, new chat and group info to the chat page
Rezk Jörg Sebeningfacd2f9acef0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex df94bcee4..2d423e53b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- Add Number Checker page in dashboard for single and bulk WhatsApp recipient pre-validation.- Add the opt-in `message.receipt` event for per-recipient group and status receipts on Baileys (#1748).+- Add All, Unread, 1:1, Groups and Unknown quick filters to the dashboard chat list, where Unread includes chats marked unread and Unknown lists 1:1 chats whose contact is not saved.+- Add a New chat panel to the dashboard Chats page for operator keys that opens a chat with a saved contact or a typed international number once the gateway confirms the number is on WhatsApp, and on Baileys creates a group from a name and picked contacts or numbers.+- Add a menu to every dashboard chat row and to the open chat's header that pins, mutes, archives, marks unread, clears or deletes a chat, saves, renames or blocks its contact, and leaves a group, asking first before an action that cannot be undone; the header's menu also copies the chat id and closes the chat.+- Add an Archived view to the dashboard chat list; archived chats leave the main list, and pinned chats lead it.+- Add a group info dialog to the dashboard Chats page that edits a group's name, picture and description and adds, removes, promotes and demotes its participants when the account administers the group.### Changeddiff --git a/dashboard/src/components/chats/ChatAvatar.tsx b/dashboard/src/components/chats/ChatAvatar.tsxindex b0741bfd4..1654ecce8 100644--- a/dashboard/src/components/chats/ChatAvatar.tsx+++ b/dashboard/src/components/chats/ChatAvatar.tsx@@ -3,18 +3,30 @@ import KindIcon from './KindIcon';// 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.-function ChatAvatar({ pictureUrl, kind }: { pictureUrl?: string | null; kind: ChatKind }) {+// or when the contact hides their picture. The group info dialog shows it large, with `onImageError`+// refetching an expired CDN URL.+function ChatAvatar({+ pictureUrl,+ kind,+ size,+ onImageError,+}: {+ pictureUrl?: string | null;+ kind: ChatKind;+ size?: 'lg';+ onImageError?: () => void;+}) {+ const className = size ? `chat-avatar avatar-${size}` : 'chat-avatar';if (pictureUrl) {return (- <div className="chat-avatar">- <img src={pictureUrl} alt="" />+ <div className={className}>+ <img src={pictureUrl} alt="" onError={onImageError} /></div>);}return (- <div className="chat-avatar">- <KindIcon kind={kind} />+ <div className={className}>+ <KindIcon kind={kind} size={size === 'lg' ? 40 : 20} /></div>);}diff --git a/dashboard/src/components/chats/ChatDialogs.tsx b/dashboard/src/components/chats/ChatDialogs.tsxnew file mode 100644index 000000000..e08da14d1--- /dev/null+++ b/dashboard/src/components/chats/ChatDialogs.tsx@@ -0,0 +1,127 @@+import { useState } from 'react';+import { useTranslation } from 'react-i18next';+import { Loader2 } from 'lucide-react';+import { Modal } from '../Modal';+import type { Chat } from '../../services/api';++export type MuteDuration = '8h' | '1w' | 'always';++const MUTE_DURATIONS: MuteDuration[] = ['8h', '1w', 'always'];++/** Pick how long a chat stays muted, as WhatsApp offers it: 8 hours, a week, or until it is unmuted. */+export function MuteChatDialog({+ chat,+ busy,+ onMute,+ onClose,+}: {+ chat: Chat;+ busy: boolean;+ onMute: (duration: MuteDuration) => void;+ onClose: () => void;+}) {+ const { t } = useTranslation();+ const [duration, setDuration] = useState<MuteDuration>('8h');+ return (+ <Modal+ open+ onClose={onClose}+ title={t('chats.rowActions.muteTitle', { name: chat.name || chat.id.split('@')[0] })}+ className="confirm-modal"+ closeLabel={t('common.close')}+ footer={+ <>+ <button className="btn-secondary" onClick={onClose} disabled={busy}>+ {t('common.cancel')}+ </button>+ <button className="btn-primary" onClick={() => onMute(duration)} disabled={busy}>+ {busy ? <Loader2 className="animate-spin" size={16} /> : t('chats.rowActions.mute')}+ </button>+ </>+ }+ >+ <p className="text-muted">{t('chats.rowActions.muteHint')}</p>+ <fieldset className="chat-dialog-options" aria-label={t('chats.rowActions.mute')}>+ {MUTE_DURATIONS.map(value => (+ <label key={value}>+ <input+ type="radio"+ name="mute-duration"+ value={value}+ checked={duration === value}+ onChange={() => setDuration(value)}+ />+ {t(`chats.rowActions.muteFor.${value}`)}+ </label>+ ))}+ </fieldset>+ </Modal>+ );+}++// The gateway's cap on an address-book name (UpsertContactDto).+const NAME_MAX_LENGTH = 100;++/** Save a 1:1 chat's contact to the account's address book, or rename the entry it has. */+export function SaveContactDialog({+ chat,+ busy,+ onSave,+ onClose,+}: {+ chat: Chat;+ busy: boolean;+ onSave: (firstName: string, lastName: string) => void;+ onClose: () => void;+}) {+ const { t } = useTranslation();+ // A push name (`~Max`) or the number itself is no name to start from.+ const known = chat.name && !chat.name.startsWith('~') && /\D/.test(chat.name.replace(/[\s+()-]/g, ''));+ const [first, ...rest] = known ? chat.name.trim().split(/\s+/) : [''];+ const [firstName, setFirstName] = useState(first ?? '');+ const [lastName, setLastName] = useState(rest.join(' '));+ const canSave = firstName.trim().length > 0 && !busy;+ return (+ <Modal+ open+ onClose={onClose}+ title={known ? t('chats.rowActions.renameContact') : t('chats.rowActions.saveContact')}+ className="confirm-modal"+ closeLabel={t('common.close')}+ footer={+ <>+ <button className="btn-secondary" onClick={onClose} disabled={busy}>+ {t('common.cancel')}+ </button>+ <button className="btn-primary" onClick={() => onSave(firstName.trim(), lastName.trim())} disabled={!canSave}>+ {busy ? <Loader2 className="animate-spin" size={16} /> : t('common.save')}+ </button>+ </>+ }+ >+ <form+ className="chat-dialog-form"+ onSubmit={event => {+ event.preventDefault();+ if (canSave) onSave(firstName.trim(), lastName.trim());+ }}+ >+ <label>+ <span>{t('chats.rowActions.firstName')}</span>+ <input+ type="text"+ value={firstName}+ maxLength={NAME_MAX_LENGTH}+ onChange={e => setFirstName(e.target.value)}+ autoFocus+ />+ </label>+ <label>+ <span>{t('chats.rowActions.lastName')}</span>+ <input type="text" value={lastName} maxLength={NAME_MAX_LENGTH} onChange={e => setLastName(e.target.value)} />+ </label>+ <p className="text-muted">{chat.id}</p>+ </form>+ </Modal>+ );+}diff --git a/dashboard/src/components/chats/ChatRowMenu.tsx b/dashboard/src/components/chats/ChatRowMenu.tsxnew file mode 100644index 000000000..9c9d31157--- /dev/null+++ b/dashboard/src/components/chats/ChatRowMenu.tsx@@ -0,0 +1,158 @@+import { useEffect, useLayoutEffect, useRef, useState } from 'react';+import { useTranslation } from 'react-i18next';+import { ChevronDown } from 'lucide-react';+import type { Chat } from '../../services/api';+import { chatActionItems, type ChatActionItem, type ChatRowActions } from './chatActionItems';++/**+ * A chat's actions as menu entries, for the row's chevron and the open chat's header menu alike. A disabled+ * entry stays visible with the reason under its label.+ */+export function ChatActionList({+ chat,+ items,+ groupClassName,+ onPicked,+}: {+ chat: Chat;+ items: ChatActionItem[];+ groupClassName: string;+ onPicked: () => void;+}) {+ return (+ <>+ {items.map(item => (+ <div key={item.key} className={groupClassName}>+ {item.separated && <hr />}+ <button+ type="button"+ disabled={item.disabled}+ onClick={() => {+ onPicked();+ item.run(chat);+ }}+ >+ {item.icon}+ <span className="chat-action-label">+ {item.label}+ {item.hint && <small>{item.hint}</small>}+ </span>+ </button>+ </div>+ ))}+ </>+ );+}++/** The actions of a chat for the open chat's header menu; the row's chevron renders its own. */+export function ChatActions({+ chat,+ actions,+ onPicked,+}: {+ chat: Chat;+ actions: ChatRowActions;+ onPicked: () => void;+}) {+ const { t } = useTranslation();+ return (+ <ChatActionList+ chat={chat}+ items={chatActionItems(chat, actions, t)}+ groupClassName="room-menu-group"+ onPicked={onPicked}+ />+ );+}++/**+ * The chevron on a chat row, opening its actions. A sibling of the row, not inside it: the row is itself a+ * button, and a control nested in one is unreachable to assistive technology. A disclosure of plain+ * buttons, not role="menu", which would promise roving focus and arrow keys.+ */+function ChatRowMenu({ chat, actions }: { chat: Chat; actions: ChatRowActions }) {+ const { t } = useTranslation();+ const items = chatActionItems(chat, actions, t);+ const [open, setOpen] = useState(false);+ const rootRef = useRef<HTMLDivElement | null>(null);+ const triggerRef = useRef<HTMLButtonElement | null>(null);+ const popoverRef = useRef<HTMLDivElement | null>(null);++ // The popover is placed fixed against the viewport, so the scrolling chat list does not clip it: below+ // the chevron when it fits, above it otherwise, aligned to the chevron's end edge and kept on screen.+ useLayoutEffect(() => {+ const popover = popoverRef.current;+ const trigger = triggerRef.current;+ if (!open || !popover || !trigger) return;+ const gap = 6;+ const margin = 8;+ const anchor = trigger.getBoundingClientRect();+ const { offsetWidth: width, offsetHeight: height } = popover;+ const rtl = getComputedStyle(trigger).direction === 'rtl';+ const fitsBelow = anchor.bottom + gap + height <= window.innerHeight - margin;+ const top = fitsBelow ? anchor.bottom + gap : Math.max(margin, anchor.top - gap - height);+ const start = rtl ? anchor.left : anchor.right - width;+ const left = Math.min(Math.max(margin, start), window.innerWidth - width - margin);+ Object.assign(popover.style, { position: 'fixed', top: `${top}px`, left: `${left}px`, insetInlineEnd: 'auto' });+ }, [open]);++ // Closes on a press outside and on Escape, which it takes in the capture phase so the page leaves the+ // open chat alone.+ useEffect(() => {+ if (!open) return;+ const onPress = (event: MouseEvent) => {+ if (!rootRef.current?.contains(event.target as Node)) setOpen(false);+ };+ const onEscape = (event: KeyboardEvent) => {+ if (event.key !== 'Escape' || event.isComposing || event.defaultPrevented) return;+ event.preventDefault();+ setOpen(false);+ triggerRef.current?.focus();+ };+ // A fixed popover would drift from its row, so a scroll of the list or a resize closes it.+ const onMove = (event: Event) => {+ if (!popoverRef.current?.contains(event.target as Node)) setOpen(false);+ };+ document.addEventListener('mousedown', onPress);+ document.addEventListener('keydown', onEscape, true);+ document.addEventListener('scroll', onMove, true);+ window.addEventListener('resize', onMove);+ return () => {+ document.removeEventListener('mousedown', onPress);+ document.removeEventListener('keydown', onEscape, true);+ document.removeEventListener('scroll', onMove, true);+ window.removeEventListener('resize', onMove);+ };+ }, [open]);++ // A row with nothing to offer (a read-only key on a 1:1 chat) gets no chevron at all.+ if (items.length === 0) return null;++ return (+ <div className={`chat-row-menu ${open ? 'open' : ''}`} ref={rootRef}>+ <button+ ref={triggerRef}+ type="button"+ className="chat-row-menu-trigger"+ onClick={() => setOpen(value => !value)}+ aria-expanded={open}+ aria-label={t('chats.rowActions.actionsFor', { name: chat.name || chat.id.split('@')[0] })}+ title={t('chats.moreActions')}+ >+ <ChevronDown size={18} />+ </button>+ {open && (+ <div className="chat-row-menu-popover" ref={popoverRef}>+ <ChatActionList+ chat={chat}+ items={items}+ groupClassName="chat-row-menu-group"+ onPicked={() => setOpen(false)}+ />+ </div>+ )}+ </div>+ );+}++export default ChatRowMenu;diff --git a/dashboard/src/components/chats/ChatSidebar.test.ts b/dashboard/src/components/chats/ChatSidebar.test.tsindex df88ebd35..5c6495c4c 100644--- a/dashboard/src/components/chats/ChatSidebar.test.ts+++ b/dashboard/src/components/chats/ChatSidebar.test.ts@@ -6,6 +6,7 @@ import { createElement } from 'react';import type { UseQueryResult } from '@tanstack/react-query';import type { Channel, Chat } from '../../services/api.ts';import type { ChatsTab } from './ChatSidebar.tsx';+import type { ChatListFilter } from '../../utils/chatFilters.ts';let rtl: typeof import('@testing-library/react');let ChatSidebar: (typeof import('./ChatSidebar.tsx'))['default'];@@ -37,7 +38,12 @@ const chat = (id: string, unreadCount: number): Chat => ({muted: false,});-function renderSidebar(activeTab: ChatsTab, chats: Chat[], channels: { all: Channel[]; shown: Channel[] }) {+function renderSidebar(+ activeTab: ChatsTab,+ chats: Chat[],+ channels: { all: Channel[]; shown: Channel[] },+ { filter = 'all' }: { filter?: ChatListFilter } = {},+) {const role = {role: 'operator' as const,setRole: () => undefined,@@ -65,7 +71,7 @@ function renderSidebar(activeTab: ChatsTab, chats: Chat[], channels: { all: ChanonSearchQueryChange: () => undefined,onComposeStatus: () => undefined,formatChatTime: () => '',- chatsTab: { loading: false, chats, onSelectChat: () => undefined },+ chatsTab: { loading: false, chats, filter, onFilterChange: () => undefined, onSelectChat: () => undefined },channelsTab: {engineLoading: false,supported: true,@@ -100,6 +106,28 @@ test('a chat marked unread (count -1) shows an unread badge without a number', ();});+test('a quick filter that leaves no chat says so, while an empty account still reads as having none', () => {+ const filtered = renderSidebar('chats', [], { all: [], shown: [] }, { filter: 'groups' });+ assert.equal(filtered.container.querySelector('.chats-list-empty')?.textContent, t('chats.noFilterResults'));+ rtl.cleanup();++ const empty = renderSidebar('chats', [], { all: [], shown: [] });+ assert.equal(empty.container.querySelector('.chats-list-empty')?.textContent, t('chats.empty'));+});++test('the quick filters show the active one as pressed, on the Chats tab only', () => {+ const { container } = renderSidebar('chats', [], { all: [], shown: [] }, { filter: 'unread' });+ const pressed = Array.from(container.querySelectorAll('.chat-filter-pill[aria-pressed="true"]'));+ assert.deepEqual(+ pressed.map(pill => pill.textContent),+ [t('chats.filters.unread')],+ );+ rtl.cleanup();++ const channels = renderSidebar('channels', [], { all: [], shown: [] });+ assert.equal(channels.container.querySelector('.chat-filters'), null);+});+test('a channel search with no match says so instead of showing a blank list', () => {const channel = { id: '1@newsletter', name: 'News' } as Channel;const { container } = renderSidebar('channels', [], { all: [channel], shown: [] });diff --git a/dashboard/src/components/chats/ChatSidebar.tsx b/dashboard/src/components/chats/ChatSidebar.tsxindex 4c76e5556..fff9c2755 100644--- a/dashboard/src/components/chats/ChatSidebar.tsx+++ b/dashboard/src/components/chats/ChatSidebar.tsx@@ -1,9 +1,25 @@+import type { ReactNode } from 'react';import { useTranslation } from 'react-i18next';-import { AlertCircle, CircleDashed, Loader2, Megaphone, Plus, Search } from 'lucide-react';+import {+ AlertCircle,+ Archive,+ ArrowLeft,+ BellOff,+ CircleDashed,+ Loader2,+ Megaphone,+ MessageSquarePlus,+ Pin,+ Plus,+ Search,+} 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 ChatRowMenu from './ChatRowMenu';+import type { ChatRowActions } from './chatActionItems';export type ChatsTab = 'chats' | 'channels' | 'status';@@ -17,9 +33,19 @@ interface ChatSidebarProps {onSearchQueryChange: (query: string) => void;onComposeStatus: () => void;formatChatTime: (timestamp?: number) => string;+ /** 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. */+ newChatPanel?: ReactNode;chatsTab: {loading: boolean;chats: Chat[];+ filter: ChatListFilter;+ onFilterChange: (filter: ChatListFilter) => 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;@@ -53,6 +79,8 @@ function ChatSidebar({onSearchQueryChange,onComposeStatus,formatChatTime,+ onNewChat,+ newChatPanel,chatsTab,channelsTab,statusTab,@@ -105,6 +133,12 @@ function ChatSidebar({{formatLastMessageSnippet(chat) ||(!chat.timestamp && <span className="no-message">{t('chats.noMessageYet')}</span>)}</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')} />}+ </span>+ )}{/* A negative count is a chat marked unread (Baileys reports -1): a badge with no number. */}{chat.unreadCount < 0 ? (<span@@ -127,6 +161,10 @@ function ChatSidebar({);};+ if (newChatPanel) {+ return <aside className="chats-sidebar">{newChatPanel}</aside>;+ }+return (<aside className="chats-sidebar"><div className="sidebar-header-box">@@ -165,17 +203,47 @@ function ChatSidebar({))}</div>- {/* 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)}- />+ {/* 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 && (+ <button+ type="button"+ className="icon-btn chat-new-button"+ onClick={onNewChat}+ title={t('chats.newChat.title')}+ aria-label={t('chats.newChat.title')}+ >+ <MessageSquarePlus size={20} />+ </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}>@@ -188,6 +256,16 @@ function ChatSidebar({{/* 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} />}+ <span>+ {chatsTab.archive.showing ? t('chats.rowActions.archivedTitle') : t('chats.rowActions.archivedEntry')}+ </span>+ {!chatsTab.archive.showing && <span className="chat-archive-count">{chatsTab.archive.count}</span>}+ </button>+ )}{chatsTab.loading ? (<div className="chats-list-loading"><Loader2 className="animate-spin" size={24} />@@ -195,10 +273,25 @@ function ChatSidebar({</div>) : chatsTab.chats.length === 0 ? (<div className="chats-list-empty">- <span>{t('chats.empty')}</span>+ <span>+ {chatsTab.archive?.showing+ ? t('chats.rowActions.archiveEmpty')+ : chatsTab.filter === 'all'+ ? t('chats.empty')+ : t('chats.noFilterResults')}+ </span></div>) : (- chatsTab.chats.map(renderChatRow)+ chatsTab.chats.map(chat =>+ chatsTab.rowActions && (chat.kind === 'group' || chat.kind === 'individual') ? (+ <div key={chat.id} className="chat-item-wrap has-menu">+ {renderChatRow(chat)}+ <ChatRowMenu chat={chat} actions={chatsTab.rowActions} />+ </div>+ ) : (+ renderChatRow(chat)+ ),+ ))}</div>)}diff --git a/dashboard/src/components/chats/GroupInfoDialog.tsx b/dashboard/src/components/chats/GroupInfoDialog.tsxnew file mode 100644index 000000000..40861b1d6--- /dev/null+++ b/dashboard/src/components/chats/GroupInfoDialog.tsx@@ -0,0 +1,382 @@+import { useEffect, useRef, useState } from 'react';+import { useQuery, useQueryClient } from '@tanstack/react-query';+import { useTranslation } from 'react-i18next';+import { Crown, Info, Loader2, RefreshCw, ShieldCheck, ShieldOff, UserMinus, UserPlus, Users } from 'lucide-react';+import { Modal } from '../Modal';+import { contactApi, sessionApi, type Chat, type GroupInfo, type Session } from '../../services/api';+import { useProfilePicture } from '../../hooks/useProfilePicture';+import { useRole } from '../../hooks/useRole';+import { useToast } from '../../hooks/useToast';+import { formatPhoneForDisplay } from '../../utils/formatPhone';+import { MEDIA_UPLOAD_MAX_BYTES } from './ChatComposer';+import ChatAvatar from './ChatAvatar';++// The gateway's caps (CreateGroupDto / GroupDescriptionDto).+const GROUP_NAME_MAX_LENGTH = 100;+const GROUP_DESCRIPTION_MAX_LENGTH = 1024;++type Tab = 'info' | 'participants';++interface GroupInfoDialogProps {+ session: Session;+ group: Chat;+ onClose: () => void;+ /** The group's name changed through `sessionId`: the page renames its row and room if still on it. */+ onRenamed: (sessionId: string, groupId: string, name: string) => void;+}++const errorText = (err: unknown) => (err instanceof Error ? err.message : undefined);++/** Whether a participant is this session's own account. */+const isOwnAccount = (participant: GroupInfo['participants'][number], session: Session) => {+ const own = session.phone?.replace(/\D/g, '');+ return Boolean(own) && (participant.number === own || participant.id.split('@')[0].split(':')[0] === own);+};++/**+ * Edit a group's name, picture and description, and its participants, through the session that is open.+ * What this account may change is WhatsApp's call: an admin may change everything, a member only the info+ * of a group whose info is not locked to admins. The dialog reads that from the group and offers no edit the+ * gateway would refuse.+ */+function GroupInfoDialog({ session, group, onClose, onRenamed }: GroupInfoDialogProps) {+ const { t } = useTranslation();+ const { canWrite } = useRole();+ const { success: showSuccess, error: showError } = useToast();+ const queryClient = useQueryClient();++ const [tab, setTab] = useState<Tab>('info');+ const infoQuery = useQuery({+ queryKey: ['group-info', session.id, group.id],+ queryFn: () => sessionApi.getGroup(session.id, group.id),+ });+ const picture = useProfilePicture(session.id, group.id);+ const info = infoQuery.data;++ const me = info?.participants.find(p => isOwnAccount(p, session));+ const isAdmin = Boolean(me?.isAdmin || me?.isSuperAdmin);+ const canEditInfo = canWrite && Boolean(info) && (isAdmin || info?.locked === false);+ const canManageMembers = canWrite && isAdmin;++ // The form starts from the group as loaded, and again after a refresh.+ const [name, setName] = useState('');+ const [description, setDescription] = useState('');+ const [newPicture, setNewPicture] = useState<{ base64: string; mimetype: string; preview: string } | null>(null);+ const [saving, setSaving] = useState(false);+ useEffect(() => {+ if (!info) return;+ setName(info.name);+ setDescription(info.description ?? '');+ setNewPicture(null);+ }, [info]);+ // The preview is an object URL: released when replaced and when the dialog closes.+ useEffect(() => {+ if (!newPicture) return;+ return () => URL.revokeObjectURL(newPicture.preview);+ }, [newPicture]);++ const fileInputRef = useRef<HTMLInputElement | null>(null);+ const pickPicture = (file: File | undefined) => {+ if (!file) return;+ if (!file.type.startsWith('image/')) return;+ if (file.size > MEDIA_UPLOAD_MAX_BYTES) {+ showError(t('chats.errors.fileTooLarge'));+ return;+ }+ const reader = new FileReader();+ reader.onload = event => {+ const base64 = String(event.target?.result ?? '').split(',')[1] ?? '';+ setNewPicture({ base64, mimetype: file.type, preview: URL.createObjectURL(file) });+ };+ reader.readAsDataURL(file);+ };++ const trimmedName = name.trim();+ const nameChanged = Boolean(info) && trimmedName !== info?.name;+ const descriptionChanged = Boolean(info) && description !== (info?.description ?? '');+ const dirty = nameChanged || descriptionChanged || Boolean(newPicture);++ // Each field is its own route, so each is saved on its own: a picture the engine refuses does not take+ // a saved name down with it, and the toast names the step that failed.+ const save = async () => {+ if (!info || !dirty || !trimmedName || saving) return;+ setSaving(true);+ try {+ if (nameChanged) {+ await sessionApi.setGroupSubject(session.id, group.id, trimmedName);+ onRenamed(session.id, group.id, trimmedName);+ }+ if (descriptionChanged) await sessionApi.setGroupDescription(session.id, group.id, description);+ if (newPicture) {+ await sessionApi.setGroupPicture(session.id, group.id, newPicture.base64, newPicture.mimetype);+ await queryClient.invalidateQueries({ queryKey: ['profilePicture', session.id, group.id] });+ await queryClient.invalidateQueries({ queryKey: ['profilePictures', session.id] });+ }+ showSuccess(t('chats.group.saved'));+ await infoQuery.refetch();+ } catch (err) {+ showError(t('chats.group.saveFailed'), errorText(err));+ } finally {+ setSaving(false);+ }+ };++ // --- Participants ---+ const [pending, setPending] = useState<string | null>(null);+ const [newMember, setNewMember] = useState('');+ const runMemberAction = async (key: string, action: () => Promise<unknown>) => {+ setPending(key);+ try {+ await action();+ await infoQuery.refetch();+ } catch (err) {+ showError(t('chats.group.memberActionFailed'), errorText(err));+ } finally {+ setPending(null);+ }+ };+ // A number is checked first, as in the new-chat panel: the gateway resolves it to the id WhatsApp uses.+ const addMember = () =>+ runMemberAction('add', async () => {+ const digits = newMember.replace(/\D/g, '').replace(/^00/, '');+ const check = await contactApi.checkNumber(session.id, digits);+ if (!check.exists || !check.whatsappId) {+ throw new Error(t('chats.newChat.notOnWhatsApp', { number: formatPhoneForDisplay(digits) ?? `+${digits}` }));+ }+ await sessionApi.addGroupParticipants(session.id, group.id, [check.whatsappId]);+ setNewMember('');+ });++ const sessionName = session.name;+ const subheader = (+ <div className="group-info-toolbar">+ <div className="chats-tabs" role="tablist">+ {(['info', 'participants'] as const).map(id => (+ <button+ key={id}+ type="button"+ role="tab"+ aria-selected={tab === id}+ className={`chats-tab ${tab === id ? 'active' : ''}`}+ onClick={() => setTab(id)}+ >+ {id === 'info' ? <Info size={16} /> : <Users size={16} />}+ {id === 'info' ? t('chats.group.tabInfo') : t('chats.group.tabParticipants')}+ </button>+ ))}+ </div>+ {info && (+ <span className={`group-info-badge ${isAdmin ? 'admin' : ''}`}>+ {isAdmin ? <ShieldCheck size={16} /> : <ShieldOff size={16} />}+ {isAdmin+ ? t('chats.group.managedBy', { session: sessionName })+ : t('chats.group.notAdmin', { session: sessionName })}+ </span>+ )}+ <button+ type="button"+ className="icon-btn"+ onClick={() => void infoQuery.refetch()}+ disabled={infoQuery.isFetching}+ title={t('common.refresh')}+ aria-label={t('common.refresh')}+ >+ <RefreshCw size={18} className={infoQuery.isFetching ? 'animate-spin' : undefined} />+ </button>+ </div>+ );++ return (+ <Modal+ open+ onClose={onClose}+ className="group-info-modal"+ closeLabel={t('common.close')}+ title={+ <span className="group-info-title">+ <span className="group-info-tile" aria-hidden="true">+ <Users size={24} />+ </span>+ <span className="group-info-heading">+ <span>{t('chats.group.editTitle')}</span>+ <span className="group-info-subtitle">{info?.name ?? group.name}</span>+ </span>+ </span>+ }+ subheader={subheader}+ footer={+ tab === 'info' ? (+ <>+ <button type="button" className="btn-secondary" onClick={onClose} disabled={saving}>+ {t('common.cancel')}+ </button>+ <button+ type="button"+ className="btn-primary"+ onClick={() => void save()}+ disabled={!canEditInfo || !dirty || !trimmedName || saving}+ >+ {saving ? <Loader2 className="animate-spin" size={16} /> : t('chats.group.save')}+ </button>+ </>+ ) : undefined+ }+ >+ {infoQuery.isLoading ? (+ <div className="group-info-state">+ <Loader2 className="animate-spin" size={24} />+ </div>+ ) : infoQuery.isError || !info ? (+ <div className="group-info-state">{t('chats.group.loadFailed')}</div>+ ) : tab === 'info' ? (+ <div className="group-info-form">+ <label className="group-info-field">+ <span>+ {t('chats.group.name')} <span className="required">*</span>+ </span>+ <input+ type="text"+ value={name}+ maxLength={GROUP_NAME_MAX_LENGTH}+ onChange={e => setName(e.target.value)}+ disabled={!canEditInfo}+ />+ </label>++ <div className="group-info-field">+ <span>{t('chats.group.picture')}</span>+ <button+ type="button"+ className="group-info-picture"+ onClick={() => fileInputRef.current?.click()}+ disabled={!canEditInfo}+ >+ {newPicture ? (+ <span className="chat-avatar avatar-lg">+ <img src={newPicture.preview} alt="" />+ </span>+ ) : (+ <ChatAvatar pictureUrl={picture.data} kind="group" size="lg" onImageError={() => picture.refetch()} />+ )}+ <span>{canEditInfo ? t('chats.group.pictureHint') : t('chats.group.readOnlyHint')}</span>+ </button>+ <input+ ref={fileInputRef}+ type="file"+ accept="image/jpeg,image/png,image/webp"+ aria-label={t('chats.group.picture')}+ hidden+ onChange={e => {+ pickPicture(e.target.files?.[0]);+ e.target.value = '';+ }}+ />+ </div>++ <label className="group-info-field">+ <span>{t('chats.group.description')}</span>+ <textarea+ value={description}+ maxLength={GROUP_DESCRIPTION_MAX_LENGTH}+ placeholder={t('chats.group.descriptionPlaceholder')}+ onChange={e => setDescription(e.target.value)}+ disabled={!canEditInfo}+ rows={5}+ />+ </label>+ </div>+ ) : (+ <div className="group-info-members">+ {canManageMembers && (+ <form+ className="group-info-add"+ onSubmit={e => {+ e.preventDefault();+ if (newMember.replace(/\D/g, '').length >= 7) void addMember();+ }}+ >+ <input+ type="tel"+ value={newMember}+ onChange={e => setNewMember(e.target.value)}+ placeholder={t('chats.group.addPlaceholder')}+ aria-label={t('chats.group.addPlaceholder')}+ />+ <button+ type="submit"+ className="btn-primary"+ disabled={newMember.replace(/\D/g, '').length < 7 || pending !== null}+ >+ {pending === 'add' ? <Loader2 className="animate-spin" size={16} /> : <UserPlus size={16} />}+ {t('chats.group.add')}+ </button>+ </form>+ )}+ <div className="group-info-count">+ {t('chats.group.participantCount', { count: info.participants.length })}+ </div>+ <ul className="group-info-list">+ {info.participants.map(p => {+ const own = isOwnAccount(p, session);+ const label = own ? t('chats.you') : p.name || formatPhoneForDisplay(p.number) || p.number;+ return (+ <li key={p.id}>+ <ChatAvatar kind="individual" />+ <span className="group-info-member">+ <bdi className="name">{label}</bdi>+ {p.name && (+ <bdi className="number" dir="ltr">+ {formatPhoneForDisplay(p.number) ?? p.number}+ </bdi>+ )}+ </span>+ {(p.isSuperAdmin || p.isAdmin) && (+ <span className="group-info-role">+ {p.isSuperAdmin && <Crown size={12} />}+ {p.isSuperAdmin ? t('chats.group.owner') : t('chats.group.admin')}+ </span>+ )}+ {canManageMembers && !own && !p.isSuperAdmin && (+ <span className="group-info-actions">+ <button+ type="button"+ className="icon-btn small"+ disabled={pending !== null}+ onClick={() =>+ void runMemberAction(p.id, () =>+ sessionApi.setGroupAdmins(session.id, group.id, [p.id], !p.isAdmin),+ )+ }+ title={p.isAdmin ? t('chats.group.removeAdmin') : t('chats.group.makeAdmin')}+ aria-label={`${p.isAdmin ? t('chats.group.removeAdmin') : t('chats.group.makeAdmin')}: ${label}`}+ >+ {p.isAdmin ? <ShieldOff size={16} /> : <ShieldCheck size={16} />}+ </button>+ <button+ type="button"+ className="icon-btn small danger"+ disabled={pending !== null}+ onClick={() => {+ if (!window.confirm(t('chats.group.removeConfirm', { name: label }))) return;+ void runMemberAction(p.id, () =>+ sessionApi.removeGroupParticipants(session.id, group.id, [p.id]),+ );+ }}+ title={t('chats.group.remove')}+ aria-label={`${t('chats.group.remove')}: ${label}`}+ >+ {pending === p.id ? <Loader2 className="animate-spin" size={16} /> : <UserMinus size={16} />}+ </button>+ </span>+ )}+ </li>+ );+ })}+ </ul>+ </div>+ )}+ </Modal>+ );+}++export default GroupInfoDialog;diff --git a/dashboard/src/components/chats/KindIcon.tsx b/dashboard/src/components/chats/KindIcon.tsxindex a39e2c323..759e2489c 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 }: { kind: ChatKind }) {- if (kind === 'group' || kind === 'broadcast') return <Users size={20} />;- if (kind === 'channel') return <Megaphone size={20} />;- if (kind === 'status') return <CircleDashed size={20} />;- return <User size={20} />;+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} />;}export default KindIcon;diff --git a/dashboard/src/components/chats/NewChatPanel.tsx b/dashboard/src/components/chats/NewChatPanel.tsxnew file mode 100644index 000000000..0de73a9e5--- /dev/null+++ b/dashboard/src/components/chats/NewChatPanel.tsx@@ -0,0 +1,363 @@+import { useEffect, useMemo, useRef, useState } from 'react';+import { useQuery } from '@tanstack/react-query';+import { useTranslation } from 'react-i18next';+import { ArrowLeft, Check, Loader2, Phone, Search, Users, X } from 'lucide-react';+import { contactApi, sessionApi, type Chat, type Contact } from '../../services/api';+import { formatPhoneForDisplay } from '../../utils/formatPhone';+import { useRole } from '../../hooks/useRole';+import { useToast } from '../../hooks/useToast';+import ChatAvatar from './ChatAvatar';++type Mode = 'chat' | 'group';++interface Participant {+ id: string;+ label: string;+}++interface NewChatPanelProps {+ sessionId: string;+ /**+ * Opens the chat in the room pane, adding it to the list when it has no history yet. Handed the session+ * the chat was found through, for the page to check it is still the one selected.+ */+ onOpenChat: (chat: Chat, sessionId: string) => void;+ onClose: () => void;+}++// The gateway caps a group subject at 100 characters (CreateGroupDto).+const GROUP_NAME_MAX_LENGTH = 100;++/**+ * Digits of a number typed with its country code, or null. The engine resolves digits as they are, so+ * a national "0170…" would silently reach a different country; only "+49…", "0049…" or bare+ * international digits are taken. 7–15 digits covers E.164.+ */+const toInternationalDigits = (input: string): string | null => {+ const trimmed = input.trim();+ if (!trimmed || /[a-z]/i.test(trimmed)) return null;+ let digits = trimmed.replace(/\D/g, '');+ if (digits.startsWith('00')) digits = digits.slice(2);+ else if (!trimmed.startsWith('+') && digits.startsWith('0')) return null;+ return digits.length >= 7 && digits.length <= 15 ? digits : null;+};++const contactLabel = (c: Contact): string => c.name || c.pushName || formatPhoneForDisplay(c.id) || c.number;++// A chat row for a conversation the engine may not list yet (no history). The first message, or the+// next chat-list load, replaces it with the engine's own row.+const draftChat = (id: string, name: string, kind: Chat['kind'], timestamp = 0): Chat => ({+ id,+ name,+ isGroup: kind === 'group',+ kind,+ unreadCount: 0,+ timestamp,+ archived: false,+ pinned: false,+ muted: false,+});++/**+ * Sidebar sub-view for starting a 1:1 chat or creating a group. The page mounts it only for a key that+ * can write; group creation is offered on Baileys only, since whatsapp-web.js answers it with 501.+ */+function NewChatPanel({ sessionId, onOpenChat, onClose }: NewChatPanelProps) {+ const { t } = useTranslation();+ const { error: showErrorToast, success: showSuccessToast } = useToast();+ const { engineType } = useRole();+ const groupsSupported = engineType === 'baileys';++ const [mode, setMode] = useState<Mode>('chat');+ const [query, setQuery] = useState('');+ const [checking, setChecking] = useState(false);+ const [groupName, setGroupName] = useState('');+ const [participants, setParticipants] = useState<Participant[]>([]);+ const [creating, setCreating] = useState(false);+ // A lookup or a group creation can answer after the panel was closed (Back, or a session switch, which+ // unmounts it). Its result then belongs to nothing on screen and is dropped.+ const openRef = useRef(true);+ useEffect(+ () => () => {+ openRef.current = false;+ },+ [],+ );++ const contactsQuery = useQuery({+ queryKey: ['contacts', sessionId],+ queryFn: () => contactApi.list(sessionId),+ enabled: Boolean(sessionId),+ staleTime: 5 * 60 * 1000,+ // contactApi.list already retried a throttled page; another attempt would walk every page again.+ retry: false,+ });++ // Saved, unblocked personal contacts, alphabetically. The address book also lists groups and+ // broadcast lists, which can be neither a 1:1 chat nor a group participant.+ const contacts = useMemo(+ () =>+ (contactsQuery.data ?? [])+ .filter(c => c.isMyContact && !c.isBlocked && !c.id.endsWith('@g.us') && !c.id.endsWith('@broadcast'))+ .sort((a, b) => contactLabel(a).localeCompare(contactLabel(b))),+ [contactsQuery.data],+ );++ const normalizedQuery = query.trim().toLowerCase();+ const queryDigits = query.replace(/\D/g, '');+ const visibleContacts = normalizedQuery+ ? contacts.filter(+ c =>+ contactLabel(c).toLowerCase().includes(normalizedQuery) ||+ (queryDigits.length > 0 && c.number.includes(queryDigits)),+ )+ : contacts;++ const typedNumber = toInternationalDigits(query);+ const typedNumberLabel = typedNumber ? (formatPhoneForDisplay(typedNumber) ?? `+${typedNumber}`) : '';+ const showNumberHint = Boolean(query.trim()) && !typedNumber && /^[\d\s+()-]+$/.test(query.trim());++ // Resolve a typed number to its canonical WhatsApp id. The send routes accept an unregistered number+ // without an error, so this check is the only thing that keeps a chat from going nowhere. An answer+ // that arrives after the panel was closed is dropped, toasts included: nothing on screen asked for it.+ const resolveNumber = async (digits: string, label: string): Promise<string | null> => {+ setChecking(true);+ try {+ const res = await contactApi.checkNumber(sessionId, digits);+ if (!openRef.current) return null;+ if (!res.exists || !res.whatsappId) {+ showErrorToast(t('chats.newChat.notOnWhatsApp', { number: label }));+ return null;+ }+ return res.whatsappId;+ } catch (err) {+ if (openRef.current) {+ showErrorToast(t('chats.newChat.checkFailed'), err instanceof Error ? err.message : undefined);+ }+ return null;+ } finally {+ if (openRef.current) setChecking(false);+ }+ };++ const handleStartWithNumber = async () => {+ if (!typedNumber) return;+ const id = await resolveNumber(typedNumber, typedNumberLabel);+ if (id && openRef.current) onOpenChat(draftChat(id, '', 'individual'), sessionId);+ };++ const toggleParticipant = (p: Participant) => {+ setParticipants(prev => (prev.some(x => x.id === p.id) ? prev.filter(x => x.id !== p.id) : [...prev, p]));+ };++ const handleAddNumber = async () => {+ if (!typedNumber) return;+ const id = await resolveNumber(typedNumber, typedNumberLabel);+ if (!id || !openRef.current) return;+ setParticipants(prev => (prev.some(x => x.id === id) ? prev : [...prev, { id, label: typedNumberLabel }]));+ setQuery('');+ };++ // The group exists once the route answers, so its success is reported even if the panel was closed+ // meanwhile; only opening it is skipped then, as the session on screen may be another one.+ const handleCreateGroup = async () => {+ const name = groupName.trim();+ if (!name || participants.length === 0 || creating) return;+ setCreating(true);+ try {+ const group = await sessionApi.createGroup(+ sessionId,+ name,+ participants.map(p => p.id),+ );+ showSuccessToast(t('chats.newGroup.created', { name }));+ if (openRef.current) {+ onOpenChat(draftChat(group.id, group.name || name, 'group', Math.floor(Date.now() / 1000)), sessionId);+ }+ } catch (err) {+ showErrorToast(t('chats.newGroup.createFailed'), err instanceof Error ? err.message : undefined);+ } finally {+ if (openRef.current) setCreating(false);+ }+ };++ const switchMode = (next: Mode) => {+ setMode(next);+ setQuery('');+ };++ const isGroupMode = mode === 'group';+ const submitTypedNumber = () => void (isGroupMode ? handleAddNumber() : handleStartWithNumber());++ return (+ <div className="new-chat-panel">+ <header className="new-chat-header">+ <button+ type="button"+ className="icon-btn"+ onClick={() => (isGroupMode ? switchMode('chat') : onClose())}+ aria-label={t('common.back')}+ title={t('common.back')}+ >+ <ArrowLeft size={20} />+ </button>+ <span>{isGroupMode ? t('chats.newGroup.title') : t('chats.newChat.title')}</span>+ </header>++ {isGroupMode && (+ <div className="new-group-fields">+ <input+ type="text"+ className="new-group-name"+ placeholder={t('chats.newGroup.namePlaceholder')}+ aria-label={t('chats.newGroup.namePlaceholder')}+ value={groupName}+ maxLength={GROUP_NAME_MAX_LENGTH}+ onChange={e => setGroupName(e.target.value)}+ autoFocus+ />+ {participants.length > 0 && (+ <div className="participant-chips">+ {participants.map(p => (+ <span key={p.id} className="participant-chip">+ <bdi>{p.label}</bdi>+ <button+ type="button"+ onClick={() => toggleParticipant(p)}+ aria-label={t('chats.newGroup.removeParticipant', { name: p.label })}+ >+ <X size={14} />+ </button>+ </span>+ ))}+ </div>+ )}+ </div>+ )}++ <div className="chat-search-input new-chat-search">+ <Search size={18} />+ <input+ type="text"+ placeholder={isGroupMode ? t('chats.newGroup.participantsPlaceholder') : t('chats.newChat.searchPlaceholder')}+ aria-label={isGroupMode ? t('chats.newGroup.participantsPlaceholder') : t('chats.newChat.searchPlaceholder')}+ value={query}+ onChange={e => setQuery(e.target.value)}+ onKeyDown={e => {+ if (e.key === 'Enter' && typedNumber && !checking) {+ e.preventDefault();+ submitTypedNumber();+ }+ }}+ autoFocus={!isGroupMode}+ />+ {query && (+ <button+ type="button"+ className="search-clear"+ onClick={() => setQuery('')}+ aria-label={t('chats.clearSearch')}+ title={t('chats.clearSearch')}+ >+ <X size={16} />+ </button>+ )}+ </div>+ {showNumberHint && <p className="new-chat-hint">{t('chats.newChat.numberHint')}</p>}++ <div className="chats-list new-chat-list">+ {!isGroupMode && groupsSupported && !normalizedQuery && (+ <button type="button" className="chat-item-card action-row" onClick={() => switchMode('group')}>+ <span className="chat-avatar avatar-md action-avatar">+ <Users size={22} />+ </span>+ <span className="chat-item-name">{t('chats.newGroup.title')}</span>+ </button>+ )}++ {typedNumber && (+ <button type="button" className="chat-item-card action-row" disabled={checking} onClick={submitTypedNumber}>+ <span className="chat-avatar avatar-md action-avatar">+ {checking ? <Loader2 className="animate-spin" size={22} /> : <Phone size={22} />}+ </span>+ <span className="chat-item-name">+ {checking+ ? t('chats.newChat.checking')+ : isGroupMode+ ? t('chats.newGroup.addNumber', { number: typedNumberLabel })+ : t('chats.newChat.startWithNumber', { number: typedNumberLabel })}+ </span>+ </button>+ )}++ <div className="new-chat-section-label">{t('chats.newChat.contacts')}</div>++ {contactsQuery.isLoading ? (+ <div className="chats-list-loading">+ <Loader2 className="animate-spin" size={24} />+ <span>{t('chats.newChat.loadingContacts')}</span>+ </div>+ ) : contactsQuery.isError ? (+ <div className="chats-list-empty">+ <span>{t('chats.newChat.contactsError')}</span>+ </div>+ ) : visibleContacts.length === 0 ? (+ <div className="chats-list-empty">+ <span>{t('chats.newChat.noContacts')}</span>+ </div>+ ) : (+ visibleContacts.map(c => {+ const label = contactLabel(c);+ const selected = participants.some(p => p.id === c.id);+ const phone = formatPhoneForDisplay(c.id) ?? c.number;+ return (+ <button+ type="button"+ key={c.id}+ className={`chat-item-card ${selected ? 'active' : ''}`}+ aria-pressed={isGroupMode ? selected : undefined}+ onClick={() =>+ isGroupMode+ ? toggleParticipant({ id: c.id, label })+ : onOpenChat(draftChat(c.id, c.name || '', 'individual'), sessionId)+ }+ >+ <ChatAvatar kind="individual" />+ <span className="chat-item-info">+ <span className="chat-item-name">{label}</span>+ {phone && phone !== label && (+ <span className="chat-item-snippet">+ <bdi dir="ltr">{phone}</bdi>+ </span>+ )}+ </span>+ {isGroupMode && (+ <span className={`select-check ${selected ? 'checked' : ''}`} aria-hidden="true">+ {selected && <Check size={14} strokeWidth={3} />}+ </span>+ )}+ </button>+ );+ })+ )}+ </div>++ {isGroupMode && (+ <footer className="new-group-footer">+ <span className="new-group-count">{t('chats.newGroup.selected', { count: participants.length })}</span>+ <button+ type="button"+ className="new-group-create"+ disabled={!groupName.trim() || participants.length === 0 || creating}+ onClick={() => void handleCreateGroup()}+ >+ {creating ? <Loader2 className="animate-spin" size={18} /> : <Check size={18} />}+ {t('chats.newGroup.create')}+ </button>+ </footer>+ )}+ </div>+ );+}++export default NewChatPanel;diff --git a/dashboard/src/components/chats/chatActionItems.tsx b/dashboard/src/components/chats/chatActionItems.tsxnew file mode 100644index 000000000..0be069ff7--- /dev/null+++ b/dashboard/src/components/chats/chatActionItems.tsx@@ -0,0 +1,120 @@+import type { ReactNode } from 'react';+import {+ Archive,+ ArchiveRestore,+ Ban,+ Bell,+ BellOff,+ Eraser,+ Info,+ LogOut,+ Mail,+ Pin,+ PinOff,+ ShieldCheck,+ Trash2,+ 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. */+export interface ChatRowActions {+ onGroupInfo: (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;+ /** Whether the address book holds the chat's contact as saved, which turns Save into Rename. */+ isSavedContact?: (chat: Chat) => boolean;+ onTogglePin?: (chat: Chat) => void;+ /** Opens the mute dialog for a chat that is not muted, and unmutes one that is. */+ onMute?: (chat: Chat) => void;+ onToggleArchive?: (chat: Chat) => void;+ onMarkUnread?: (chat: Chat) => void;+ onLeaveGroup?: (chat: Chat) => void;+ /** Blocks a contact the blocklist does not hold, and unblocks one it does. */+ onToggleBlock?: (chat: Chat) => void;+ onClear?: (chat: Chat) => void;+ onDelete?: (chat: Chat) => void;+ /** Whether the session's blocklist holds this chat's contact. */+ isBlocked?: (chat: Chat) => boolean;+}++export interface ChatActionItem {+ key: string;+ icon: ReactNode;+ label: string;+ run: (chat: Chat) => void;+ /** Starts the destructive part of the list, after a divider. */+ separated?: boolean;+ /** Shown but not offered, with the reason in `hint`. */+ disabled?: boolean;+ hint?: string;+}++/**+ * The actions a chat offers, in WhatsApp's order: what it is, how it sits in the list, then what cannot+ * be taken back. Group chats get their group actions, 1:1 chats their contact ones; an action whose+ * handler is absent (a read-only key) is left out.+ */+export function chatActionItems(chat: Chat, actions: ChatRowActions, t: (key: string) => string): ChatActionItem[] {+ const group = chat.kind === 'group';+ const direct = chat.kind === 'individual';+ const items: ChatActionItem[] = [];+ const add = (handler: ((chat: Chat) => void) | undefined, item: Omit<ChatActionItem, 'run'>) => {+ if (handler) items.push({ ...item, run: handler });+ };++ if (group) add(actions.onGroupInfo, { key: 'info', icon: <Info size={18} />, label: t('chats.group.info') });+ if (direct) {+ const addressable = actions.canSaveContact?.(chat) ?? true;+ add(actions.onSaveContact, {+ key: 'save',+ icon: <UserPen size={18} />,+ label: actions.isSavedContact?.(chat) ? t('chats.rowActions.renameContact') : t('chats.rowActions.saveContact'),+ ...(addressable ? {} : { disabled: true, hint: t('chats.rowActions.saveContactUnavailable') }),+ });+ }+ add(actions.onTogglePin, {+ key: 'pin',+ icon: chat.pinned ? <PinOff size={18} /> : <Pin size={18} />,+ label: chat.pinned ? t('chats.rowActions.unpin') : t('chats.rowActions.pin'),+ });+ add(actions.onMute, {+ key: 'mute',+ icon: chat.muted ? <Bell size={18} /> : <BellOff size={18} />,+ label: chat.muted ? t('chats.rowActions.unmute') : t('chats.rowActions.mute'),+ });+ add(actions.onToggleArchive, {+ key: 'archive',+ icon: chat.archived ? <ArchiveRestore size={18} /> : <Archive size={18} />,+ label: chat.archived ? t('chats.rowActions.unarchive') : t('chats.rowActions.archive'),+ });+ // A chat already unread has nothing to mark.+ if (chat.unreadCount === 0) {+ add(actions.onMarkUnread, { key: 'unread', icon: <Mail size={18} />, label: t('chats.rowActions.markUnread') });+ }++ const destructive: ChatActionItem[] = [];+ const addDestructive = (handler: ((chat: Chat) => void) | undefined, item: Omit<ChatActionItem, 'run'>) => {+ if (handler) destructive.push({ ...item, run: handler });+ };+ if (group) {+ addDestructive(actions.onLeaveGroup, { key: 'leave', icon: <LogOut size={18} />, label: t('chats.group.leave') });+ }+ if (direct) {+ const blocked = actions.isBlocked?.(chat) ?? false;+ addDestructive(actions.onToggleBlock, {+ key: 'block',+ icon: blocked ? <ShieldCheck size={18} /> : <Ban size={18} />,+ label: blocked ? t('chats.rowActions.unblock') : t('chats.rowActions.block'),+ });+ addDestructive(actions.onClear, { key: 'clear', icon: <Eraser size={18} />, label: t('chats.rowActions.clear') });+ addDestructive(actions.onDelete, {+ key: 'delete',+ icon: <Trash2 size={18} />,+ label: t('chats.rowActions.delete'),+ });+ }+ if (destructive.length > 0) destructive[0].separated = true;+ return [...items, ...destructive];+}diff --git a/dashboard/src/i18n/locales/ar.json b/dashboard/src/i18n/locales/ar.jsonindex fdec25c93..c710356c0 100644--- a/dashboard/src/i18n/locales/ar.json+++ b/dashboard/src/i18n/locales/ar.json@@ -222,6 +222,133 @@"delivered": "تم التسليم","read": "تمت القراءة","failed": "فشل"+ },+ "clearSearch": "مسح البحث",+ "filters": {+ "label": "تصفية المحادثات",+ "all": "الكل",+ "unread": "غير مقروءة",+ "direct": "محادثات فردية",+ "groups": "المجموعات",+ "unknown": "غير معروف"+ },+ "noFilterResults": "لا توجد محادثات مطابقة لهذا الفلتر",+ "moreActions": "إجراءات إضافية",+ "copyChatId": "نسخ معرّف المحادثة",+ "chatIdCopied": "تم نسخ معرّف المحادثة",+ "copyFailed": "تعذّر النسخ إلى الحافظة",+ "closeChat": "إغلاق المحادثة",+ "chatId": "معرّف المحادثة",+ "newChat": {+ "title": "محادثة جديدة",+ "searchPlaceholder": "ابحث بالاسم أو الرقم مع رمز الدولة",+ "startWithNumber": "بدء محادثة مع {{number}}",+ "contacts": "جهات الاتصال",+ "noContacts": "لم يتم العثور على جهات اتصال",+ "loadingContacts": "جارٍ تحميل جهات الاتصال...",+ "contactsError": "تعذّر تحميل جهات الاتصال",+ "checking": "جارٍ التحقق من الرقم...",+ "notOnWhatsApp": "{{number}} غير مسجّل في واتساب",+ "checkFailed": "تعذّر التحقق من الرقم",+ "numberHint": "يرجى إدخال الأرقام مع رمز الدولة، مثل +966 50 123 4567"+ },+ "newGroup": {+ "title": "مجموعة جديدة",+ "namePlaceholder": "اسم المجموعة",+ "participantsPlaceholder": "ابحث عن مشاركين أو أدخل رقمًا",+ "addNumber": "إضافة {{number}}",+ "selected": "تم تحديد {{count}}",+ "create": "إنشاء المجموعة",+ "created": "تم إنشاء المجموعة \"{{name}}\"",+ "createFailed": "تعذّر إنشاء المجموعة",+ "removeParticipant": "إزالة {{name}}"+ },+ "group": {+ "info": "معلومات المجموعة",+ "leave": "مغادرة المجموعة",+ "leaveConfirm": "مغادرة المجموعة \"{{name}}\"؟",+ "left": "تمت مغادرة \"{{name}}\"",+ "leaveFailed": "تعذّرت مغادرة المجموعة",+ "editTitle": "تعديل المجموعة",+ "tabInfo": "معلومات",+ "tabParticipants": "المشاركون",+ "managedBy": "الإدارة عبر {{session}}",+ "notAdmin": "ليس مشرفًا عبر {{session}}",+ "name": "اسم المجموعة",+ "picture": "صورة المجموعة",+ "pictureHint": "انقر على هذا الحقل لاختيار صورة جديدة للمجموعة.",+ "readOnlyHint": "يمكن لمشرفي المجموعة فقط تعديلها.",+ "description": "الوصف",+ "descriptionPlaceholder": "وصف المجموعة (اختياري)",+ "save": "حفظ التغييرات",+ "saved": "تم تحديث المجموعة",+ "saveFailed": "تعذّر حفظ المجموعة",+ "loadFailed": "تعذّر تحميل معلومات المجموعة",+ "participantCount": "المشاركون: {{count}}",+ "admin": "مشرف",+ "owner": "المنشئ",+ "makeAdmin": "تعيين كمشرف",+ "removeAdmin": "إزالة الإشراف",+ "remove": "إزالة",+ "removeConfirm": "إزالة {{name}} من المجموعة؟",+ "add": "إضافة",+ "addPlaceholder": "أضف رقمًا مع رمز الدولة",+ "memberActionFailed": "فشل الإجراء",+ "leaveWarning": "لن تتلقى رسائلها بعد ذلك، ولا يمكن إعادة إضافتك إلا بواسطة مشرف المجموعة."+ },+ "rowActions": {+ "actionsFor": "إجراءات {{name}}",+ "markUnread": "تعليم كغير مقروءة",+ "markUnreadFailed": "تعذّر تعليم المحادثة كغير مقروءة",+ "clear": "مسح المحادثة",+ "clearConfirm": "حذف كل الرسائل في المحادثة مع {{name}}؟",+ "clearWarning": "تبقى المحادثة في القائمة، ويحذف البوابة أيضًا نسخته المخزنة من الرسائل بما فيها الوسائط؛ صدّر السجل أولًا إن كنت تحتاجه.",+ "cleared": "تم مسح المحادثة مع {{name}}",+ "clearFailed": "تعذّر مسح المحادثة",+ "delete": "حذف المحادثة",+ "deleteConfirm": "حذف المحادثة مع {{name}}؟",+ "deleteWarning": "تختفي المحادثة من القائمة، ويحذف البوابة نسخته المخزنة من الرسائل بما فيها الوسائط.",+ "deleted": "تم حذف المحادثة مع {{name}}",+ "deleteFailed": "تعذّر حذف المحادثة",+ "saveContact": "حفظ جهة الاتصال",+ "renameContact": "إعادة تسمية جهة الاتصال",+ "firstName": "الاسم الأول",+ "lastName": "اسم العائلة (اختياري)",+ "contactSaved": "تم حفظ جهة الاتصال",+ "contactSaveFailed": "تعذّر حفظ جهة الاتصال",+ "pin": "تثبيت المحادثة",+ "unpin": "إلغاء تثبيت المحادثة",+ "pinFailed": "تعذّر تثبيت المحادثة. يسمح واتساب بتثبيت ثلاث محادثات كحد أقصى.",+ "unpinFailed": "تعذّر إلغاء تثبيت المحادثة",+ "pinnedLabel": "مثبّتة",+ "mute": "كتم الإشعارات",+ "unmute": "إلغاء كتم الإشعارات",+ "mutedLabel": "مكتومة",+ "muteTitle": "كتم \"{{name}}\"",+ "muteHint": "لن يعرف المشاركون الآخرون أنك كتمت المحادثة. ستظل تتلقى إشعارًا عند الإشارة إليك.",+ "muteFailed": "تعذّر تغيير الإشعارات",+ "archive": "أرشفة المحادثة",+ "unarchive": "إلغاء أرشفة المحادثة",+ "archived": "تمت أرشفة المحادثة",+ "unarchived": "تم إلغاء أرشفة المحادثة",+ "archiveFailed": "تعذّر تغيير الأرشيف",+ "archivedEntry": "مؤرشفة",+ "archivedTitle": "المحادثات المؤرشفة",+ "archiveEmpty": "لا توجد محادثات مؤرشفة",+ "declined": "رفض واتساب التغيير.",+ "block": "حظر جهة الاتصال",+ "unblock": "إلغاء حظر جهة الاتصال",+ "blockConfirm": "حظر {{name}}؟",+ "blockWarning": "لن تتمكن جهات الاتصال المحظورة من الاتصال بك أو مراسلتك.",+ "blocked": "تم حظر {{name}}",+ "unblocked": "تم إلغاء حظر {{name}}",+ "blockFailed": "تعذّر تغيير الحظر",+ "muteFor": {+ "8h": "8 ساعات",+ "1w": "أسبوع واحد",+ "always": "دائمًا"+ },+ "saveContactUnavailable": "يتطلب رقم هاتف معروفًا: لهذه المحادثة معرّف خصوصية فقط (@lid)."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/de.json b/dashboard/src/i18n/locales/de.jsonindex 7fa05b042..9c4bc5e5e 100644--- a/dashboard/src/i18n/locales/de.json+++ b/dashboard/src/i18n/locales/de.json@@ -201,6 +201,133 @@"delivered": "Zugestellt","read": "Gelesen","failed": "Fehlgeschlagen"+ },+ "clearSearch": "Suche leeren",+ "filters": {+ "label": "Chats filtern",+ "all": "Alle",+ "unread": "Ungelesen",+ "direct": "1:1-Chats",+ "groups": "Gruppen",+ "unknown": "Unbekannt"+ },+ "noFilterResults": "Keine Chats für diesen Filter",+ "moreActions": "Weitere Aktionen",+ "copyChatId": "Chat-ID kopieren",+ "chatIdCopied": "Chat-ID kopiert",+ "copyFailed": "Kopieren in die Zwischenablage fehlgeschlagen",+ "closeChat": "Chat schließen",+ "chatId": "Chat-ID",+ "newChat": {+ "title": "Neuer Chat",+ "searchPlaceholder": "Name oder Nummer mit Ländervorwahl",+ "startWithNumber": "Chat mit {{number}} starten",+ "contacts": "Kontakte",+ "noContacts": "Keine Kontakte gefunden",+ "loadingContacts": "Kontakte werden geladen...",+ "contactsError": "Kontakte konnten nicht geladen werden",+ "checking": "Nummer wird geprüft...",+ "notOnWhatsApp": "{{number}} ist nicht bei WhatsApp registriert",+ "checkFailed": "Nummer konnte nicht geprüft werden",+ "numberHint": "Bitte Nummern mit Ländervorwahl eingeben, z. B. +49 170 1234567"+ },+ "newGroup": {+ "title": "Neue Gruppe",+ "namePlaceholder": "Gruppenname",+ "participantsPlaceholder": "Teilnehmer suchen oder Nummer eingeben",+ "addNumber": "{{number}} hinzufügen",+ "selected": "{{count}} ausgewählt",+ "create": "Gruppe erstellen",+ "created": "Gruppe „{{name}}“ erstellt",+ "createFailed": "Gruppe konnte nicht erstellt werden",+ "removeParticipant": "{{name}} entfernen"+ },+ "group": {+ "info": "Gruppeninfo",+ "leave": "Gruppe verlassen",+ "leaveConfirm": "Die Gruppe „{{name}}“ verlassen?",+ "left": "„{{name}}“ verlassen",+ "leaveFailed": "Gruppe konnte nicht verlassen werden",+ "editTitle": "Gruppe bearbeiten",+ "tabInfo": "Info",+ "tabParticipants": "Teilnehmer",+ "managedBy": "Verwaltung über {{session}}",+ "notAdmin": "Kein Admin über {{session}}",+ "name": "Gruppenname",+ "picture": "Gruppenbild",+ "pictureHint": "Klicke auf dieses Feld, um ein neues Gruppenbild auszuwählen.",+ "readOnlyHint": "Nur Gruppen-Admins können diese Gruppe ändern.",+ "description": "Beschreibung",+ "descriptionPlaceholder": "Gruppenbeschreibung (optional)",+ "save": "Änderungen speichern",+ "saved": "Gruppe aktualisiert",+ "saveFailed": "Gruppe konnte nicht gespeichert werden",+ "loadFailed": "Gruppeninfo konnte nicht geladen werden",+ "participantCount": "Teilnehmer: {{count}}",+ "admin": "Admin",+ "owner": "Ersteller",+ "makeAdmin": "Zum Admin machen",+ "removeAdmin": "Admin entfernen",+ "remove": "Entfernen",+ "removeConfirm": "{{name}} aus der Gruppe entfernen?",+ "add": "Hinzufügen",+ "addPlaceholder": "Nummer mit Ländervorwahl hinzufügen",+ "memberActionFailed": "Die Aktion ist fehlgeschlagen",+ "leaveWarning": "Du erhältst danach keine Nachrichten mehr aus der Gruppe, und nur ein Gruppen-Admin kann dich wieder hinzufügen."+ },+ "rowActions": {+ "actionsFor": "Aktionen für {{name}}",+ "markUnread": "Als ungelesen markieren",+ "markUnreadFailed": "Chat konnte nicht als ungelesen markiert werden",+ "clear": "Chat leeren",+ "clearConfirm": "Alle Nachrichten im Chat mit {{name}} löschen?",+ "clearWarning": "Der Chat bleibt in der Liste. Das Gateway löscht auch seine gespeicherten Nachrichten samt Medien; exportiere den Verlauf vorher, wenn du ihn brauchst.",+ "cleared": "Chat mit {{name}} geleert",+ "clearFailed": "Chat konnte nicht geleert werden",+ "delete": "Chat löschen",+ "deleteConfirm": "Den Chat mit {{name}} löschen?",+ "deleteWarning": "Der Chat verschwindet aus der Liste, und das Gateway löscht seine gespeicherten Nachrichten samt Medien.",+ "deleted": "Chat mit {{name}} gelöscht",+ "deleteFailed": "Chat konnte nicht gelöscht werden",+ "saveContact": "Kontakt speichern",+ "renameContact": "Kontakt umbenennen",+ "firstName": "Vorname",+ "lastName": "Nachname (optional)",+ "contactSaved": "Kontakt gespeichert",+ "contactSaveFailed": "Kontakt konnte nicht gespeichert werden",+ "pin": "Chat anheften",+ "unpin": "Chat lösen",+ "pinFailed": "Chat konnte nicht angeheftet werden. WhatsApp erlaubt höchstens drei angeheftete Chats.",+ "unpinFailed": "Chat konnte nicht gelöst werden",+ "pinnedLabel": "Angeheftet",+ "mute": "Stummschalten",+ "unmute": "Stummschaltung aufheben",+ "mutedLabel": "Stummgeschaltet",+ "muteTitle": "„{{name}}“ stummschalten",+ "muteHint": "Die anderen Teilnehmer erfahren nicht, dass du den Chat stummgeschaltet hast. Wirst du erwähnt, wirst du trotzdem benachrichtigt.",+ "muteFailed": "Benachrichtigungen konnten nicht geändert werden",+ "archive": "Chat archivieren",+ "unarchive": "Chat aus dem Archiv holen",+ "archived": "Chat archiviert",+ "unarchived": "Chat aus dem Archiv geholt",+ "archiveFailed": "Archiv konnte nicht geändert werden",+ "archivedEntry": "Archiviert",+ "archivedTitle": "Archivierte Chats",+ "archiveEmpty": "Keine archivierten Chats",+ "declined": "WhatsApp hat die Änderung abgelehnt.",+ "block": "Kontakt blockieren",+ "unblock": "Kontakt entsperren",+ "blockConfirm": "{{name}} blockieren?",+ "blockWarning": "Blockierte Kontakte können dich nicht mehr anrufen und dir keine Nachrichten mehr senden.",+ "blocked": "{{name}} blockiert",+ "unblocked": "{{name}} entsperrt",+ "blockFailed": "Blockierung konnte nicht geändert werden",+ "muteFor": {+ "8h": "8 Stunden",+ "1w": "1 Woche",+ "always": "Immer"+ },+ "saveContactUnavailable": "Braucht eine bekannte Telefonnummer: Dieser Chat hat nur eine Datenschutz-ID (@lid)."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/en.json b/dashboard/src/i18n/locales/en.jsonindex a55206957..87ffdd660 100644--- a/dashboard/src/i18n/locales/en.json+++ b/dashboard/src/i18n/locales/en.json@@ -201,6 +201,133 @@"delivered": "Delivered","read": "Read","failed": "Failed"+ },+ "clearSearch": "Clear search",+ "filters": {+ "label": "Filter chats",+ "all": "All",+ "unread": "Unread",+ "direct": "1:1 chats",+ "groups": "Groups",+ "unknown": "Unknown"+ },+ "noFilterResults": "No chats match this filter",+ "moreActions": "More actions",+ "copyChatId": "Copy chat ID",+ "chatIdCopied": "Chat ID copied",+ "copyFailed": "Could not copy to clipboard",+ "closeChat": "Close chat",+ "chatId": "Chat ID",+ "newChat": {+ "title": "New chat",+ "searchPlaceholder": "Search name or number with country code",+ "startWithNumber": "Start chat with {{number}}",+ "contacts": "Contacts",+ "noContacts": "No contacts found",+ "loadingContacts": "Loading contacts...",+ "contactsError": "Could not load contacts",+ "checking": "Checking number...",+ "notOnWhatsApp": "{{number}} is not registered on WhatsApp",+ "checkFailed": "Could not check the number",+ "numberHint": "Please enter numbers with the country code, e.g. +49 170 1234567"+ },+ "newGroup": {+ "title": "New group",+ "namePlaceholder": "Group name",+ "participantsPlaceholder": "Search participants or enter a number",+ "addNumber": "Add {{number}}",+ "selected": "{{count}} selected",+ "create": "Create group",+ "created": "Group \"{{name}}\" created",+ "createFailed": "Could not create the group",+ "removeParticipant": "Remove {{name}}"+ },+ "group": {+ "info": "Group info",+ "leave": "Leave group",+ "leaveConfirm": "Leave the group \"{{name}}\"?",+ "left": "Left \"{{name}}\"",+ "leaveFailed": "Could not leave the group",+ "editTitle": "Edit group",+ "tabInfo": "Info",+ "tabParticipants": "Participants",+ "managedBy": "Managed via {{session}}",+ "notAdmin": "Not an admin via {{session}}",+ "name": "Group name",+ "picture": "Group picture",+ "pictureHint": "Click this field to choose a new group picture.",+ "readOnlyHint": "Only group admins can change this group.",+ "description": "Description",+ "descriptionPlaceholder": "Group description (optional)",+ "save": "Save changes",+ "saved": "Group updated",+ "saveFailed": "Could not save the group",+ "loadFailed": "Could not load the group info",+ "participantCount": "Participants: {{count}}",+ "admin": "Admin",+ "owner": "Creator",+ "makeAdmin": "Make admin",+ "removeAdmin": "Remove admin",+ "remove": "Remove",+ "removeConfirm": "Remove {{name}} from the group?",+ "add": "Add",+ "addPlaceholder": "Add a number with country code",+ "memberActionFailed": "The action failed",+ "leaveWarning": "You will no longer receive its messages, and only a group admin can add you back."+ },+ "rowActions": {+ "actionsFor": "Actions for {{name}}",+ "markUnread": "Mark as unread",+ "markUnreadFailed": "Could not mark the chat as unread",+ "clear": "Clear chat",+ "clearConfirm": "Delete every message in the chat with {{name}}?",+ "clearWarning": "The chat stays in the list. The gateway also deletes its stored copy of the messages, media included; export the history first if you need it.",+ "cleared": "Chat with {{name}} cleared",+ "clearFailed": "Could not clear the chat",+ "delete": "Delete chat",+ "deleteConfirm": "Delete the chat with {{name}}?",+ "deleteWarning": "The chat leaves the list, and the gateway deletes its stored copy of the messages, media included.",+ "deleted": "Chat with {{name}} deleted",+ "deleteFailed": "Could not delete the chat",+ "saveContact": "Save contact",+ "renameContact": "Rename contact",+ "firstName": "First name",+ "lastName": "Last name (optional)",+ "contactSaved": "Contact saved",+ "contactSaveFailed": "Could not save the contact",+ "pin": "Pin chat",+ "unpin": "Unpin chat",+ "pinFailed": "Could not pin the chat. WhatsApp keeps at most three chats pinned.",+ "unpinFailed": "Could not unpin the chat",+ "pinnedLabel": "Pinned",+ "mute": "Mute notifications",+ "unmute": "Unmute notifications",+ "mutedLabel": "Muted",+ "muteTitle": "Mute \"{{name}}\"",+ "muteHint": "Other participants are not told that you muted the chat. You are still notified when you are mentioned.",+ "muteFailed": "Could not change the notifications",+ "archive": "Archive chat",+ "unarchive": "Unarchive chat",+ "archived": "Chat archived",+ "unarchived": "Chat unarchived",+ "archiveFailed": "Could not change the archive",+ "archivedEntry": "Archived",+ "archivedTitle": "Archived chats",+ "archiveEmpty": "No archived chats",+ "declined": "WhatsApp declined the change.",+ "block": "Block contact",+ "unblock": "Unblock contact",+ "blockConfirm": "Block {{name}}?",+ "blockWarning": "Blocked contacts can no longer call you or send you messages.",+ "blocked": "{{name}} blocked",+ "unblocked": "{{name}} unblocked",+ "blockFailed": "Could not change the block",+ "muteFor": {+ "8h": "8 hours",+ "1w": "1 week",+ "always": "Always"+ },+ "saveContactUnavailable": "Needs a known phone number: this chat has only a privacy id (@lid)."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/es.json b/dashboard/src/i18n/locales/es.jsonindex 165ac77b6..103d9c88e 100644--- a/dashboard/src/i18n/locales/es.json+++ b/dashboard/src/i18n/locales/es.json@@ -206,6 +206,133 @@"delivered": "Entregado","read": "Leído","failed": "Fallido"+ },+ "clearSearch": "Borrar búsqueda",+ "filters": {+ "label": "Filtrar chats",+ "all": "Todos",+ "unread": "No leídos",+ "direct": "Chats 1:1",+ "groups": "Grupos",+ "unknown": "Desconocidos"+ },+ "noFilterResults": "Ningún chat coincide con este filtro",+ "moreActions": "Más acciones",+ "copyChatId": "Copiar ID del chat",+ "chatIdCopied": "ID del chat copiado",+ "copyFailed": "No se pudo copiar al portapapeles",+ "closeChat": "Cerrar chat",+ "chatId": "ID del chat",+ "newChat": {+ "title": "Nuevo chat",+ "searchPlaceholder": "Buscar nombre o número con prefijo de país",+ "startWithNumber": "Iniciar chat con {{number}}",+ "contacts": "Contactos",+ "noContacts": "No se encontraron contactos",+ "loadingContacts": "Cargando contactos...",+ "contactsError": "No se pudieron cargar los contactos",+ "checking": "Comprobando número...",+ "notOnWhatsApp": "{{number}} no está registrado en WhatsApp",+ "checkFailed": "No se pudo comprobar el número",+ "numberHint": "Introduce los números con el prefijo de país, p. ej. +34 612 345 678"+ },+ "newGroup": {+ "title": "Nuevo grupo",+ "namePlaceholder": "Nombre del grupo",+ "participantsPlaceholder": "Buscar participantes o introducir un número",+ "addNumber": "Añadir {{number}}",+ "selected": "{{count}} seleccionados",+ "create": "Crear grupo",+ "created": "Grupo «{{name}}» creado",+ "createFailed": "No se pudo crear el grupo",+ "removeParticipant": "Quitar a {{name}}"+ },+ "group": {+ "info": "Info. del grupo",+ "leave": "Salir del grupo",+ "leaveConfirm": "¿Salir del grupo \"{{name}}\"?",+ "left": "Has salido de \"{{name}}\"",+ "leaveFailed": "No se pudo salir del grupo",+ "editTitle": "Editar grupo",+ "tabInfo": "Info",+ "tabParticipants": "Participantes",+ "managedBy": "Gestionado mediante {{session}}",+ "notAdmin": "Sin permisos de admin mediante {{session}}",+ "name": "Nombre del grupo",+ "picture": "Imagen del grupo",+ "pictureHint": "Haz clic en este campo para elegir una nueva imagen del grupo.",+ "readOnlyHint": "Solo los admins del grupo pueden cambiarlo.",+ "description": "Descripción",+ "descriptionPlaceholder": "Descripción del grupo (opcional)",+ "save": "Guardar cambios",+ "saved": "Grupo actualizado",+ "saveFailed": "No se pudo guardar el grupo",+ "loadFailed": "No se pudo cargar la info. del grupo",+ "participantCount": "Participantes: {{count}}",+ "admin": "Admin",+ "owner": "Creador",+ "makeAdmin": "Hacer admin",+ "removeAdmin": "Quitar admin",+ "remove": "Quitar",+ "removeConfirm": "¿Quitar a {{name}} del grupo?",+ "add": "Añadir",+ "addPlaceholder": "Añade un número con código de país",+ "memberActionFailed": "La acción ha fallado",+ "leaveWarning": "Dejarás de recibir sus mensajes y solo un admin del grupo podrá volver a añadirte."+ },+ "rowActions": {+ "actionsFor": "Acciones para {{name}}",+ "markUnread": "Marcar como no leído",+ "markUnreadFailed": "No se pudo marcar el chat como no leído",+ "clear": "Vaciar chat",+ "clearConfirm": "¿Eliminar todos los mensajes del chat con {{name}}?",+ "clearWarning": "El chat sigue en la lista. El gateway también borra su copia guardada de los mensajes, con los archivos; exporta el historial antes si lo necesitas.",+ "cleared": "Chat con {{name}} vaciado",+ "clearFailed": "No se pudo vaciar el chat",+ "delete": "Eliminar chat",+ "deleteConfirm": "¿Eliminar el chat con {{name}}?",+ "deleteWarning": "El chat desaparece de la lista y el gateway borra su copia guardada de los mensajes, con los archivos.",+ "deleted": "Chat con {{name}} eliminado",+ "deleteFailed": "No se pudo eliminar el chat",+ "saveContact": "Guardar contacto",+ "renameContact": "Renombrar contacto",+ "firstName": "Nombre",+ "lastName": "Apellido (opcional)",+ "contactSaved": "Contacto guardado",+ "contactSaveFailed": "No se pudo guardar el contacto",+ "pin": "Fijar chat",+ "unpin": "Desfijar chat",+ "pinFailed": "No se pudo fijar el chat. WhatsApp permite fijar como máximo tres chats.",+ "unpinFailed": "No se pudo desfijar el chat",+ "pinnedLabel": "Fijado",+ "mute": "Silenciar notificaciones",+ "unmute": "Activar notificaciones",+ "mutedLabel": "Silenciado",+ "muteTitle": "Silenciar \"{{name}}\"",+ "muteHint": "Los demás participantes no sabrán que silenciaste el chat. Seguirás recibiendo avisos cuando te mencionen.",+ "muteFailed": "No se pudieron cambiar las notificaciones",+ "archive": "Archivar chat",+ "unarchive": "Desarchivar chat",+ "archived": "Chat archivado",+ "unarchived": "Chat desarchivado",+ "archiveFailed": "No se pudo cambiar el archivo",+ "archivedEntry": "Archivados",+ "archivedTitle": "Chats archivados",+ "archiveEmpty": "No hay chats archivados",+ "declined": "WhatsApp rechazó el cambio.",+ "block": "Bloquear contacto",+ "unblock": "Desbloquear contacto",+ "blockConfirm": "¿Bloquear a {{name}}?",+ "blockWarning": "Los contactos bloqueados ya no podrán llamarte ni enviarte mensajes.",+ "blocked": "{{name}} bloqueado",+ "unblocked": "{{name}} desbloqueado",+ "blockFailed": "No se pudo cambiar el bloqueo",+ "muteFor": {+ "8h": "8 horas",+ "1w": "1 semana",+ "always": "Siempre"+ },+ "saveContactUnavailable": "Necesita un número de teléfono conocido: este chat solo tiene un ID de privacidad (@lid)."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/fr.json b/dashboard/src/i18n/locales/fr.jsonindex 8e6fc6054..24985573e 100644--- a/dashboard/src/i18n/locales/fr.json+++ b/dashboard/src/i18n/locales/fr.json@@ -206,6 +206,133 @@"delivered": "Remis","read": "Lu","failed": "Échec"+ },+ "clearSearch": "Effacer la recherche",+ "filters": {+ "label": "Filtrer les discussions",+ "all": "Tous",+ "unread": "Non lus",+ "direct": "Discussions 1:1",+ "groups": "Groupes",+ "unknown": "Inconnus"+ },+ "noFilterResults": "Aucune discussion ne correspond à ce filtre",+ "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",+ "chatId": "ID de la discussion",+ "newChat": {+ "title": "Nouvelle discussion",+ "searchPlaceholder": "Rechercher un nom ou un numéro avec indicatif",+ "startWithNumber": "Démarrer une discussion avec {{number}}",+ "contacts": "Contacts",+ "noContacts": "Aucun contact trouvé",+ "loadingContacts": "Chargement des contacts...",+ "contactsError": "Impossible de charger les contacts",+ "checking": "Vérification du numéro...",+ "notOnWhatsApp": "{{number}} n'est pas inscrit sur WhatsApp",+ "checkFailed": "Impossible de vérifier le numéro",+ "numberHint": "Saisissez les numéros avec l'indicatif du pays, p. ex. +33 6 12 34 56 78"+ },+ "newGroup": {+ "title": "Nouveau groupe",+ "namePlaceholder": "Nom du groupe",+ "participantsPlaceholder": "Rechercher des participants ou saisir un numéro",+ "addNumber": "Ajouter {{number}}",+ "selected": "{{count}} sélectionné(s)",+ "create": "Créer le groupe",+ "created": "Groupe « {{name}} » créé",+ "createFailed": "Impossible de créer le groupe",+ "removeParticipant": "Retirer {{name}}"+ },+ "group": {+ "info": "Infos du groupe",+ "leave": "Quitter le groupe",+ "leaveConfirm": "Quitter le groupe « {{name}} » ?",+ "left": "Vous avez quitté « {{name}} »",+ "leaveFailed": "Impossible de quitter le groupe",+ "editTitle": "Modifier le groupe",+ "tabInfo": "Infos",+ "tabParticipants": "Participants",+ "managedBy": "Géré via {{session}}",+ "notAdmin": "Pas administrateur via {{session}}",+ "name": "Nom du groupe",+ "picture": "Photo du groupe",+ "pictureHint": "Cliquez sur ce champ pour choisir une nouvelle photo de groupe.",+ "readOnlyHint": "Seuls les administrateurs du groupe peuvent le modifier.",+ "description": "Description",+ "descriptionPlaceholder": "Description du groupe (facultatif)",+ "save": "Enregistrer les modifications",+ "saved": "Groupe mis à jour",+ "saveFailed": "Impossible d’enregistrer le groupe",+ "loadFailed": "Impossible de charger les infos du groupe",+ "participantCount": "Participants : {{count}}",+ "admin": "Admin",+ "owner": "Créateur",+ "makeAdmin": "Nommer administrateur",+ "removeAdmin": "Retirer l’administration",+ "remove": "Retirer",+ "removeConfirm": "Retirer {{name}} du groupe ?",+ "add": "Ajouter",+ "addPlaceholder": "Ajoutez un numéro avec l’indicatif du pays",+ "memberActionFailed": "L’action a échoué",+ "leaveWarning": "Vous ne recevrez plus ses messages, et seul un administrateur du groupe pourra vous rajouter."+ },+ "rowActions": {+ "actionsFor": "Actions pour {{name}}",+ "markUnread": "Marquer comme non lu",+ "markUnreadFailed": "Impossible de marquer la discussion comme non lue",+ "clear": "Vider la discussion",+ "clearConfirm": "Supprimer tous les messages de la discussion avec {{name}} ?",+ "clearWarning": "La discussion reste dans la liste. La passerelle supprime aussi sa copie enregistrée des messages, médias compris ; exportez l’historique avant si vous en avez besoin.",+ "cleared": "Discussion avec {{name}} vidée",+ "clearFailed": "Impossible de vider la discussion",+ "delete": "Supprimer la discussion",+ "deleteConfirm": "Supprimer la discussion avec {{name}} ?",+ "deleteWarning": "La discussion disparaît de la liste et la passerelle supprime sa copie enregistrée des messages, médias compris.",+ "deleted": "Discussion avec {{name}} supprimée",+ "deleteFailed": "Impossible de supprimer la discussion",+ "saveContact": "Enregistrer le contact",+ "renameContact": "Renommer le contact",+ "firstName": "Prénom",+ "lastName": "Nom (facultatif)",+ "contactSaved": "Contact enregistré",+ "contactSaveFailed": "Impossible d’enregistrer le contact",+ "pin": "Épingler la discussion",+ "unpin": "Désépingler la discussion",+ "pinFailed": "Impossible d’épingler la discussion. WhatsApp autorise au plus trois discussions épinglées.",+ "unpinFailed": "Impossible de désépingler la discussion",+ "pinnedLabel": "Épinglée",+ "mute": "Mettre en sourdine",+ "unmute": "Réactiver les notifications",+ "mutedLabel": "En sourdine",+ "muteTitle": "Mettre « {{name}} » en sourdine",+ "muteHint": "Les autres participants ne savent pas que vous avez mis la discussion en sourdine. Vous êtes toujours averti quand on vous mentionne.",+ "muteFailed": "Impossible de modifier les notifications",+ "archive": "Archiver la discussion",+ "unarchive": "Désarchiver la discussion",+ "archived": "Discussion archivée",+ "unarchived": "Discussion désarchivée",+ "archiveFailed": "Impossible de modifier l’archive",+ "archivedEntry": "Archivées",+ "archivedTitle": "Discussions archivées",+ "archiveEmpty": "Aucune discussion archivée",+ "declined": "WhatsApp a refusé la modification.",+ "block": "Bloquer le contact",+ "unblock": "Débloquer le contact",+ "blockConfirm": "Bloquer {{name}} ?",+ "blockWarning": "Les contacts bloqués ne peuvent plus vous appeler ni vous envoyer de messages.",+ "blocked": "{{name}} bloqué",+ "unblocked": "{{name}} débloqué",+ "blockFailed": "Impossible de modifier le blocage",+ "muteFor": {+ "8h": "8 heures",+ "1w": "1 semaine",+ "always": "Toujours"+ },+ "saveContactUnavailable": "Nécessite un numéro de téléphone connu : cette discussion n’a qu’un identifiant de confidentialité (@lid)."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/he.json b/dashboard/src/i18n/locales/he.jsonindex c9fc9cda7..2c072e658 100644--- a/dashboard/src/i18n/locales/he.json+++ b/dashboard/src/i18n/locales/he.json@@ -212,6 +212,133 @@"delivered": "נמסר","read": "נקרא","failed": "נכשל"+ },+ "clearSearch": "ניקוי החיפוש",+ "filters": {+ "label": "סינון שיחות",+ "all": "הכול",+ "unread": "לא נקראו",+ "direct": "צ׳אטים אישיים",+ "groups": "קבוצות",+ "unknown": "לא מוכרים"+ },+ "noFilterResults": "אין צ׳אטים שתואמים למסנן זה",+ "moreActions": "פעולות נוספות",+ "copyChatId": "העתקת מזהה הצ׳אט",+ "chatIdCopied": "מזהה הצ׳אט הועתק",+ "copyFailed": "ההעתקה ללוח נכשלה",+ "closeChat": "סגירת הצ׳אט",+ "chatId": "מזהה צ׳אט",+ "newChat": {+ "title": "צ׳אט חדש",+ "searchPlaceholder": "חיפוש שם או מספר עם קידומת מדינה",+ "startWithNumber": "התחלת צ׳אט עם {{number}}",+ "contacts": "אנשי קשר",+ "noContacts": "לא נמצאו אנשי קשר",+ "loadingContacts": "טוען אנשי קשר...",+ "contactsError": "לא ניתן לטעון את אנשי הקשר",+ "checking": "בודק את המספר...",+ "notOnWhatsApp": "{{number}} אינו רשום ב-WhatsApp",+ "checkFailed": "לא ניתן לבדוק את המספר",+ "numberHint": "יש להזין מספרים עם קידומת מדינה, למשל +972 50 123 4567"+ },+ "newGroup": {+ "title": "קבוצה חדשה",+ "namePlaceholder": "שם הקבוצה",+ "participantsPlaceholder": "חיפוש משתתפים או הזנת מספר",+ "addNumber": "הוספת {{number}}",+ "selected": "{{count}} נבחרו",+ "create": "יצירת קבוצה",+ "created": "הקבוצה \"{{name}}\" נוצרה",+ "createFailed": "לא ניתן ליצור את הקבוצה",+ "removeParticipant": "הסרת {{name}}"+ },+ "group": {+ "info": "פרטי הקבוצה",+ "leave": "יציאה מהקבוצה",+ "leaveConfirm": "לצאת מהקבוצה \"{{name}}\"?",+ "left": "יצאת מ-\"{{name}}\"",+ "leaveFailed": "לא ניתן לצאת מהקבוצה",+ "editTitle": "עריכת קבוצה",+ "tabInfo": "מידע",+ "tabParticipants": "משתתפים",+ "managedBy": "מנוהל דרך {{session}}",+ "notAdmin": "אין הרשאת מנהל דרך {{session}}",+ "name": "שם הקבוצה",+ "picture": "תמונת הקבוצה",+ "pictureHint": "לחצו על שדה זה כדי לבחור תמונת קבוצה חדשה.",+ "readOnlyHint": "רק מנהלי הקבוצה יכולים לשנות אותה.",+ "description": "תיאור",+ "descriptionPlaceholder": "תיאור הקבוצה (אופציונלי)",+ "save": "שמירת השינויים",+ "saved": "הקבוצה עודכנה",+ "saveFailed": "לא ניתן לשמור את הקבוצה",+ "loadFailed": "לא ניתן לטעון את פרטי הקבוצה",+ "participantCount": "משתתפים: {{count}}",+ "admin": "מנהל",+ "owner": "יוצר",+ "makeAdmin": "הפיכה למנהל",+ "removeAdmin": "הסרת הרשאת מנהל",+ "remove": "הסרה",+ "removeConfirm": "להסיר את {{name}} מהקבוצה?",+ "add": "הוספה",+ "addPlaceholder": "הוסיפו מספר עם קידומת מדינה",+ "memberActionFailed": "הפעולה נכשלה",+ "leaveWarning": "לא תקבלו עוד הודעות מהקבוצה, ורק מנהל קבוצה יוכל להוסיף אתכם שוב."+ },+ "rowActions": {+ "actionsFor": "פעולות עבור {{name}}",+ "markUnread": "סימון כלא נקרא",+ "markUnreadFailed": "לא ניתן לסמן את השיחה כלא נקראה",+ "clear": "ניקוי השיחה",+ "clearConfirm": "למחוק את כל ההודעות בשיחה עם {{name}}?",+ "clearWarning": "השיחה נשארת ברשימה. השער מוחק גם את העותק השמור של ההודעות, כולל מדיה; ייצאו את ההיסטוריה קודם אם אתם צריכים אותה.",+ "cleared": "השיחה עם {{name}} נוקתה",+ "clearFailed": "לא ניתן לנקות את השיחה",+ "delete": "מחיקת השיחה",+ "deleteConfirm": "למחוק את השיחה עם {{name}}?",+ "deleteWarning": "השיחה נעלמת מהרשימה, והשער מוחק את העותק השמור של ההודעות, כולל מדיה.",+ "deleted": "השיחה עם {{name}} נמחקה",+ "deleteFailed": "לא ניתן למחוק את השיחה",+ "saveContact": "שמירת איש קשר",+ "renameContact": "שינוי שם איש קשר",+ "firstName": "שם פרטי",+ "lastName": "שם משפחה (אופציונלי)",+ "contactSaved": "איש הקשר נשמר",+ "contactSaveFailed": "לא ניתן לשמור את איש הקשר",+ "pin": "הצמדת השיחה",+ "unpin": "ביטול הצמדת השיחה",+ "pinFailed": "לא ניתן להצמיד את השיחה. וואטסאפ מאפשרת עד שלוש שיחות מוצמדות.",+ "unpinFailed": "לא ניתן לבטל את הצמדת השיחה",+ "pinnedLabel": "מוצמדת",+ "mute": "השתקת התראות",+ "unmute": "ביטול השתקה",+ "mutedLabel": "מושתקת",+ "muteTitle": "השתקת \"{{name}}\"",+ "muteHint": "המשתתפים האחרים לא יידעו שהשתקתם את השיחה. תקבלו התראה כשיזכירו אתכם.",+ "muteFailed": "לא ניתן לשנות את ההתראות",+ "archive": "העברה לארכיון",+ "unarchive": "הוצאה מהארכיון",+ "archived": "השיחה הועברה לארכיון",+ "unarchived": "השיחה הוצאה מהארכיון",+ "archiveFailed": "לא ניתן לשנות את הארכיון",+ "archivedEntry": "בארכיון",+ "archivedTitle": "שיחות בארכיון",+ "archiveEmpty": "אין שיחות בארכיון",+ "declined": "וואטסאפ דחתה את השינוי.",+ "block": "חסימת איש קשר",+ "unblock": "ביטול חסימה",+ "blockConfirm": "לחסום את {{name}}?",+ "blockWarning": "אנשי קשר חסומים לא יוכלו להתקשר אליכם או לשלוח לכם הודעות.",+ "blocked": "{{name}} נחסם",+ "unblocked": "החסימה של {{name}} בוטלה",+ "blockFailed": "לא ניתן לשנות את החסימה",+ "muteFor": {+ "8h": "8 שעות",+ "1w": "שבוע",+ "always": "תמיד"+ },+ "saveContactUnavailable": "נדרש מספר טלפון ידוע: לשיחה זו יש רק מזהה פרטיות (@lid)."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/hi.json b/dashboard/src/i18n/locales/hi.jsonindex 58421e394..f131beddd 100644--- a/dashboard/src/i18n/locales/hi.json+++ b/dashboard/src/i18n/locales/hi.json@@ -201,6 +201,133 @@"delivered": "पहुँचा दिया गया","read": "पढ़ा गया","failed": "विफल"+ },+ "clearSearch": "खोज साफ़ करें",+ "filters": {+ "label": "चैट फ़िल्टर करें",+ "all": "सभी",+ "unread": "अपठित",+ "direct": "1:1 चैट",+ "groups": "समूह",+ "unknown": "अज्ञात"+ },+ "noFilterResults": "इस फ़िल्टर से कोई चैट मेल नहीं खाता",+ "moreActions": "और विकल्प",+ "copyChatId": "चैट आईडी कॉपी करें",+ "chatIdCopied": "चैट आईडी कॉपी हो गई",+ "copyFailed": "क्लिपबोर्ड पर कॉपी नहीं हो सका",+ "closeChat": "चैट बंद करें",+ "chatId": "चैट आईडी",+ "newChat": {+ "title": "नई चैट",+ "searchPlaceholder": "नाम या देश कोड के साथ नंबर खोजें",+ "startWithNumber": "{{number}} के साथ चैट शुरू करें",+ "contacts": "संपर्क",+ "noContacts": "कोई संपर्क नहीं मिला",+ "loadingContacts": "संपर्क लोड हो रहे हैं...",+ "contactsError": "संपर्क लोड नहीं हो सके",+ "checking": "नंबर जाँचा जा रहा है...",+ "notOnWhatsApp": "{{number}} WhatsApp पर पंजीकृत नहीं है",+ "checkFailed": "नंबर जाँचा नहीं जा सका",+ "numberHint": "कृपया नंबर देश कोड के साथ दर्ज करें, जैसे +91 98765 43210"+ },+ "newGroup": {+ "title": "नया समूह",+ "namePlaceholder": "समूह का नाम",+ "participantsPlaceholder": "प्रतिभागी खोजें या नंबर दर्ज करें",+ "addNumber": "{{number}} जोड़ें",+ "selected": "{{count}} चयनित",+ "create": "समूह बनाएँ",+ "created": "समूह \"{{name}}\" बनाया गया",+ "createFailed": "समूह नहीं बनाया जा सका",+ "removeParticipant": "{{name}} हटाएँ"+ },+ "group": {+ "info": "समूह जानकारी",+ "leave": "समूह छोड़ें",+ "leaveConfirm": "समूह \"{{name}}\" छोड़ें?",+ "left": "\"{{name}}\" छोड़ दिया",+ "leaveFailed": "समूह छोड़ा नहीं जा सका",+ "editTitle": "समूह संपादित करें",+ "tabInfo": "जानकारी",+ "tabParticipants": "प्रतिभागी",+ "managedBy": "{{session}} के ज़रिए प्रबंधित",+ "notAdmin": "{{session}} के ज़रिए एडमिन नहीं",+ "name": "समूह का नाम",+ "picture": "समूह की तस्वीर",+ "pictureHint": "नई समूह तस्वीर चुनने के लिए इस क्षेत्र पर क्लिक करें।",+ "readOnlyHint": "केवल समूह एडमिन इस समूह को बदल सकते हैं।",+ "description": "विवरण",+ "descriptionPlaceholder": "समूह विवरण (वैकल्पिक)",+ "save": "बदलाव सहेजें",+ "saved": "समूह अपडेट हुआ",+ "saveFailed": "समूह सहेजा नहीं जा सका",+ "loadFailed": "समूह जानकारी लोड नहीं हो सकी",+ "participantCount": "प्रतिभागी: {{count}}",+ "admin": "एडमिन",+ "owner": "निर्माता",+ "makeAdmin": "एडमिन बनाएँ",+ "removeAdmin": "एडमिन हटाएँ",+ "remove": "हटाएँ",+ "removeConfirm": "{{name}} को समूह से हटाएँ?",+ "add": "जोड़ें",+ "addPlaceholder": "देश कोड के साथ नंबर जोड़ें",+ "memberActionFailed": "कार्रवाई विफल रही",+ "leaveWarning": "इसके बाद आपको इसके संदेश नहीं मिलेंगे, और केवल समूह एडमिन ही आपको फिर से जोड़ सकता है।"+ },+ "rowActions": {+ "actionsFor": "{{name}} के लिए कार्रवाइयाँ",+ "markUnread": "अपठित के रूप में चिह्नित करें",+ "markUnreadFailed": "चैट को अपठित चिह्नित नहीं किया जा सका",+ "clear": "चैट खाली करें",+ "clearConfirm": "{{name}} के साथ चैट के सभी संदेश हटाएँ?",+ "clearWarning": "चैट सूची में बनी रहती है। गेटवे संदेशों की अपनी सहेजी गई प्रति भी मीडिया सहित हटा देता है; ज़रूरत हो तो पहले इतिहास निर्यात करें।",+ "cleared": "{{name}} के साथ चैट खाली की गई",+ "clearFailed": "चैट खाली नहीं की जा सकी",+ "delete": "चैट हटाएँ",+ "deleteConfirm": "{{name}} के साथ चैट हटाएँ?",+ "deleteWarning": "चैट सूची से हट जाती है, और गेटवे संदेशों की अपनी सहेजी गई प्रति मीडिया सहित हटा देता है।",+ "deleted": "{{name}} के साथ चैट हटाई गई",+ "deleteFailed": "चैट हटाई नहीं जा सकी",+ "saveContact": "संपर्क सहेजें",+ "renameContact": "संपर्क का नाम बदलें",+ "firstName": "पहला नाम",+ "lastName": "उपनाम (वैकल्पिक)",+ "contactSaved": "संपर्क सहेजा गया",+ "contactSaveFailed": "संपर्क सहेजा नहीं जा सका",+ "pin": "चैट पिन करें",+ "unpin": "चैट अनपिन करें",+ "pinFailed": "चैट पिन नहीं की जा सकी। WhatsApp अधिकतम तीन चैट पिन करने देता है।",+ "unpinFailed": "चैट अनपिन नहीं की जा सकी",+ "pinnedLabel": "पिन की गई",+ "mute": "सूचनाएँ म्यूट करें",+ "unmute": "सूचनाएँ अनम्यूट करें",+ "mutedLabel": "म्यूट",+ "muteTitle": "\"{{name}}\" म्यूट करें",+ "muteHint": "अन्य प्रतिभागियों को पता नहीं चलेगा कि आपने चैट म्यूट की है। उल्लेख होने पर आपको फिर भी सूचना मिलेगी।",+ "muteFailed": "सूचनाएँ बदली नहीं जा सकीं",+ "archive": "चैट संग्रहित करें",+ "unarchive": "चैट संग्रह से निकालें",+ "archived": "चैट संग्रहित की गई",+ "unarchived": "चैट संग्रह से निकाली गई",+ "archiveFailed": "संग्रह बदला नहीं जा सका",+ "archivedEntry": "संग्रहित",+ "archivedTitle": "संग्रहित चैट",+ "archiveEmpty": "कोई संग्रहित चैट नहीं",+ "declined": "WhatsApp ने बदलाव अस्वीकार कर दिया।",+ "block": "संपर्क ब्लॉक करें",+ "unblock": "संपर्क अनब्लॉक करें",+ "blockConfirm": "{{name}} को ब्लॉक करें?",+ "blockWarning": "ब्लॉक किए गए संपर्क आपको कॉल या संदेश नहीं भेज सकेंगे।",+ "blocked": "{{name}} ब्लॉक किया गया",+ "unblocked": "{{name}} अनब्लॉक किया गया",+ "blockFailed": "ब्लॉक बदला नहीं जा सका",+ "muteFor": {+ "8h": "8 घंटे",+ "1w": "1 सप्ताह",+ "always": "हमेशा"+ },+ "saveContactUnavailable": "ज्ञात फ़ोन नंबर चाहिए: इस चैट में केवल गोपनीयता आईडी (@lid) है।"}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/id.json b/dashboard/src/i18n/locales/id.jsonindex a74c35d84..fb1073285 100644--- a/dashboard/src/i18n/locales/id.json+++ b/dashboard/src/i18n/locales/id.json@@ -201,6 +201,133 @@"delivered": "Diterima","read": "Dibaca","failed": "Gagal"+ },+ "clearSearch": "Hapus pencarian",+ "filters": {+ "label": "Filter obrolan",+ "all": "Semua",+ "unread": "Belum dibaca",+ "direct": "Obrolan 1:1",+ "groups": "Grup",+ "unknown": "Tidak dikenal"+ },+ "noFilterResults": "Tidak ada obrolan yang cocok dengan filter ini",+ "moreActions": "Tindakan lainnya",+ "copyChatId": "Salin ID obrolan",+ "chatIdCopied": "ID obrolan disalin",+ "copyFailed": "Tidak dapat menyalin ke papan klip",+ "closeChat": "Tutup obrolan",+ "chatId": "ID obrolan",+ "newChat": {+ "title": "Obrolan baru",+ "searchPlaceholder": "Cari nama atau nomor dengan kode negara",+ "startWithNumber": "Mulai obrolan dengan {{number}}",+ "contacts": "Kontak",+ "noContacts": "Tidak ada kontak ditemukan",+ "loadingContacts": "Memuat kontak...",+ "contactsError": "Tidak dapat memuat kontak",+ "checking": "Memeriksa nomor...",+ "notOnWhatsApp": "{{number}} tidak terdaftar di WhatsApp",+ "checkFailed": "Tidak dapat memeriksa nomor",+ "numberHint": "Masukkan nomor dengan kode negara, mis. +62 812 3456 7890"+ },+ "newGroup": {+ "title": "Grup baru",+ "namePlaceholder": "Nama grup",+ "participantsPlaceholder": "Cari peserta atau masukkan nomor",+ "addNumber": "Tambahkan {{number}}",+ "selected": "{{count}} dipilih",+ "create": "Buat grup",+ "created": "Grup \"{{name}}\" dibuat",+ "createFailed": "Tidak dapat membuat grup",+ "removeParticipant": "Hapus {{name}}"+ },+ "group": {+ "info": "Info grup",+ "leave": "Keluar dari grup",+ "leaveConfirm": "Keluar dari grup \"{{name}}\"?",+ "left": "Keluar dari \"{{name}}\"",+ "leaveFailed": "Tidak dapat keluar dari grup",+ "editTitle": "Edit grup",+ "tabInfo": "Info",+ "tabParticipants": "Peserta",+ "managedBy": "Dikelola melalui {{session}}",+ "notAdmin": "Bukan admin melalui {{session}}",+ "name": "Nama grup",+ "picture": "Foto grup",+ "pictureHint": "Klik kolom ini untuk memilih foto grup baru.",+ "readOnlyHint": "Hanya admin grup yang dapat mengubah grup ini.",+ "description": "Deskripsi",+ "descriptionPlaceholder": "Deskripsi grup (opsional)",+ "save": "Simpan perubahan",+ "saved": "Grup diperbarui",+ "saveFailed": "Tidak dapat menyimpan grup",+ "loadFailed": "Tidak dapat memuat info grup",+ "participantCount": "Peserta: {{count}}",+ "admin": "Admin",+ "owner": "Pembuat",+ "makeAdmin": "Jadikan admin",+ "removeAdmin": "Hapus admin",+ "remove": "Hapus",+ "removeConfirm": "Hapus {{name}} dari grup?",+ "add": "Tambah",+ "addPlaceholder": "Tambahkan nomor dengan kode negara",+ "memberActionFailed": "Tindakan gagal",+ "leaveWarning": "Anda tidak akan menerima pesannya lagi, dan hanya admin grup yang dapat menambahkan Anda kembali."+ },+ "rowActions": {+ "actionsFor": "Tindakan untuk {{name}}",+ "markUnread": "Tandai belum dibaca",+ "markUnreadFailed": "Tidak dapat menandai obrolan belum dibaca",+ "clear": "Kosongkan obrolan",+ "clearConfirm": "Hapus semua pesan dalam obrolan dengan {{name}}?",+ "clearWarning": "Obrolan tetap ada di daftar. Gateway juga menghapus salinan pesan yang disimpannya, termasuk media; ekspor riwayat dulu jika Anda membutuhkannya.",+ "cleared": "Obrolan dengan {{name}} dikosongkan",+ "clearFailed": "Tidak dapat mengosongkan obrolan",+ "delete": "Hapus obrolan",+ "deleteConfirm": "Hapus obrolan dengan {{name}}?",+ "deleteWarning": "Obrolan hilang dari daftar, dan gateway menghapus salinan pesan yang disimpannya, termasuk media.",+ "deleted": "Obrolan dengan {{name}} dihapus",+ "deleteFailed": "Tidak dapat menghapus obrolan",+ "saveContact": "Simpan kontak",+ "renameContact": "Ganti nama kontak",+ "firstName": "Nama depan",+ "lastName": "Nama belakang (opsional)",+ "contactSaved": "Kontak disimpan",+ "contactSaveFailed": "Tidak dapat menyimpan kontak",+ "pin": "Sematkan obrolan",+ "unpin": "Lepas sematan obrolan",+ "pinFailed": "Tidak dapat menyematkan obrolan. WhatsApp mengizinkan paling banyak tiga obrolan disematkan.",+ "unpinFailed": "Tidak dapat melepas sematan obrolan",+ "pinnedLabel": "Disematkan",+ "mute": "Bisukan notifikasi",+ "unmute": "Bunyikan notifikasi",+ "mutedLabel": "Dibisukan",+ "muteTitle": "Bisukan \"{{name}}\"",+ "muteHint": "Peserta lain tidak diberi tahu bahwa Anda membisukan obrolan. Anda tetap diberi tahu saat disebut.",+ "muteFailed": "Tidak dapat mengubah notifikasi",+ "archive": "Arsipkan obrolan",+ "unarchive": "Batal arsipkan obrolan",+ "archived": "Obrolan diarsipkan",+ "unarchived": "Obrolan dikeluarkan dari arsip",+ "archiveFailed": "Tidak dapat mengubah arsip",+ "archivedEntry": "Diarsipkan",+ "archivedTitle": "Obrolan diarsipkan",+ "archiveEmpty": "Tidak ada obrolan diarsipkan",+ "declined": "WhatsApp menolak perubahan.",+ "block": "Blokir kontak",+ "unblock": "Buka blokir kontak",+ "blockConfirm": "Blokir {{name}}?",+ "blockWarning": "Kontak yang diblokir tidak dapat lagi menelepon atau mengirim pesan kepada Anda.",+ "blocked": "{{name}} diblokir",+ "unblocked": "Blokir {{name}} dibuka",+ "blockFailed": "Tidak dapat mengubah blokir",+ "muteFor": {+ "8h": "8 jam",+ "1w": "1 minggu",+ "always": "Selalu"+ },+ "saveContactUnavailable": "Memerlukan nomor telepon yang diketahui: obrolan ini hanya memiliki ID privasi (@lid)."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/it.json b/dashboard/src/i18n/locales/it.jsonindex 6644885f0..dfd01bb31 100644--- a/dashboard/src/i18n/locales/it.json+++ b/dashboard/src/i18n/locales/it.json@@ -206,6 +206,133 @@"delivered": "Consegnato","read": "Letto","failed": "Fallito"+ },+ "clearSearch": "Cancella ricerca",+ "filters": {+ "label": "Filtra chat",+ "all": "Tutte",+ "unread": "Non lette",+ "direct": "Chat 1:1",+ "groups": "Gruppi",+ "unknown": "Sconosciuti"+ },+ "noFilterResults": "Nessuna chat corrisponde a questo filtro",+ "moreActions": "Altre azioni",+ "copyChatId": "Copia ID chat",+ "chatIdCopied": "ID chat copiato",+ "copyFailed": "Impossibile copiare negli appunti",+ "closeChat": "Chiudi chat",+ "chatId": "ID chat",+ "newChat": {+ "title": "Nuova chat",+ "searchPlaceholder": "Cerca nome o numero con prefisso internazionale",+ "startWithNumber": "Avvia chat con {{number}}",+ "contacts": "Contatti",+ "noContacts": "Nessun contatto trovato",+ "loadingContacts": "Caricamento contatti...",+ "contactsError": "Impossibile caricare i contatti",+ "checking": "Verifica del numero...",+ "notOnWhatsApp": "{{number}} non è registrato su WhatsApp",+ "checkFailed": "Impossibile verificare il numero",+ "numberHint": "Inserisci i numeri con il prefisso internazionale, ad es. +39 312 345 6789"+ },+ "newGroup": {+ "title": "Nuovo gruppo",+ "namePlaceholder": "Nome del gruppo",+ "participantsPlaceholder": "Cerca partecipanti o inserisci un numero",+ "addNumber": "Aggiungi {{number}}",+ "selected": "{{count}} selezionati",+ "create": "Crea gruppo",+ "created": "Gruppo \"{{name}}\" creato",+ "createFailed": "Impossibile creare il gruppo",+ "removeParticipant": "Rimuovi {{name}}"+ },+ "group": {+ "info": "Info gruppo",+ "leave": "Esci dal gruppo",+ "leaveConfirm": "Uscire dal gruppo \"{{name}}\"?",+ "left": "Sei uscito da \"{{name}}\"",+ "leaveFailed": "Impossibile uscire dal gruppo",+ "editTitle": "Modifica gruppo",+ "tabInfo": "Info",+ "tabParticipants": "Partecipanti",+ "managedBy": "Gestito tramite {{session}}",+ "notAdmin": "Non amministratore tramite {{session}}",+ "name": "Nome del gruppo",+ "picture": "Immagine del gruppo",+ "pictureHint": "Fai clic su questo campo per scegliere una nuova immagine del gruppo.",+ "readOnlyHint": "Solo gli amministratori del gruppo possono modificarlo.",+ "description": "Descrizione",+ "descriptionPlaceholder": "Descrizione del gruppo (facoltativa)",+ "save": "Salva modifiche",+ "saved": "Gruppo aggiornato",+ "saveFailed": "Impossibile salvare il gruppo",+ "loadFailed": "Impossibile caricare le info del gruppo",+ "participantCount": "Partecipanti: {{count}}",+ "admin": "Admin",+ "owner": "Creatore",+ "makeAdmin": "Rendi amministratore",+ "removeAdmin": "Rimuovi amministratore",+ "remove": "Rimuovi",+ "removeConfirm": "Rimuovere {{name}} dal gruppo?",+ "add": "Aggiungi",+ "addPlaceholder": "Aggiungi un numero con prefisso internazionale",+ "memberActionFailed": "L’azione non è riuscita",+ "leaveWarning": "Non riceverai più i suoi messaggi e solo un amministratore del gruppo potrà aggiungerti di nuovo."+ },+ "rowActions": {+ "actionsFor": "Azioni per {{name}}",+ "markUnread": "Segna come non letto",+ "markUnreadFailed": "Impossibile segnare la chat come non letta",+ "clear": "Svuota chat",+ "clearConfirm": "Eliminare tutti i messaggi della chat con {{name}}?",+ "clearWarning": "La chat resta nell’elenco. Il gateway elimina anche la sua copia salvata dei messaggi, media inclusi; esporta prima la cronologia se ti serve.",+ "cleared": "Chat con {{name}} svuotata",+ "clearFailed": "Impossibile svuotare la chat",+ "delete": "Elimina chat",+ "deleteConfirm": "Eliminare la chat con {{name}}?",+ "deleteWarning": "La chat scompare dall’elenco e il gateway elimina la sua copia salvata dei messaggi, media inclusi.",+ "deleted": "Chat con {{name}} eliminata",+ "deleteFailed": "Impossibile eliminare la chat",+ "saveContact": "Salva contatto",+ "renameContact": "Rinomina contatto",+ "firstName": "Nome",+ "lastName": "Cognome (facoltativo)",+ "contactSaved": "Contatto salvato",+ "contactSaveFailed": "Impossibile salvare il contatto",+ "pin": "Fissa chat",+ "unpin": "Sblocca chat fissata",+ "pinFailed": "Impossibile fissare la chat. WhatsApp consente al massimo tre chat fissate.",+ "unpinFailed": "Impossibile sbloccare la chat fissata",+ "pinnedLabel": "Fissata",+ "mute": "Silenzia notifiche",+ "unmute": "Riattiva notifiche",+ "mutedLabel": "Silenziata",+ "muteTitle": "Silenzia \"{{name}}\"",+ "muteHint": "Gli altri partecipanti non sanno che hai silenziato la chat. Ricevi comunque una notifica quando vieni menzionato.",+ "muteFailed": "Impossibile modificare le notifiche",+ "archive": "Archivia chat",+ "unarchive": "Estrai dall’archivio",+ "archived": "Chat archiviata",+ "unarchived": "Chat estratta dall’archivio",+ "archiveFailed": "Impossibile modificare l’archivio",+ "archivedEntry": "Archiviate",+ "archivedTitle": "Chat archiviate",+ "archiveEmpty": "Nessuna chat archiviata",+ "declined": "WhatsApp ha rifiutato la modifica.",+ "block": "Blocca contatto",+ "unblock": "Sblocca contatto",+ "blockConfirm": "Bloccare {{name}}?",+ "blockWarning": "I contatti bloccati non possono più chiamarti né inviarti messaggi.",+ "blocked": "{{name}} bloccato",+ "unblocked": "{{name}} sbloccato",+ "blockFailed": "Impossibile modificare il blocco",+ "muteFor": {+ "8h": "8 ore",+ "1w": "1 settimana",+ "always": "Sempre"+ },+ "saveContactUnavailable": "Serve un numero di telefono noto: questa chat ha solo un ID privacy (@lid)."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/ko.json b/dashboard/src/i18n/locales/ko.jsonindex 84cace5e4..c54f8cfc6 100644--- a/dashboard/src/i18n/locales/ko.json+++ b/dashboard/src/i18n/locales/ko.json@@ -201,6 +201,133 @@"delivered": "전달됨","read": "읽음","failed": "실패"+ },+ "clearSearch": "검색 지우기",+ "filters": {+ "label": "채팅 필터",+ "all": "전체",+ "unread": "읽지 않음",+ "direct": "1:1 채팅",+ "groups": "그룹",+ "unknown": "알 수 없음"+ },+ "noFilterResults": "이 필터와 일치하는 채팅이 없습니다",+ "moreActions": "추가 작업",+ "copyChatId": "채팅 ID 복사",+ "chatIdCopied": "채팅 ID가 복사되었습니다",+ "copyFailed": "클립보드에 복사할 수 없습니다",+ "closeChat": "채팅 닫기",+ "chatId": "채팅 ID",+ "newChat": {+ "title": "새 채팅",+ "searchPlaceholder": "이름 또는 국가 코드가 포함된 번호 검색",+ "startWithNumber": "{{number}}님과 채팅 시작",+ "contacts": "연락처",+ "noContacts": "연락처를 찾을 수 없습니다",+ "loadingContacts": "연락처를 불러오는 중...",+ "contactsError": "연락처를 불러올 수 없습니다",+ "checking": "번호 확인 중...",+ "notOnWhatsApp": "{{number}}은(는) WhatsApp에 등록되지 않은 번호입니다",+ "checkFailed": "번호를 확인할 수 없습니다",+ "numberHint": "번호는 국가 코드와 함께 입력하세요. 예: +82 10 1234 5678"+ },+ "newGroup": {+ "title": "새 그룹",+ "namePlaceholder": "그룹 이름",+ "participantsPlaceholder": "참여자 검색 또는 번호 입력",+ "addNumber": "{{number}} 추가",+ "selected": "{{count}}명 선택됨",+ "create": "그룹 만들기",+ "created": "\"{{name}}\" 그룹이 생성되었습니다",+ "createFailed": "그룹을 만들 수 없습니다",+ "removeParticipant": "{{name}} 제거"+ },+ "group": {+ "info": "그룹 정보",+ "leave": "그룹 나가기",+ "leaveConfirm": "\"{{name}}\" 그룹에서 나가시겠습니까?",+ "left": "\"{{name}}\"에서 나갔습니다",+ "leaveFailed": "그룹에서 나갈 수 없습니다",+ "editTitle": "그룹 편집",+ "tabInfo": "정보",+ "tabParticipants": "참여자",+ "managedBy": "{{session}}(으)로 관리",+ "notAdmin": "{{session}}에서 관리자가 아님",+ "name": "그룹 이름",+ "picture": "그룹 사진",+ "pictureHint": "이 영역을 클릭해 새 그룹 사진을 선택하세요.",+ "readOnlyHint": "그룹 관리자만 이 그룹을 변경할 수 있습니다.",+ "description": "설명",+ "descriptionPlaceholder": "그룹 설명(선택)",+ "save": "변경 사항 저장",+ "saved": "그룹이 업데이트되었습니다",+ "saveFailed": "그룹을 저장할 수 없습니다",+ "loadFailed": "그룹 정보를 불러올 수 없습니다",+ "participantCount": "참여자: {{count}}",+ "admin": "관리자",+ "owner": "만든 사람",+ "makeAdmin": "관리자로 지정",+ "removeAdmin": "관리자 해제",+ "remove": "내보내기",+ "removeConfirm": "{{name}}님을 그룹에서 내보내시겠습니까?",+ "add": "추가",+ "addPlaceholder": "국가 번호와 함께 번호 추가",+ "memberActionFailed": "작업에 실패했습니다",+ "leaveWarning": "더 이상 이 그룹의 메시지를 받지 않으며, 그룹 관리자만 다시 추가할 수 있습니다."+ },+ "rowActions": {+ "actionsFor": "{{name}} 작업",+ "markUnread": "읽지 않음으로 표시",+ "markUnreadFailed": "채팅을 읽지 않음으로 표시할 수 없습니다",+ "clear": "채팅 비우기",+ "clearConfirm": "{{name}}님과의 채팅에 있는 모든 메시지를 삭제하시겠습니까?",+ "clearWarning": "채팅은 목록에 남습니다. 게이트웨이도 저장된 메시지 사본을 미디어와 함께 삭제하므로, 필요하면 먼저 기록을 내보내세요.",+ "cleared": "{{name}}님과의 채팅을 비웠습니다",+ "clearFailed": "채팅을 비울 수 없습니다",+ "delete": "채팅 삭제",+ "deleteConfirm": "{{name}}님과의 채팅을 삭제하시겠습니까?",+ "deleteWarning": "채팅이 목록에서 사라지고, 게이트웨이가 저장된 메시지 사본을 미디어와 함께 삭제합니다.",+ "deleted": "{{name}}님과의 채팅을 삭제했습니다",+ "deleteFailed": "채팅을 삭제할 수 없습니다",+ "saveContact": "연락처 저장",+ "renameContact": "연락처 이름 변경",+ "firstName": "이름",+ "lastName": "성(선택)",+ "contactSaved": "연락처를 저장했습니다",+ "contactSaveFailed": "연락처를 저장할 수 없습니다",+ "pin": "채팅 고정",+ "unpin": "채팅 고정 해제",+ "pinFailed": "채팅을 고정할 수 없습니다. WhatsApp은 최대 3개의 채팅만 고정할 수 있습니다.",+ "unpinFailed": "채팅 고정을 해제할 수 없습니다",+ "pinnedLabel": "고정됨",+ "mute": "알림 끄기",+ "unmute": "알림 켜기",+ "mutedLabel": "알림 꺼짐",+ "muteTitle": "\"{{name}}\" 알림 끄기",+ "muteHint": "다른 참여자에게는 알림을 끈 사실이 알려지지 않습니다. 멘션되면 계속 알림을 받습니다.",+ "muteFailed": "알림을 변경할 수 없습니다",+ "archive": "채팅 보관",+ "unarchive": "채팅 보관 해제",+ "archived": "채팅을 보관했습니다",+ "unarchived": "채팅 보관을 해제했습니다",+ "archiveFailed": "보관함을 변경할 수 없습니다",+ "archivedEntry": "보관됨",+ "archivedTitle": "보관된 채팅",+ "archiveEmpty": "보관된 채팅이 없습니다",+ "declined": "WhatsApp이 변경을 거부했습니다.",+ "block": "연락처 차단",+ "unblock": "연락처 차단 해제",+ "blockConfirm": "{{name}}님을 차단하시겠습니까?",+ "blockWarning": "차단된 연락처는 더 이상 전화하거나 메시지를 보낼 수 없습니다.",+ "blocked": "{{name}}님을 차단했습니다",+ "unblocked": "{{name}}님의 차단을 해제했습니다",+ "blockFailed": "차단을 변경할 수 없습니다",+ "muteFor": {+ "8h": "8시간",+ "1w": "1주",+ "always": "항상"+ },+ "saveContactUnavailable": "알려진 전화번호가 필요합니다. 이 채팅에는 개인정보 보호 ID(@lid)만 있습니다."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/pt-BR.json b/dashboard/src/i18n/locales/pt-BR.jsonindex c7abefd93..3529ea201 100644--- a/dashboard/src/i18n/locales/pt-BR.json+++ b/dashboard/src/i18n/locales/pt-BR.json@@ -206,6 +206,133 @@"delivered": "Entregue","read": "Lido","failed": "Falhou"+ },+ "clearSearch": "Limpar pesquisa",+ "filters": {+ "label": "Filtrar chats",+ "all": "Todas",+ "unread": "Não lidas",+ "direct": "Conversas 1:1",+ "groups": "Grupos",+ "unknown": "Desconhecidos"+ },+ "noFilterResults": "Nenhuma conversa corresponde a este filtro",+ "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",+ "chatId": "ID da conversa",+ "newChat": {+ "title": "Nova conversa",+ "searchPlaceholder": "Buscar nome ou número com código do país",+ "startWithNumber": "Iniciar conversa com {{number}}",+ "contacts": "Contatos",+ "noContacts": "Nenhum contato encontrado",+ "loadingContacts": "Carregando contatos...",+ "contactsError": "Não foi possível carregar os contatos",+ "checking": "Verificando número...",+ "notOnWhatsApp": "{{number}} não está registrado no WhatsApp",+ "checkFailed": "Não foi possível verificar o número",+ "numberHint": "Digite os números com o código do país, ex.: +55 11 91234-5678"+ },+ "newGroup": {+ "title": "Novo grupo",+ "namePlaceholder": "Nome do grupo",+ "participantsPlaceholder": "Buscar participantes ou digitar um número",+ "addNumber": "Adicionar {{number}}",+ "selected": "{{count}} selecionados",+ "create": "Criar grupo",+ "created": "Grupo \"{{name}}\" criado",+ "createFailed": "Não foi possível criar o grupo",+ "removeParticipant": "Remover {{name}}"+ },+ "group": {+ "info": "Dados do grupo",+ "leave": "Sair do grupo",+ "leaveConfirm": "Sair do grupo \"{{name}}\"?",+ "left": "Você saiu de \"{{name}}\"",+ "leaveFailed": "Não foi possível sair do grupo",+ "editTitle": "Editar grupo",+ "tabInfo": "Info",+ "tabParticipants": "Participantes",+ "managedBy": "Gerenciado via {{session}}",+ "notAdmin": "Sem permissão de admin via {{session}}",+ "name": "Nome do grupo",+ "picture": "Foto do grupo",+ "pictureHint": "Clique neste campo para escolher uma nova foto do grupo.",+ "readOnlyHint": "Somente admins do grupo podem alterá-lo.",+ "description": "Descrição",+ "descriptionPlaceholder": "Descrição do grupo (opcional)",+ "save": "Salvar alterações",+ "saved": "Grupo atualizado",+ "saveFailed": "Não foi possível salvar o grupo",+ "loadFailed": "Não foi possível carregar os dados do grupo",+ "participantCount": "Participantes: {{count}}",+ "admin": "Admin",+ "owner": "Criador",+ "makeAdmin": "Tornar admin",+ "removeAdmin": "Remover admin",+ "remove": "Remover",+ "removeConfirm": "Remover {{name}} do grupo?",+ "add": "Adicionar",+ "addPlaceholder": "Adicione um número com código do país",+ "memberActionFailed": "A ação falhou",+ "leaveWarning": "Você deixará de receber as mensagens do grupo, e só um admin poderá adicioná-lo de novo."+ },+ "rowActions": {+ "actionsFor": "Ações para {{name}}",+ "markUnread": "Marcar como não lida",+ "markUnreadFailed": "Não foi possível marcar a conversa como não lida",+ "clear": "Limpar conversa",+ "clearConfirm": "Apagar todas as mensagens da conversa com {{name}}?",+ "clearWarning": "A conversa continua na lista. O gateway também apaga a cópia salva das mensagens, com as mídias; exporte o histórico antes se precisar dele.",+ "cleared": "Conversa com {{name}} limpa",+ "clearFailed": "Não foi possível limpar a conversa",+ "delete": "Apagar conversa",+ "deleteConfirm": "Apagar a conversa com {{name}}?",+ "deleteWarning": "A conversa sai da lista, e o gateway apaga a cópia salva das mensagens, com as mídias.",+ "deleted": "Conversa com {{name}} apagada",+ "deleteFailed": "Não foi possível apagar a conversa",+ "saveContact": "Salvar contato",+ "renameContact": "Renomear contato",+ "firstName": "Nome",+ "lastName": "Sobrenome (opcional)",+ "contactSaved": "Contato salvo",+ "contactSaveFailed": "Não foi possível salvar o contato",+ "pin": "Fixar conversa",+ "unpin": "Desafixar conversa",+ "pinFailed": "Não foi possível fixar a conversa. O WhatsApp permite no máximo três conversas fixadas.",+ "unpinFailed": "Não foi possível desafixar a conversa",+ "pinnedLabel": "Fixada",+ "mute": "Silenciar notificações",+ "unmute": "Reativar notificações",+ "mutedLabel": "Silenciada",+ "muteTitle": "Silenciar \"{{name}}\"",+ "muteHint": "Os outros participantes não sabem que você silenciou a conversa. Você ainda é notificado quando for mencionado.",+ "muteFailed": "Não foi possível alterar as notificações",+ "archive": "Arquivar conversa",+ "unarchive": "Desarquivar conversa",+ "archived": "Conversa arquivada",+ "unarchived": "Conversa desarquivada",+ "archiveFailed": "Não foi possível alterar o arquivo",+ "archivedEntry": "Arquivadas",+ "archivedTitle": "Conversas arquivadas",+ "archiveEmpty": "Nenhuma conversa arquivada",+ "declined": "O WhatsApp recusou a alteração.",+ "block": "Bloquear contato",+ "unblock": "Desbloquear contato",+ "blockConfirm": "Bloquear {{name}}?",+ "blockWarning": "Contatos bloqueados não podem mais ligar nem enviar mensagens para você.",+ "blocked": "{{name}} bloqueado",+ "unblocked": "{{name}} desbloqueado",+ "blockFailed": "Não foi possível alterar o bloqueio",+ "muteFor": {+ "8h": "8 horas",+ "1w": "1 semana",+ "always": "Sempre"+ },+ "saveContactUnavailable": "Precisa de um número de telefone conhecido: esta conversa tem só um ID de privacidade (@lid)."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/te.json b/dashboard/src/i18n/locales/te.jsonindex f5c711829..328b908af 100644--- a/dashboard/src/i18n/locales/te.json+++ b/dashboard/src/i18n/locales/te.json@@ -201,6 +201,133 @@"delivered": "డెలివరీ అయింది","read": "చదవబడింది","failed": "విఫలమైంది"+ },+ "clearSearch": "శోధనను క్లియర్ చేయండి",+ "filters": {+ "label": "చాట్లను ఫిల్టర్ చేయండి",+ "all": "అన్నీ",+ "unread": "చదవనివి",+ "direct": "1:1 చాట్లు",+ "groups": "గ్రూప్లు",+ "unknown": "తెలియనివి"+ },+ "noFilterResults": "ఈ ఫిల్టర్కు సరిపోయే చాట్లు లేవు",+ "moreActions": "మరిన్ని చర్యలు",+ "copyChatId": "చాట్ ID కాపీ చేయండి",+ "chatIdCopied": "చాట్ ID కాపీ అయింది",+ "copyFailed": "క్లిప్బోర్డ్కు కాపీ చేయడం సాధ్యం కాలేదు",+ "closeChat": "చాట్ మూసివేయండి",+ "chatId": "చాట్ ID",+ "newChat": {+ "title": "కొత్త చాట్",+ "searchPlaceholder": "దేశ కోడ్తో పేరు లేదా నంబర్ శోధించండి",+ "startWithNumber": "{{number}}తో చాట్ ప్రారంభించండి",+ "contacts": "సంప్రదింపులు",+ "noContacts": "సంప్రదింపులు ఏవీ కనుగొనబడలేదు",+ "loadingContacts": "సంప్రదింపులు లోడ్ అవుతున్నాయి...",+ "contactsError": "సంప్రదింపులను లోడ్ చేయడం సాధ్యం కాలేదు",+ "checking": "నంబర్ తనిఖీ చేస్తోంది...",+ "notOnWhatsApp": "{{number}} WhatsAppలో నమోదు కాలేదు",+ "checkFailed": "నంబర్ను తనిఖీ చేయడం సాధ్యం కాలేదు",+ "numberHint": "దయచేసి దేశ కోడ్తో నంబర్ నమోదు చేయండి, ఉదా. +91 98765 43210"+ },+ "newGroup": {+ "title": "కొత్త గ్రూప్",+ "namePlaceholder": "గ్రూప్ పేరు",+ "participantsPlaceholder": "పాల్గొనేవారిని శోధించండి లేదా నంబర్ నమోదు చేయండి",+ "addNumber": "{{number}} జోడించండి",+ "selected": "{{count}} ఎంచుకోబడ్డాయి",+ "create": "గ్రూప్ సృష్టించండి",+ "created": "\"{{name}}\" గ్రూప్ సృష్టించబడింది",+ "createFailed": "గ్రూప్ను సృష్టించడం సాధ్యం కాలేదు",+ "removeParticipant": "{{name}}ను తొలగించండి"+ },+ "group": {+ "info": "సమూహ సమాచారం",+ "leave": "సమూహం నుండి నిష్క్రమించండి",+ "leaveConfirm": "\"{{name}}\" సమూహం నుండి నిష్క్రమించాలా?",+ "left": "\"{{name}}\" నుండి నిష్క్రమించారు",+ "leaveFailed": "సమూహం నుండి నిష్క్రమించలేకపోయాం",+ "editTitle": "సమూహాన్ని సవరించండి",+ "tabInfo": "సమాచారం",+ "tabParticipants": "పాల్గొనేవారు",+ "managedBy": "{{session}} ద్వారా నిర్వహణ",+ "notAdmin": "{{session}} ద్వారా అడ్మిన్ కాదు",+ "name": "సమూహం పేరు",+ "picture": "సమూహ చిత్రం",+ "pictureHint": "కొత్త సమూహ చిత్రాన్ని ఎంచుకోవడానికి ఈ ఫీల్డ్పై క్లిక్ చేయండి.",+ "readOnlyHint": "సమూహ అడ్మిన్లు మాత్రమే ఈ సమూహాన్ని మార్చగలరు.",+ "description": "వివరణ",+ "descriptionPlaceholder": "సమూహ వివరణ (ఐచ్ఛికం)",+ "save": "మార్పులను సేవ్ చేయండి",+ "saved": "సమూహం నవీకరించబడింది",+ "saveFailed": "సమూహాన్ని సేవ్ చేయలేకపోయాం",+ "loadFailed": "సమూహ సమాచారాన్ని లోడ్ చేయలేకపోయాం",+ "participantCount": "పాల్గొనేవారు: {{count}}",+ "admin": "అడ్మిన్",+ "owner": "సృష్టికర్త",+ "makeAdmin": "అడ్మిన్గా చేయండి",+ "removeAdmin": "అడ్మిన్ తొలగించండి",+ "remove": "తొలగించండి",+ "removeConfirm": "{{name}}ను సమూహం నుండి తొలగించాలా?",+ "add": "జోడించండి",+ "addPlaceholder": "దేశ కోడ్తో నంబర్ను జోడించండి",+ "memberActionFailed": "చర్య విఫలమైంది",+ "leaveWarning": "ఇకపై దీని సందేశాలు మీకు రావు, మరియు సమూహ అడ్మిన్ మాత్రమే మిమ్మల్ని మళ్లీ జోడించగలరు."+ },+ "rowActions": {+ "actionsFor": "{{name}} కోసం చర్యలు",+ "markUnread": "చదవనిదిగా గుర్తించండి",+ "markUnreadFailed": "చాట్ను చదవనిదిగా గుర్తించలేకపోయాం",+ "clear": "చాట్ను ఖాళీ చేయండి",+ "clearConfirm": "{{name}}తో చాట్లోని అన్ని సందేశాలను తొలగించాలా?",+ "clearWarning": "చాట్ జాబితాలోనే ఉంటుంది. గేట్వే సేవ్ చేసిన సందేశాల కాపీని మీడియాతో సహా తొలగిస్తుంది; అవసరమైతే ముందుగా చరిత్రను ఎగుమతి చేయండి.",+ "cleared": "{{name}}తో చాట్ ఖాళీ చేయబడింది",+ "clearFailed": "చాట్ను ఖాళీ చేయలేకపోయాం",+ "delete": "చాట్ను తొలగించండి",+ "deleteConfirm": "{{name}}తో చాట్ను తొలగించాలా?",+ "deleteWarning": "చాట్ జాబితా నుండి తొలగిపోతుంది, మరియు గేట్వే సేవ్ చేసిన సందేశాల కాపీని మీడియాతో సహా తొలగిస్తుంది.",+ "deleted": "{{name}}తో చాట్ తొలగించబడింది",+ "deleteFailed": "చాట్ను తొలగించలేకపోయాం",+ "saveContact": "పరిచయాన్ని సేవ్ చేయండి",+ "renameContact": "పరిచయం పేరు మార్చండి",+ "firstName": "మొదటి పేరు",+ "lastName": "ఇంటి పేరు (ఐచ్ఛికం)",+ "contactSaved": "పరిచయం సేవ్ చేయబడింది",+ "contactSaveFailed": "పరిచయాన్ని సేవ్ చేయలేకపోయాం",+ "pin": "చాట్ను పిన్ చేయండి",+ "unpin": "చాట్ పిన్ తీసివేయండి",+ "pinFailed": "చాట్ను పిన్ చేయలేకపోయాం. WhatsApp గరిష్టంగా మూడు చాట్లను మాత్రమే పిన్ చేయనిస్తుంది.",+ "unpinFailed": "చాట్ పిన్ తీసివేయలేకపోయాం",+ "pinnedLabel": "పిన్ చేయబడింది",+ "mute": "నోటిఫికేషన్లను మ్యూట్ చేయండి",+ "unmute": "నోటిఫికేషన్లను అన్మ్యూట్ చేయండి",+ "mutedLabel": "మ్యూట్ చేయబడింది",+ "muteTitle": "\"{{name}}\"ను మ్యూట్ చేయండి",+ "muteHint": "మీరు చాట్ను మ్యూట్ చేశారని ఇతర పాల్గొనేవారికి తెలియదు. మిమ్మల్ని ప్రస్తావించినప్పుడు నోటిఫికేషన్ వస్తుంది.",+ "muteFailed": "నోటిఫికేషన్లను మార్చలేకపోయాం",+ "archive": "చాట్ను ఆర్కైవ్ చేయండి",+ "unarchive": "చాట్ను ఆర్కైవ్ నుండి తీయండి",+ "archived": "చాట్ ఆర్కైవ్ చేయబడింది",+ "unarchived": "చాట్ ఆర్కైవ్ నుండి తీయబడింది",+ "archiveFailed": "ఆర్కైవ్ను మార్చలేకపోయాం",+ "archivedEntry": "ఆర్కైవ్ చేయబడినవి",+ "archivedTitle": "ఆర్కైవ్ చేసిన చాట్లు",+ "archiveEmpty": "ఆర్కైవ్ చేసిన చాట్లు లేవు",+ "declined": "WhatsApp మార్పును తిరస్కరించింది.",+ "block": "పరిచయాన్ని బ్లాక్ చేయండి",+ "unblock": "పరిచయాన్ని అన్బ్లాక్ చేయండి",+ "blockConfirm": "{{name}}ను బ్లాక్ చేయాలా?",+ "blockWarning": "బ్లాక్ చేసిన పరిచయాలు ఇకపై మీకు కాల్ చేయలేవు లేదా సందేశాలు పంపలేవు.",+ "blocked": "{{name}} బ్లాక్ చేయబడింది",+ "unblocked": "{{name}} అన్బ్లాక్ చేయబడింది",+ "blockFailed": "బ్లాక్ను మార్చలేకపోయాం",+ "muteFor": {+ "8h": "8 గంటలు",+ "1w": "1 వారం",+ "always": "ఎల్లప్పుడూ"+ },+ "saveContactUnavailable": "తెలిసిన ఫోన్ నంబర్ అవసరం: ఈ చాట్కు గోప్యతా ID (@lid) మాత్రమే ఉంది."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/tr.json b/dashboard/src/i18n/locales/tr.jsonindex 3c0b49124..1b444087a 100644--- a/dashboard/src/i18n/locales/tr.json+++ b/dashboard/src/i18n/locales/tr.json@@ -201,6 +201,133 @@"delivered": "İletildi","read": "Okundu","failed": "Başarısız"+ },+ "clearSearch": "Aramayı temizle",+ "filters": {+ "label": "Sohbetleri filtrele",+ "all": "Tümü",+ "unread": "Okunmamış",+ "direct": "Bire bir sohbetler",+ "groups": "Gruplar",+ "unknown": "Bilinmeyen"+ },+ "noFilterResults": "Bu filtreyle eşleşen sohbet yok",+ "moreActions": "Diğer işlemler",+ "copyChatId": "Sohbet kimliğini kopyala",+ "chatIdCopied": "Sohbet kimliği kopyalandı",+ "copyFailed": "Panoya kopyalanamadı",+ "closeChat": "Sohbeti kapat",+ "chatId": "Sohbet kimliği",+ "newChat": {+ "title": "Yeni sohbet",+ "searchPlaceholder": "Ad veya ülke koduyla numara ara",+ "startWithNumber": "{{number}} ile sohbet başlat",+ "contacts": "Kişiler",+ "noContacts": "Kişi bulunamadı",+ "loadingContacts": "Kişiler yükleniyor...",+ "contactsError": "Kişiler yüklenemedi",+ "checking": "Numara kontrol ediliyor...",+ "notOnWhatsApp": "{{number}} WhatsApp'a kayıtlı değil",+ "checkFailed": "Numara kontrol edilemedi",+ "numberHint": "Lütfen numaraları ülke koduyla girin, ör. +90 532 123 45 67"+ },+ "newGroup": {+ "title": "Yeni grup",+ "namePlaceholder": "Grup adı",+ "participantsPlaceholder": "Katılımcı ara veya numara gir",+ "addNumber": "{{number}} ekle",+ "selected": "{{count}} seçildi",+ "create": "Grup oluştur",+ "created": "\"{{name}}\" grubu oluşturuldu",+ "createFailed": "Grup oluşturulamadı",+ "removeParticipant": "{{name}} kaldır"+ },+ "group": {+ "info": "Grup bilgisi",+ "leave": "Gruptan çık",+ "leaveConfirm": "\"{{name}}\" grubundan çıkılsın mı?",+ "left": "\"{{name}}\" grubundan çıkıldı",+ "leaveFailed": "Gruptan çıkılamadı",+ "editTitle": "Grubu düzenle",+ "tabInfo": "Bilgi",+ "tabParticipants": "Katılımcılar",+ "managedBy": "{{session}} üzerinden yönetiliyor",+ "notAdmin": "{{session}} üzerinden yönetici değil",+ "name": "Grup adı",+ "picture": "Grup resmi",+ "pictureHint": "Yeni bir grup resmi seçmek için bu alana tıklayın.",+ "readOnlyHint": "Bu grubu yalnızca grup yöneticileri değiştirebilir.",+ "description": "Açıklama",+ "descriptionPlaceholder": "Grup açıklaması (isteğe bağlı)",+ "save": "Değişiklikleri kaydet",+ "saved": "Grup güncellendi",+ "saveFailed": "Grup kaydedilemedi",+ "loadFailed": "Grup bilgisi yüklenemedi",+ "participantCount": "Katılımcılar: {{count}}",+ "admin": "Yönetici",+ "owner": "Oluşturan",+ "makeAdmin": "Yönetici yap",+ "removeAdmin": "Yöneticiliği kaldır",+ "remove": "Çıkar",+ "removeConfirm": "{{name}} gruptan çıkarılsın mı?",+ "add": "Ekle",+ "addPlaceholder": "Ülke koduyla bir numara ekleyin",+ "memberActionFailed": "İşlem başarısız oldu",+ "leaveWarning": "Artık grubun mesajlarını almayacaksınız ve sizi yalnızca bir grup yöneticisi yeniden ekleyebilir."+ },+ "rowActions": {+ "actionsFor": "{{name}} için işlemler",+ "markUnread": "Okunmadı olarak işaretle",+ "markUnreadFailed": "Sohbet okunmadı olarak işaretlenemedi",+ "clear": "Sohbeti temizle",+ "clearConfirm": "{{name}} ile sohbetteki tüm mesajlar silinsin mi?",+ "clearWarning": "Sohbet listede kalır. Ağ geçidi, medya dahil mesajların kayıtlı kopyasını da siler; gerekiyorsa önce geçmişi dışa aktarın.",+ "cleared": "{{name}} ile sohbet temizlendi",+ "clearFailed": "Sohbet temizlenemedi",+ "delete": "Sohbeti sil",+ "deleteConfirm": "{{name}} ile sohbet silinsin mi?",+ "deleteWarning": "Sohbet listeden kalkar ve ağ geçidi, medya dahil mesajların kayıtlı kopyasını siler.",+ "deleted": "{{name}} ile sohbet silindi",+ "deleteFailed": "Sohbet silinemedi",+ "saveContact": "Kişiyi kaydet",+ "renameContact": "Kişiyi yeniden adlandır",+ "firstName": "Ad",+ "lastName": "Soyad (isteğe bağlı)",+ "contactSaved": "Kişi kaydedildi",+ "contactSaveFailed": "Kişi kaydedilemedi",+ "pin": "Sohbeti sabitle",+ "unpin": "Sohbetin sabitlemesini kaldır",+ "pinFailed": "Sohbet sabitlenemedi. WhatsApp en fazla üç sohbetin sabitlenmesine izin verir.",+ "unpinFailed": "Sohbetin sabitlemesi kaldırılamadı",+ "pinnedLabel": "Sabitlendi",+ "mute": "Bildirimleri sessize al",+ "unmute": "Bildirimleri aç",+ "mutedLabel": "Sessizde",+ "muteTitle": "\"{{name}}\" sessize alınsın",+ "muteHint": "Diğer katılımcılar sohbeti sessize aldığınızı görmez. Bahsedildiğinizde yine bildirim alırsınız.",+ "muteFailed": "Bildirimler değiştirilemedi",+ "archive": "Sohbeti arşivle",+ "unarchive": "Sohbeti arşivden çıkar",+ "archived": "Sohbet arşivlendi",+ "unarchived": "Sohbet arşivden çıkarıldı",+ "archiveFailed": "Arşiv değiştirilemedi",+ "archivedEntry": "Arşivlenmiş",+ "archivedTitle": "Arşivlenmiş sohbetler",+ "archiveEmpty": "Arşivlenmiş sohbet yok",+ "declined": "WhatsApp değişikliği reddetti.",+ "block": "Kişiyi engelle",+ "unblock": "Kişinin engelini kaldır",+ "blockConfirm": "{{name}} engellensin mi?",+ "blockWarning": "Engellenen kişiler sizi artık arayamaz ve size mesaj gönderemez.",+ "blocked": "{{name}} engellendi",+ "unblocked": "{{name}} engeli kaldırıldı",+ "blockFailed": "Engel değiştirilemedi",+ "muteFor": {+ "8h": "8 saat",+ "1w": "1 hafta",+ "always": "Her zaman"+ },+ "saveContactUnavailable": "Bilinen bir telefon numarası gerekir: bu sohbetin yalnızca bir gizlilik kimliği (@lid) var."}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/zh-CN.json b/dashboard/src/i18n/locales/zh-CN.jsonindex d2720bee7..8007e37ac 100644--- a/dashboard/src/i18n/locales/zh-CN.json+++ b/dashboard/src/i18n/locales/zh-CN.json@@ -201,6 +201,133 @@"delivered": "已送达","read": "已读","failed": "发送失败"+ },+ "clearSearch": "清除搜索",+ "filters": {+ "label": "筛选聊天",+ "all": "全部",+ "unread": "未读",+ "direct": "单聊",+ "groups": "群组",+ "unknown": "未知"+ },+ "noFilterResults": "没有符合此筛选条件的聊天",+ "moreActions": "更多操作",+ "copyChatId": "复制聊天 ID",+ "chatIdCopied": "已复制聊天 ID",+ "copyFailed": "无法复制到剪贴板",+ "closeChat": "关闭聊天",+ "chatId": "聊天 ID",+ "newChat": {+ "title": "新聊天",+ "searchPlaceholder": "搜索姓名或带国家代码的号码",+ "startWithNumber": "开始与 {{number}} 聊天",+ "contacts": "联系人",+ "noContacts": "未找到联系人",+ "loadingContacts": "正在加载联系人...",+ "contactsError": "无法加载联系人",+ "checking": "正在检查号码...",+ "notOnWhatsApp": "{{number}} 未注册 WhatsApp",+ "checkFailed": "无法检查该号码",+ "numberHint": "请输入带国家代码的号码,例如 +86 138 0013 8000"+ },+ "newGroup": {+ "title": "新建群组",+ "namePlaceholder": "群组名称",+ "participantsPlaceholder": "搜索参与者或输入号码",+ "addNumber": "添加 {{number}}",+ "selected": "已选择 {{count}} 个",+ "create": "创建群组",+ "created": "已创建群组“{{name}}”",+ "createFailed": "无法创建群组",+ "removeParticipant": "移除 {{name}}"+ },+ "group": {+ "info": "群组信息",+ "leave": "退出群组",+ "leaveConfirm": "要退出群组“{{name}}”吗?",+ "left": "已退出“{{name}}”",+ "leaveFailed": "无法退出群组",+ "editTitle": "编辑群组",+ "tabInfo": "信息",+ "tabParticipants": "成员",+ "managedBy": "通过 {{session}} 管理",+ "notAdmin": "在 {{session}} 中不是管理员",+ "name": "群组名称",+ "picture": "群组头像",+ "pictureHint": "点击此处选择新的群组头像。",+ "readOnlyHint": "只有群管理员可以修改此群组。",+ "description": "描述",+ "descriptionPlaceholder": "群组描述(可选)",+ "save": "保存更改",+ "saved": "群组已更新",+ "saveFailed": "无法保存群组",+ "loadFailed": "无法加载群组信息",+ "participantCount": "成员:{{count}}",+ "admin": "管理员",+ "owner": "创建者",+ "makeAdmin": "设为管理员",+ "removeAdmin": "取消管理员",+ "remove": "移除",+ "removeConfirm": "要将 {{name}} 移出群组吗?",+ "add": "添加",+ "addPlaceholder": "添加带国家代码的号码",+ "memberActionFailed": "操作失败",+ "leaveWarning": "退出后将不再收到该群消息,只有群管理员可以重新添加你。"+ },+ "rowActions": {+ "actionsFor": "{{name}} 的操作",+ "markUnread": "标为未读",+ "markUnreadFailed": "无法将聊天标为未读",+ "clear": "清空聊天",+ "clearConfirm": "要删除与 {{name}} 的聊天中的所有消息吗?",+ "clearWarning": "聊天仍保留在列表中。网关也会删除其保存的消息副本(含媒体);如需保留,请先导出记录。",+ "cleared": "已清空与 {{name}} 的聊天",+ "clearFailed": "无法清空聊天",+ "delete": "删除聊天",+ "deleteConfirm": "要删除与 {{name}} 的聊天吗?",+ "deleteWarning": "聊天将从列表中移除,网关会删除其保存的消息副本(含媒体)。",+ "deleted": "已删除与 {{name}} 的聊天",+ "deleteFailed": "无法删除聊天",+ "saveContact": "保存联系人",+ "renameContact": "重命名联系人",+ "firstName": "名",+ "lastName": "姓(可选)",+ "contactSaved": "联系人已保存",+ "contactSaveFailed": "无法保存联系人",+ "pin": "置顶聊天",+ "unpin": "取消置顶",+ "pinFailed": "无法置顶聊天。WhatsApp 最多允许置顶三个聊天。",+ "unpinFailed": "无法取消置顶",+ "pinnedLabel": "已置顶",+ "mute": "静音通知",+ "unmute": "取消静音",+ "mutedLabel": "已静音",+ "muteTitle": "静音“{{name}}”",+ "muteHint": "其他参与者不会知道你已将聊天静音。被提及时你仍会收到通知。",+ "muteFailed": "无法更改通知设置",+ "archive": "归档聊天",+ "unarchive": "取消归档",+ "archived": "聊天已归档",+ "unarchived": "聊天已取消归档",+ "archiveFailed": "无法更改归档",+ "archivedEntry": "已归档",+ "archivedTitle": "已归档的聊天",+ "archiveEmpty": "没有已归档的聊天",+ "declined": "WhatsApp 拒绝了此更改。",+ "block": "屏蔽联系人",+ "unblock": "取消屏蔽",+ "blockConfirm": "要屏蔽 {{name}} 吗?",+ "blockWarning": "被屏蔽的联系人将无法再给你打电话或发消息。",+ "blocked": "已屏蔽 {{name}}",+ "unblocked": "已取消屏蔽 {{name}}",+ "blockFailed": "无法更改屏蔽状态",+ "muteFor": {+ "8h": "8 小时",+ "1w": "1 周",+ "always": "始终"+ },+ "saveContactUnavailable": "需要已知的电话号码:此聊天只有隐私 ID(@lid)。"}},"errorBoundary": {diff --git a/dashboard/src/i18n/locales/zh-HK.json b/dashboard/src/i18n/locales/zh-HK.jsonindex 1e0f9b86c..269cc539d 100644--- a/dashboard/src/i18n/locales/zh-HK.json+++ b/dashboard/src/i18n/locales/zh-HK.json@@ -201,6 +201,133 @@"delivered": "已送達","read": "已讀","failed": "傳送失敗"+ },+ "clearSearch": "清除搜尋",+ "filters": {+ "label": "篩選聊天",+ "all": "全部",+ "unread": "未讀",+ "direct": "私人聊天",+ "groups": "群組",+ "unknown": "未知"+ },+ "noFilterResults": "沒有符合此篩選條件的聊天",+ "moreActions": "更多操作",+ "copyChatId": "複製聊天 ID",+ "chatIdCopied": "已複製聊天 ID",+ "copyFailed": "無法複製到剪貼簿",+ "closeChat": "關閉聊天",+ "chatId": "聊天 ID",+ "newChat": {+ "title": "新聊天",+ "searchPlaceholder": "搜尋姓名或連國家代碼的號碼",+ "startWithNumber": "開始與 {{number}} 聊天",+ "contacts": "聯絡人",+ "noContacts": "找不到聯絡人",+ "loadingContacts": "正在載入聯絡人...",+ "contactsError": "無法載入聯絡人",+ "checking": "正在檢查號碼...",+ "notOnWhatsApp": "{{number}} 未有註冊 WhatsApp",+ "checkFailed": "無法檢查該號碼",+ "numberHint": "請輸入連國家代碼的號碼,例如 +852 9123 4567"+ },+ "newGroup": {+ "title": "新增群組",+ "namePlaceholder": "群組名稱",+ "participantsPlaceholder": "搜尋參與者或輸入號碼",+ "addNumber": "加入 {{number}}",+ "selected": "已選擇 {{count}} 個",+ "create": "建立群組",+ "created": "已建立群組「{{name}}」",+ "createFailed": "無法建立群組",+ "removeParticipant": "移除 {{name}}"+ },+ "group": {+ "info": "群組資訊",+ "leave": "退出群組",+ "leaveConfirm": "要退出群組「{{name}}」嗎?",+ "left": "已退出「{{name}}」",+ "leaveFailed": "無法退出群組",+ "editTitle": "編輯群組",+ "tabInfo": "資訊",+ "tabParticipants": "成員",+ "managedBy": "透過 {{session}} 管理",+ "notAdmin": "在 {{session}} 中不是管理員",+ "name": "群組名稱",+ "picture": "群組頭像",+ "pictureHint": "按此處選擇新的群組頭像。",+ "readOnlyHint": "只有群組管理員可以修改此群組。",+ "description": "描述",+ "descriptionPlaceholder": "群組描述(選填)",+ "save": "儲存變更",+ "saved": "群組已更新",+ "saveFailed": "無法儲存群組",+ "loadFailed": "無法載入群組資訊",+ "participantCount": "成員:{{count}}",+ "admin": "管理員",+ "owner": "建立者",+ "makeAdmin": "設為管理員",+ "removeAdmin": "取消管理員",+ "remove": "移除",+ "removeConfirm": "要將 {{name}} 移出群組嗎?",+ "add": "新增",+ "addPlaceholder": "新增附國家代碼的號碼",+ "memberActionFailed": "操作失敗",+ "leaveWarning": "退出後將不再收到該群組的訊息,只有群組管理員可以重新加入你。"+ },+ "rowActions": {+ "actionsFor": "{{name}} 的操作",+ "markUnread": "標為未讀",+ "markUnreadFailed": "無法將聊天標為未讀",+ "clear": "清除聊天",+ "clearConfirm": "要刪除與 {{name}} 的聊天中的所有訊息嗎?",+ "clearWarning": "聊天仍保留在清單中。閘道亦會刪除其儲存的訊息副本(包括媒體);如有需要,請先匯出記錄。",+ "cleared": "已清除與 {{name}} 的聊天",+ "clearFailed": "無法清除聊天",+ "delete": "刪除聊天",+ "deleteConfirm": "要刪除與 {{name}} 的聊天嗎?",+ "deleteWarning": "聊天會從清單中移除,閘道會刪除其儲存的訊息副本(包括媒體)。",+ "deleted": "已刪除與 {{name}} 的聊天",+ "deleteFailed": "無法刪除聊天",+ "saveContact": "儲存聯絡人",+ "renameContact": "重新命名聯絡人",+ "firstName": "名字",+ "lastName": "姓氏(選填)",+ "contactSaved": "聯絡人已儲存",+ "contactSaveFailed": "無法儲存聯絡人",+ "pin": "將聊天置頂",+ "unpin": "取消置頂",+ "pinFailed": "無法置頂聊天。WhatsApp 最多只可置頂三個聊天。",+ "unpinFailed": "無法取消置頂",+ "pinnedLabel": "已置頂",+ "mute": "將通知靜音",+ "unmute": "取消靜音",+ "mutedLabel": "已靜音",+ "muteTitle": "將「{{name}}」靜音",+ "muteHint": "其他參與者不會知道你已將聊天靜音。被提及時你仍會收到通知。",+ "muteFailed": "無法更改通知設定",+ "archive": "封存聊天",+ "unarchive": "取消封存",+ "archived": "聊天已封存",+ "unarchived": "聊天已取消封存",+ "archiveFailed": "無法更改封存",+ "archivedEntry": "已封存",+ "archivedTitle": "已封存的聊天",+ "archiveEmpty": "沒有已封存的聊天",+ "declined": "WhatsApp 拒絕了此變更。",+ "block": "封鎖聯絡人",+ "unblock": "解除封鎖",+ "blockConfirm": "要封鎖 {{name}} 嗎?",+ "blockWarning": "被封鎖的聯絡人將無法再致電給你或傳送訊息。",+ "blocked": "已封鎖 {{name}}",+ "unblocked": "已解除封鎖 {{name}}",+ "blockFailed": "無法更改封鎖狀態",+ "muteFor": {+ "8h": "8 小時",+ "1w": "1 星期",+ "always": "永遠"+ },+ "saveContactUnavailable": "需要已知的電話號碼:此聊天只有私隱 ID(@lid)。"}},"errorBoundary": {diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.cssindex d5f2dc8e7..6751be2ed 100644--- a/dashboard/src/pages/Chats.css+++ b/dashboard/src/pages/Chats.css@@ -1851,3 +1851,755 @@color: var(--text-muted);margin-top: 0.375rem;}++/* =============================================================================+ 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;+ background: transparent;+ border: none;+ border-radius: var(--radius, 8px);+ color: var(--text-secondary);+ cursor: pointer;+ flex-shrink: 0;+ 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 .icon-btn:focus-visible {+ outline: 2px solid var(--primary);+ outline-offset: 2px;+}++.chats-page .icon-btn.small {+ width: 28px;+ height: 28px;+}++.chats-page .icon-btn.danger:hover {+ background: rgba(239, 68, 68, 0.12);+ color: var(--error-text);+}++/* Search and the New chat button share a row. */+.chats-page .chat-search-row {+ display: flex;+ align-items: center;+ gap: 0.5rem;+}++.chats-page .chat-search-row .chat-search-input {+ flex: 1;+ min-width: 0;+}++.chats-page .chat-new-button {+ width: 40px;+ height: 40px;+ border: 1px solid var(--border);+ background: var(--bg-light);+}++/* Quick filters */+.chats-page .chat-filters {+ display: flex;+ flex-wrap: wrap;+ gap: 0.375rem;+}++.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;+}++.chats-page .chat-filter-pill:hover {+ background: var(--bg-light);+ color: var(--text-primary);+}++.chats-page .chat-filter-pill.active {+ background: var(--primary-soft);+ border-color: transparent;+ color: var(--primary-text);+ font-weight: 600;+}++/* The archive's entry at the head of the list, and the way back from its view. */+.chats-page .chat-archive-entry {+ 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;+ cursor: pointer;+}++.chats-page .chat-archive-entry:hover {+ background: var(--bg-light);+}++.chats-page .chat-archive-entry svg {+ color: var(--primary-text);+}++.chats-page .chat-archive-count {+ margin-inline-start: auto;+ font-size: 0.8125rem;+ font-weight: 600;+ color: var(--primary-text);+}++/* Pin and mute marks on a row */+.chats-page .chat-item-flags {+ display: inline-flex;+ align-items: center;+ gap: 0.25rem;+ margin-inline-start: auto;+ color: var(--text-muted);+ flex-shrink: 0;+}++.chats-page .chat-item-flags + .chat-unread-badge {+ margin-inline-start: 0.375rem;+}++/* 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 .chat-item-wrap.has-menu .chat-item-top {+ padding-inline-end: 1.75rem;+}++.chats-page .chat-row-menu {+ position: absolute;+ top: 0.75rem;+ inset-inline-end: 0.75rem;+}++.chats-page .chat-row-menu-trigger {+ 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;+}++.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 .chat-row-menu-trigger:focus-visible {+ outline: 2px solid var(--primary);+ outline-offset: 1px;+}++/* The row's and the room's menus share their entries (ChatActionList). */+.chats-page .room-header-actions {+ margin-inline-start: auto;+ display: flex;+ align-items: center;+ 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;+ padding: 0.375rem;+ display: flex;+ flex-direction: column;+ background: var(--bg-white);+ border: 1px solid var(--border);+ border-radius: 12px;+ box-shadow: var(--shadow-lg);+}++.chats-page .chat-row-menu-group,+.chats-page .room-menu-group {+ 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;+ white-space: nowrap;+ cursor: pointer;+}++.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 .chat-row-menu-popover button svg,+.chats-page .room-menu-popover button svg {+ color: var(--text-secondary);+ 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 .chat-row-menu-popover hr,+.chats-page .room-menu-popover hr {+ width: 100%;+ margin-block: 0.25rem;+ border: none;+ border-top: 1px solid var(--border);+}++/* A disabled entry carries the reason under its label. */+.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(--text-muted);+}++/* 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 {+ 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);+}++.chats-page .new-chat-search {+ margin-block: 0.75rem 0;+ margin-inline: 1.25rem;+}++.chats-page .new-chat-hint {+ margin-block: 0.375rem 0;+ margin-inline: 1.25rem;+ font-size: 0.8125rem;+ color: var(--text-muted);+}++.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);+}++/* 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;+ border: none;+ border-bottom: 1px solid var(--border);+ color: inherit;+ font: inherit;+ text-align: start;+}++.chats-page button.chat-item-card:disabled {+ cursor: progress;+ opacity: 0.75;+}++.chats-page .action-row .chat-item-name {+ font-weight: 500;+}++.chats-page .chat-avatar.action-avatar {+ background: var(--primary);+ border-color: var(--primary);+ color: #fff;+}++.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;+ flex-shrink: 0;+ color: #fff;+}++.chats-page .select-check.checked {+ background: var(--primary);+ border-color: var(--primary);+}++.chats-page .new-group-fields {+ display: flex;+ flex-direction: column;+ gap: 0.625rem;+ padding-block: 0.875rem 0;+ padding-inline: 1.25rem;+}++.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);+ color: var(--text-primary);+ font-size: 0.9375rem;+ outline: none;+}++.chats-page .new-group-name:focus {+ border-color: var(--primary);+ background: var(--bg-white);+}++.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.125rem;+ padding-inline: 0.625rem 0.25rem;+ border-radius: 999px;+ background: var(--primary-soft);+ color: var(--primary-text);+ font-size: 0.8125rem;+}++.chats-page .participant-chip button {+ display: flex;+ padding: 2px;+ border: none;+ border-radius: 50%;+ background: transparent;+ color: inherit;+ cursor: pointer;+}++.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 .new-group-count {+ font-size: 0.875rem;+ color: var(--text-muted);+}++.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;+ font-weight: 600;+ cursor: pointer;+}++.chats-page .new-group-create:disabled {+ opacity: 0.55;+ cursor: not-allowed;+}++/* Group info dialog (the global .modal card, inside the page) */+.chats-page .group-info-modal {+ max-width: 640px;+}++.chats-page .group-info-title {+ display: flex;+ align-items: center;+ gap: 0.875rem;+}++.chats-page .group-info-tile {+ width: 44px;+ height: 44px;+ border-radius: 12px;+ background: var(--primary);+ color: #fff;+ display: flex;+ align-items: center;+ justify-content: center;+ flex-shrink: 0;+}++.chats-page .group-info-heading {+ display: flex;+ flex-direction: column;+ min-width: 0;+}++.chats-page .group-info-subtitle {+ font-size: 0.875rem;+ font-weight: 400;+ 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 .group-info-toolbar .chats-tab {+ display: inline-flex;+ align-items: center;+ gap: 0.375rem;+ padding-inline: 0.875rem;+}++.chats-page .group-info-toolbar .icon-btn {+ 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;+ border: 1px solid var(--border);+ border-radius: var(--radius, 8px);+ background: var(--bg-light);+ color: var(--text-secondary);+ font-size: 0.8125rem;+}++.chats-page .group-info-badge.admin {+ background: var(--primary-soft);+ border-color: transparent;+ color: var(--primary-text);+}++.chats-page .group-info-state {+ display: flex;+ justify-content: center;+ padding: 2rem;+ color: var(--text-muted);+}++.chats-page .group-info-form {+ display: flex;+ flex-direction: column;+ gap: 1rem;+}++.chats-page .group-info-field {+ display: flex;+ flex-direction: column;+ gap: 0.375rem;+ font-size: 0.875rem;+ font-weight: 600;+ color: var(--text-secondary);+}++.chats-page .group-info-field .required {+ color: var(--error);+}++.chats-page .group-info-field input,+.chats-page .group-info-field textarea,+.chats-page .group-info-add input,+.chats-page .chat-dialog-form input {+ 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;+ outline: none;+}++.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 {+ border-color: var(--primary);+ background: var(--bg-white);+ box-shadow: 0 0 0 3px var(--primary-soft);+}++.chats-page .group-info-field input:disabled,+.chats-page .group-info-field textarea:disabled {+ opacity: 0.7;+ cursor: not-allowed;+}++.chats-page .group-info-picture {+ 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 .group-info-add {+ display: flex;+ gap: 0.5rem;+}++.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.8125rem;+ font-weight: 600;+ color: var(--text-muted);+}++.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(--border);+}++.chats-page .group-info-member {+ flex: 1;+ min-width: 0;+ display: flex;+ flex-direction: column;+}++.chats-page .group-info-member .name {+ font-weight: 500;+ color: var(--text-primary);+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+}++.chats-page .group-info-member .number {+ font-size: 0.8125rem;+ color: var(--text-muted);+}++.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);+ font-size: 0.75rem;+ font-weight: 600;+ flex-shrink: 0;+}++.chats-page .group-info-actions {+ display: flex;+ gap: 0.125rem;+ flex-shrink: 0;+}++/* Confirmation, mute and save-contact dialogs: the confirm-modal shape the Sessions page uses. */+.chats-page .confirm-modal {+ max-width: 420px;+}++.chats-page .confirm-modal .modal-body p {+ margin: 0 0 0.5rem;+}++.chats-page .confirm-modal .text-muted {+ color: var(--text-muted);+ font-size: 0.875rem;+}++.chats-page .chat-dialog-options {+ display: flex;+ flex-direction: column;+ gap: 0.625rem;+ margin: 0.75rem 0 0;+ padding: 0;+ border: 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;+}++.chats-page .chat-dialog-options input {+ accent-color: var(--primary);+}++.chats-page .chat-dialog-form {+ display: flex;+ flex-direction: column;+ gap: 0.875rem;+}++.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 .chat-dialog-form .text-muted {+ margin: 0;+ font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;+ font-size: 0.8125rem;+}diff --git a/dashboard/src/pages/Chats.features.test.ts b/dashboard/src/pages/Chats.features.test.tsnew file mode 100644index 000000000..431921035--- /dev/null+++ b/dashboard/src/pages/Chats.features.test.ts@@ -0,0 +1,695 @@+// 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+// 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';+import assert from 'node:assert/strict';+import { createElement } from 'react';+import { QueryClient, QueryClientProvider } from '@tanstack/react-query';+import type { Session, Chat } from '../services/api';+import { resetSocketDouble } from '../test-helpers/socket-io-double.ts';++const SESSION: Session = {+ id: 'session-1',+ name: 'Main',+ status: 'ready',+ phone: '15551234567',+ createdAt: '2026-01-01T00:00:00.000Z',+ updatedAt: '2026-01-01T00:00:00.000Z',+};++// 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' };+let listSecond = false;++// Responses a test holds back until it releases them, by route name.+const gates = new Map<string, Promise<void>>();+function hold(name: string): () => void {+ let release!: () => void;+ gates.set(name, new Promise<void>(resolve => (release = resolve)));+ return release;+}+// When true, the chat and contact writes answer HTTP 200 with `{ success: false }`, as an engine that+// declined to act does.+let declineWrites = false;++const CHAT: Chat = {+ id: '[email protected]',+ name: 'Alice',+ isGroup: false,+ kind: 'individual',+ unreadCount: 0,+ timestamp: 1_700_000_000,+ lastMessage: 'hello from alice',+ archived: false,+ pinned: false,+ muted: false,+};++// A group the account administers, served only when a test turns `listGroup` on.+const GROUP: Chat = {+ ...({} as Chat),+ id: '[email protected]',+ name: 'Team',+ isGroup: true,+ kind: 'group',+ unreadCount: 0,+ timestamp: 1_700_000_000,+ lastMessage: 'hello team',+ archived: false,+ pinned: false,+ muted: false,+};+let listGroup = false;+// The contacts the session's blocklist holds.+let blockedIds: string[] = [];+// Whether the session's own number administers GROUP.+let groupAdmin = true;++const CONTACT = { id: '[email protected]', name: 'Bob', number: '15550002222', isMyContact: true, isBlocked: false };+const ALICE_CONTACT = { id: CHAT.id, name: 'Alice', number: '15550001111', isMyContact: true, isBlocked: false };++// Served when a test turns `listExtra` on: a contact Baileys knows by push name only, listed as Baileys+// lists it (a bare push name, no `~`, `isMyContact: false`), and a chat keyed by a privacy id.+const PUSH_ONLY_CHAT: Chat = { ...CHAT, id: '[email protected]', name: 'Bobby', lastMessage: 'hi' };+const PUSH_ONLY_CONTACT = {+ id: PUSH_ONLY_CHAT.id,+ pushName: 'Bobby',+ number: '628222',+ isMyContact: false,+ isBlocked: false,+};+const LID_CHAT: Chat = { ...CHAT, id: '262813461250071@lid', name: 'Lia', lastMessage: 'from a lid' };+let listExtra = false;+// The number the new-chat tests type, and the id the gateway resolves it to.+const TYPED_NUMBER = '+1 555 000 9999';+const RESOLVED_ID = '[email protected]';+const GROUP_ID = '[email protected]';++interface FetchCall {+ method: string;+ path: string;+ body?: unknown;+}++const fetchCalls: FetchCall[] = [];++function jsonResponse(data: unknown, status = 200): Response {+ return new Response(JSON.stringify(data), { status, headers: { 'Content-Type': 'application/json' } });+}++function installFetchStub(): void {+ globalThis.fetch = (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {+ const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;+ const method = init?.method ?? 'GET';+ const rawPath = url.replace(/^https?:\/\/[^/]+/, '');+ const path = rawPath.replace(`/api/sessions/${SECOND_SESSION.id}/`, `/api/sessions/${SESSION.id}/`);+ const body = typeof init?.body === 'string' ? JSON.parse(init.body) : undefined;+ fetchCalls.push({ method, path: rawPath, body });+ const base = `/api/sessions/${SESSION.id}`;+ const gated = (name: string, response: () => Response) =>+ gates.get(name)?.then(response) ?? Promise.resolve(response());++ if (method === 'GET' && path === '/api/sessions') {+ return Promise.resolve(jsonResponse([SESSION, ...(listSecond ? [SECOND_SESSION] : [])]));+ }+ if (method === 'GET' && path.startsWith(`${base}/chats?`)) {+ return Promise.resolve(+ jsonResponse([CHAT, ...(listGroup ? [GROUP] : []), ...(listExtra ? [PUSH_ONLY_CHAT, LID_CHAT] : [])]),+ );+ }+ const groupPath = `${base}/groups/${encodeURIComponent(GROUP.id)}`;+ if (method === 'GET' && path === groupPath) {+ return Promise.resolve(+ jsonResponse({+ id: GROUP.id,+ name: GROUP.name,+ description: 'old description',+ locked: true,+ participants: [+ { id: `${SESSION.phone}@c.us`, number: SESSION.phone, isAdmin: groupAdmin, isSuperAdmin: false },+ { id: '[email protected]', number: '15550002222', name: 'Bob', isAdmin: false, isSuperAdmin: false },+ ],+ }),+ );+ }+ if (method === 'GET' && path === `${base}/contacts/blocked`) return Promise.resolve(jsonResponse(blockedIds));+ // Writes that answer an acknowledgement: group edits, chat state changes, clearing and deleting a chat,+ // and the contact writes (block, unblock, save).+ const pinRoute = method === 'POST' && path.endsWith('/chats/pin');+ if (pinRoute) return gated('pin', () => jsonResponse({ success: !declineWrites }));+ if (+ (method === 'POST' && /\/chats\/(archive|pin|mute)$/.test(path)) ||+ (/\/contacts\/[^/]+\/block$/.test(path) && method !== 'GET') ||+ (method === 'PUT' && /\/contacts\/[^/]+$/.test(path))+ ) {+ return Promise.resolve(jsonResponse({ success: !declineWrites }));+ }+ if (+ (method === 'POST' && (path === `${base}/chats/unread` || path === `${base}/chats/delete`)) ||+ (method === 'DELETE' && /\/chats\/[^/]+\/messages$/.test(path))+ ) {+ return Promise.resolve(jsonResponse({ success: !declineWrites }));+ }+ if (path.startsWith(`${groupPath}/`)) {+ return Promise.resolve(jsonResponse({ success: true, message: 'ok' }));+ }+ if (method === 'GET' && path.startsWith(`${base}/contacts/profile-pictures`)) {+ return Promise.resolve(jsonResponse({ pictures: {} }));+ }+ if (method === 'GET' && /\/contacts\/[^/]+\/profile-picture$/.test(path)) {+ return Promise.resolve(jsonResponse({ url: null }));+ }+ if (method === 'GET' && path.startsWith(`${base}/contacts/check/`)) {+ return gated('check', () => jsonResponse({ exists: true, whatsappId: RESOLVED_ID }));+ }+ if (method === 'GET' && path.startsWith(`${base}/contacts?`)) {+ return Promise.resolve(jsonResponse([ALICE_CONTACT, CONTACT, ...(listExtra ? [PUSH_ONLY_CONTACT] : [])]));+ }+ if (method === 'GET' && path.startsWith(`${base}/messages?`)) {+ return Promise.resolve(jsonResponse({ messages: [], total: 0 }));+ }+ if (method === 'GET' && /\/messages\/[^/]+\/history/.test(path)) return Promise.resolve(jsonResponse([]));+ if (method === 'POST' && path === `${base}/chats/read`) return Promise.resolve(jsonResponse({ success: true }));+ if (method === 'POST' && path === `${base}/groups`) {+ return gated('createGroup', () => jsonResponse({ id: GROUP_ID, name: (body as { name: string }).name }, 201));+ }+ return Promise.resolve(jsonResponse({ message: `unstubbed ${method} ${path}` }, 404));+ };+}++type RTL = typeof import('@testing-library/react');++let rtl: RTL;+let Chats: (typeof import('./Chats.tsx'))['Chats'];+let RoleProvider: (typeof import('../components/RoleProvider.tsx'))['RoleProvider'];+let ToastProvider: (typeof import('../components/Toast.tsx'))['ToastProvider'];+// Every client a test rendered with: a test that renders twice must not leave the first one's gc timers behind,+// which hold the process open.+const queryClients: QueryClient[] = [];++before(async () => {+ const { installJsdomGlobals } = await import('../test-helpers/jsdom.ts');+ await installJsdomGlobals();+ installFetchStub();+ window.sessionStorage.setItem('openwa_user_role', 'admin');+ window.sessionStorage.setItem('openwa_engine_type', 'baileys');+ window.sessionStorage.setItem('openwa_api_key', 'test-key');+ const { i18nReady } = await import('../i18n/index.ts');+ await i18nReady;+ rtl = await import('@testing-library/react');+ ({ RoleProvider } = await import('../components/RoleProvider.tsx'));+ ({ ToastProvider } = await import('../components/Toast.tsx'));+ ({ Chats } = await import('./Chats.tsx'));+});++afterEach(async () => {+ rtl.cleanup();+ resetSocketDouble();+ for (const client of queryClients.splice(0)) {+ await client.cancelQueries();+ client.clear();+ }+ fetchCalls.length = 0;+ listSecond = false;+ listExtra = false;+ declineWrites = false;+ gates.clear();+ listGroup = false;+ groupAdmin = true;+ blockedIds = [];+ window.sessionStorage.setItem('openwa_user_role', 'admin');+ window.sessionStorage.setItem('openwa_engine_type', 'baileys');+});++function renderPage(): ReturnType<RTL['render']> {+ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false, gcTime: 1_000 } } });+ queryClients.push(queryClient);+ return rtl.render(+ createElement(+ QueryClientProvider,+ { client: queryClient },+ createElement(RoleProvider, null, createElement(ToastProvider, null, createElement(Chats))),+ ),+ );+}++test('a read-only key is offered no new chat', async () => {+ const { screen } = rtl;+ window.sessionStorage.setItem('openwa_user_role', 'viewer');+ renderPage();+ await screen.findByText('Alice');+ assert.ok(!screen.queryByRole('button', { name: 'New chat' }), 'a viewer key was offered a new chat');+});++test('a quick filter that matches no chat says so instead of claiming the account has none', async () => {+ const { screen, fireEvent } = rtl;+ renderPage();+ await screen.findByText('Alice');+ fireEvent.click(screen.getByRole('button', { name: 'Groups' }));+ assert.ok(screen.getByText('No chats match this filter'));+ assert.ok(!screen.queryByText('Alice'), 'the filter left a 1:1 chat in the groups list');+});++test('a typed number is checked with the gateway and opens a chat under the id it resolves to', async () => {+ const { screen, fireEvent, waitFor, within } = rtl;+ const { container } = renderPage();+ await screen.findByText('Alice');+ fireEvent.click(screen.getByRole('button', { name: 'New chat' }));+ fireEvent.change(screen.getByLabelText('Search name or number with country code'), {+ target: { value: TYPED_NUMBER },+ });+ fireEvent.click(screen.getByRole('button', { name: /^Start chat with/ }));++ await waitFor(() => assert.ok(container.querySelector('.room-header'), 'the new chat did not open'));+ assert.ok(+ fetchCalls.some(c => c.method === 'GET' && c.path === `/api/sessions/${SESSION.id}/contacts/check/15550009999`),+ 'the number was not checked with the gateway',+ );+ await within(container.querySelector('.room-header') as HTMLElement).findByText('15550009999');+ assert.ok(!container.querySelector('.new-chat-panel'), 'the panel stayed open over the list');+});++test('a group is created with the picked contacts on Baileys, and whatsapp-web.js is not offered one', async () => {+ const { screen, fireEvent, waitFor, within } = rtl;+ const { container } = renderPage();+ await screen.findByText('Alice');+ fireEvent.click(screen.getByRole('button', { name: 'New chat' }));+ fireEvent.click(screen.getByRole('button', { name: 'New group' }));+ fireEvent.change(screen.getByLabelText('Group name'), { target: { value: 'Team' } });+ fireEvent.click(await screen.findByRole('button', { name: /Bob/ }));+ fireEvent.click(screen.getByRole('button', { name: 'Create group' }));++ await waitFor(() => assert.ok(container.querySelector('.room-header'), 'the new group did not open'));+ const create = fetchCalls.find(c => c.method === 'POST' && c.path === `/api/sessions/${SESSION.id}/groups`);+ assert.deepEqual(create?.body, { name: 'Team', participants: [CONTACT.id] });+ await within(container.querySelector('.room-header') as HTMLElement).findByText('Team');+ rtl.cleanup();++ window.sessionStorage.setItem('openwa_engine_type', 'whatsapp-web.js');+ renderPage();+ await screen.findByText('Alice');+ fireEvent.click(screen.getByRole('button', { name: 'New chat' }));+ await screen.findByText('Bob');+ assert.ok(+ !screen.queryByRole('button', { name: 'New group' }),+ 'whatsapp-web.js, which answers 501, offered a group',+ );+});++test('a group row offers its actions, and marking it unread badges the row', async () => {+ const { screen, fireEvent, waitFor } = rtl;+ listGroup = true;+ renderPage();+ await screen.findByText('Team');+ // Group and 1:1 rows both carry the chevron.+ assert.equal(screen.getAllByRole('button', { name: /^Actions for/ }).length, 2);+ fireEvent.click(screen.getByRole('button', { name: 'Actions for Team' }));+ fireEvent.click(screen.getByRole('button', { name: 'Mark as unread' }));++ await waitFor(() =>+ assert.ok(+ fetchCalls.some(c => c.method === 'POST' && c.path === `/api/sessions/${SESSION.id}/chats/unread`),+ 'the gateway was not asked to mark the chat unread',+ ),+ );+ assert.deepEqual(fetchCalls.find(c => c.path === `/api/sessions/${SESSION.id}/chats/unread`)?.body, {+ chatId: GROUP.id,+ });+ await screen.findByLabelText('Marked as unread');+});++test('leaving a group asks in a dialog first, and only its confirm button tells the gateway', async () => {+ const { screen, fireEvent, waitFor, within } = rtl;+ listGroup = true;+ renderPage();+ await screen.findByText('Team');+ const leavePath = `/api/sessions/${SESSION.id}/groups/${encodeURIComponent(GROUP.id)}/leave`;++ fireEvent.click(screen.getByRole('button', { name: 'Actions for Team' }));+ fireEvent.click(screen.getByRole('button', { name: 'Leave group' }));+ let dialog = await screen.findByRole('dialog');+ assert.ok(within(dialog).getByText('Leave the group "Team"?'));+ fireEvent.click(within(dialog).getByRole('button', { name: 'Cancel' }));+ assert.ok(!screen.queryByRole('dialog'), 'Cancel left the dialog open');+ assert.ok(!fetchCalls.some(c => c.path === leavePath), 'Cancel left the group');++ fireEvent.click(screen.getByRole('button', { name: 'Actions for Team' }));+ fireEvent.click(screen.getByRole('button', { name: 'Leave group' }));+ dialog = await screen.findByRole('dialog');+ fireEvent.click(within(dialog).getByRole('button', { name: 'Leave group' }));+ await waitFor(() =>+ assert.ok(+ fetchCalls.some(c => c.method === 'POST' && c.path === leavePath),+ 'not left',+ ),+ );+ await waitFor(() => assert.ok(!screen.queryByRole('dialog'), 'the dialog stayed open after leaving'));+});++test('the group dialog saves a new name through the subject route and renames the row', async () => {+ const { screen, fireEvent, waitFor, within } = rtl;+ listGroup = true;+ renderPage();+ await screen.findByText('Team');+ fireEvent.click(screen.getByRole('button', { name: 'Actions for Team' }));+ fireEvent.click(screen.getByRole('button', { name: 'Group info' }));++ const dialog = await screen.findByRole('dialog');+ await within(dialog).findByText(`Managed via ${SESSION.name}`);+ fireEvent.change(within(dialog).getByDisplayValue('Team'), { target: { value: 'Team Nord' } });+ fireEvent.click(within(dialog).getByRole('button', { name: 'Save changes' }));++ await waitFor(() =>+ assert.deepEqual(+ fetchCalls.find(c => c.path === `/api/sessions/${SESSION.id}/groups/${encodeURIComponent(GROUP.id)}/subject`)+ ?.body,+ { subject: 'Team Nord' },+ ),+ );+ // The description was not touched, so its route is not called.+ assert.ok(!fetchCalls.some(c => c.path.endsWith('/description')), 'an unchanged description was saved');+ await waitFor(() => assert.ok(screen.getAllByText('Team Nord').length > 0, 'the row kept the old name'));++ fireEvent.click(within(dialog).getByRole('tab', { name: 'Participants' }));+ assert.ok(within(dialog).getByText('Bob'));+ assert.ok(within(dialog).getByRole('button', { name: 'Remove: Bob' }), 'an admin was offered no member actions');+});++test('a member who is no admin sees the group read-only, and a viewer key gets no write actions', async () => {+ const { screen, fireEvent, within } = rtl;+ listGroup = true;+ groupAdmin = false;+ 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');+ 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');+ fireEvent.click(screen.getByRole('button', { name: 'Group info' }));++ const dialog = await screen.findByRole('dialog');+ await within(dialog).findByText(`Not an admin via ${SESSION.name}`);+ assert.ok((within(dialog).getByDisplayValue('Team') as HTMLInputElement).disabled, 'the name is editable');+ assert.ok((within(dialog).getByRole('button', { name: 'Save changes' }) as HTMLButtonElement).disabled);+});++test('a 1:1 row clears its chat and deletes it, each only after its own confirmation', async () => {+ const { screen, fireEvent, waitFor, within } = rtl;+ renderPage();+ await screen.findByText('Alice');+ const chatPath = `/api/sessions/${SESSION.id}/chats`;++ fireEvent.click(screen.getByRole('button', { name: 'Actions for Alice' }));+ // A 1:1 row has no group actions.+ assert.ok(!screen.queryByRole('button', { name: 'Group info' }));+ fireEvent.click(screen.getByRole('button', { name: 'Clear chat' }));+ let dialog = await screen.findByRole('dialog');+ assert.ok(within(dialog).getByText('Delete every message in the chat with Alice?'));+ fireEvent.click(within(dialog).getByRole('button', { name: 'Clear chat' }));+ await waitFor(() =>+ assert.ok(+ fetchCalls.some(c => c.method === 'DELETE' && c.path === `${chatPath}/${encodeURIComponent(CHAT.id)}/messages`),+ 'the chat was not cleared',+ ),+ );+ await waitFor(() => assert.ok(!screen.queryByRole('dialog')));+ assert.ok(screen.getByText('Alice'), 'clearing removed the chat from the list');++ fireEvent.click(screen.getByRole('button', { name: 'Actions for Alice' }));+ fireEvent.click(screen.getByRole('button', { name: 'Delete chat' }));+ dialog = await screen.findByRole('dialog');+ fireEvent.click(within(dialog).getByRole('button', { name: 'Delete chat' }));+ await waitFor(() =>+ assert.deepEqual(fetchCalls.find(c => c.method === 'POST' && c.path === `${chatPath}/delete`)?.body, {+ chatId: CHAT.id,+ }),+ );+ await waitFor(() => assert.ok(!screen.queryByText('Alice'), 'the deleted chat stayed in the list'));+});++/** Open a row's chevron menu and pick one of its actions. */+function pickRowAction(name: string, action: string): void {+ const { screen, fireEvent } = rtl;+ fireEvent.click(screen.getByRole('button', { name: `Actions for ${name}` }));+ fireEvent.click(screen.getByRole('button', { name: action }));+}++test("a row's menu sits fixed above the list, and scrolling the list closes it", async () => {+ const { screen, fireEvent } = rtl;+ const { container } = renderPage();+ await screen.findByText('Alice');+ fireEvent.click(screen.getByRole('button', { name: 'Actions for Alice' }));+ const popover = container.querySelector('.chat-row-menu-popover') as HTMLElement;+ assert.equal(popover.style.position, 'fixed', 'the menu can be clipped by the scrolling list');+ fireEvent.scroll(popover.closest('.chat-item-wrap')?.parentElement as HTMLElement);+ assert.equal(container.querySelector('.chat-row-menu-popover'), null, 'the menu stayed open, adrift from its row');+});++test('archiving a chat moves it into the archive view, and unarchiving brings it back', async () => {+ const { screen, fireEvent, waitFor } = rtl;+ renderPage();+ await screen.findByText('Alice');+ pickRowAction('Alice', 'Archive chat');+ await waitFor(() =>+ assert.deepEqual(fetchCalls.find(c => c.path === `/api/sessions/${SESSION.id}/chats/archive`)?.body, {+ chatId: CHAT.id,+ archive: true,+ }),+ );+ await waitFor(() => assert.ok(!screen.queryByText('Alice'), 'the archived chat stayed in the main list'));++ fireEvent.click(screen.getByRole('button', { name: /^Archived/ }));+ await screen.findByText('Alice');+ pickRowAction('Alice', 'Unarchive chat');+ await waitFor(() => assert.ok(!screen.queryByText('Alice'), 'the unarchived chat stayed in the archive view'));+ fireEvent.click(screen.getByRole('button', { name: 'Archived chats' }));+ await screen.findByText('Alice');+});++test('a pinned chat leads the list with a pin, and a muted one carries the mute it was given', async () => {+ const { screen, fireEvent, waitFor, within } = rtl;+ listGroup = true;+ const { container } = renderPage();+ await screen.findByText('Team');++ pickRowAction('Team', 'Pin chat');+ await waitFor(() =>+ assert.equal(container.querySelector('.chats-list .chat-item-name')?.textContent, 'Team', 'not pinned first'),+ );+ assert.ok(screen.getByRole('img', { name: 'Pinned' }));++ pickRowAction('Alice', 'Mute notifications');+ const dialog = await screen.findByRole('dialog');+ fireEvent.click(within(dialog).getByLabelText('Always'));+ fireEvent.click(within(dialog).getByRole('button', { name: 'Mute notifications' }));+ await waitFor(() =>+ assert.deepEqual(fetchCalls.find(c => c.path === `/api/sessions/${SESSION.id}/chats/mute`)?.body, {+ chatId: CHAT.id,+ muteUntil: Date.UTC(2100, 0, 1),+ }),+ );+ await screen.findByRole('img', { name: 'Muted' });+});++test('blocking a contact asks first, and the menu then offers to unblock it', async () => {+ const { screen, fireEvent, waitFor, within } = rtl;+ renderPage();+ await screen.findByText('Alice');+ pickRowAction('Alice', 'Block contact');+ const dialog = await screen.findByRole('dialog');+ assert.ok(within(dialog).getByText('Block Alice?'));+ blockedIds = [CHAT.id];+ fireEvent.click(within(dialog).getByRole('button', { name: 'Block contact' }));+ await waitFor(() =>+ assert.ok(+ fetchCalls.some(+ c =>+ c.method === 'POST' && c.path === `/api/sessions/${SESSION.id}/contacts/${encodeURIComponent(CHAT.id)}/block`,+ ),+ 'the contact was not blocked',+ ),+ );+ await waitFor(() => assert.ok(!screen.queryByRole('dialog')));+ fireEvent.click(screen.getByRole('button', { name: 'Actions for Alice' }));+ await screen.findByRole('button', { name: 'Unblock contact' });+});++test('saving a contact sends its name to the address book and renames the row', async () => {+ const { screen, fireEvent, waitFor, within } = rtl;+ renderPage();+ await screen.findByText('Alice');+ pickRowAction('Alice', 'Rename contact');+ const dialog = await screen.findByRole('dialog');+ fireEvent.change(within(dialog).getByLabelText('First name'), { target: { value: 'Alice' } });+ fireEvent.change(within(dialog).getByLabelText('Last name (optional)'), { target: { value: 'Smith' } });+ fireEvent.click(within(dialog).getByRole('button', { name: 'Save' }));+ await waitFor(() =>+ assert.deepEqual(+ fetchCalls.find(+ c => c.method === 'PUT' && c.path === `/api/sessions/${SESSION.id}/contacts/${encodeURIComponent(CHAT.id)}`,+ )?.body,+ { firstName: 'Alice', lastName: 'Smith' },+ ),+ );+ await screen.findByText('Alice Smith');+});++// ── 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 },+ });+}++const settle = async () => {+ await rtl.act(async () => {+ await new Promise(resolve => setTimeout(resolve, 0));+ });+};++test('a number lookup that answers after the panel closed and the session changed opens nothing', async () => {+ const { screen, fireEvent, waitFor } = rtl;+ listSecond = true;+ const release = hold('check');+ const { container } = renderPage();+ await screen.findByText('Alice');+ fireEvent.click(screen.getByRole('button', { name: 'New chat' }));+ fireEvent.change(screen.getByLabelText('Search name or number with country code'), {+ target: { value: TYPED_NUMBER },+ });+ fireEvent.click(screen.getByRole('button', { name: /^Start chat with/ }));+ await waitFor(() =>+ assert.ok(+ fetchCalls.some(c => c.path.includes('/contacts/check/')),+ 'no lookup was made',+ ),+ );++ fireEvent.click(screen.getByRole('button', { name: 'Back' }));+ switchSession(container, SECOND_SESSION.id);+ await waitFor(() =>+ assert.equal((container.querySelector('select.session-selector') as HTMLSelectElement).value, SECOND_SESSION.id),+ );+ release();+ await settle();++ assert.equal(container.querySelector('.room-header'), null, "A's lookup opened a chat on B");+ assert.ok(!screen.queryByText('15550009999'), "A's lookup added a row to B's list");+});++test('a group created after the session changed is not opened on the new session', async () => {+ const { screen, fireEvent, waitFor } = rtl;+ listSecond = true;+ const release = hold('createGroup');+ const { container } = renderPage();+ await screen.findByText('Alice');+ fireEvent.click(screen.getByRole('button', { name: 'New chat' }));+ fireEvent.click(screen.getByRole('button', { name: 'New group' }));+ fireEvent.change(screen.getByLabelText('Group name'), { target: { value: 'Late team' } });+ fireEvent.click(await screen.findByRole('button', { name: /Bob/ }));+ fireEvent.click(screen.getByRole('button', { name: 'Create group' }));+ await waitFor(() => assert.ok(fetchCalls.some(c => c.method === 'POST' && c.path.endsWith('/groups'))));++ // Back to the new-chat view, Back again out of the panel, then to the other 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);+ await waitFor(() =>+ assert.equal((container.querySelector('select.session-selector') as HTMLSelectElement).value, SECOND_SESSION.id),+ );+ release();+ await settle();++ assert.equal(container.querySelector('.room-header'), null, 'the new group opened on the other session');+ assert.ok(!screen.queryByText('Late team'), "the group was added to the other session's list");+});++test("a pin that answers after a switch does not pin the other session's chat with the same id", async () => {+ const { screen, waitFor } = rtl;+ listSecond = true;+ const release = hold('pin');+ const { container } = renderPage();+ await screen.findByText('Alice');+ pickRowAction('Alice', 'Pin chat');+ 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);+ await waitFor(() =>+ assert.equal((container.querySelector('select.session-selector') as HTMLSelectElement).value, SECOND_SESSION.id),+ );+ await screen.findByText('Alice');+ release();+ await settle();++ assert.ok(!screen.queryByRole('img', { name: 'Pinned' }), "B's row was pinned by A's late answer");+});++test('a clear or delete the engine declines keeps the chat and its dialog, and says it failed', async () => {+ const { screen, fireEvent, within } = rtl;+ declineWrites = true;+ renderPage();+ await screen.findByText('Alice');++ pickRowAction('Alice', 'Clear chat');+ let dialog = await screen.findByRole('dialog');+ fireEvent.click(within(dialog).getByRole('button', { name: 'Clear chat' }));+ await screen.findByText('Could not clear the chat');+ assert.ok(screen.getByRole('dialog'), 'the dialog closed on a declined clear');+ assert.ok(screen.getAllByText('hello from alice').length > 0, 'the preview was cleared although nothing was');+ fireEvent.click(within(dialog).getByRole('button', { name: 'Cancel' }));++ pickRowAction('Alice', 'Delete chat');+ dialog = await screen.findByRole('dialog');+ fireEvent.click(within(dialog).getByRole('button', { name: 'Delete chat' }));+ await screen.findByText('Could not delete the chat');+ assert.ok(screen.getByRole('dialog'), 'the dialog closed on a declined delete');+ assert.ok(screen.getAllByText('Alice').length > 0, 'the row was removed although the chat was not');+});++test('a mark-as-unread the engine declines leaves the row read', async () => {+ const { screen } = rtl;+ declineWrites = true;+ renderPage();+ await screen.findByText('Alice');+ pickRowAction('Alice', 'Mark as unread');+ await screen.findByText('Could not mark the chat as unread');+ assert.ok(!screen.queryByLabelText('Marked as unread'), 'the row was badged although the chat was not marked');+});++test('a contact Baileys knows by push name only is unsaved: Unknown lists it, and its menu offers Save', async () => {+ const { screen, fireEvent } = rtl;+ listExtra = true;+ renderPage();+ await screen.findByText('Bobby');++ fireEvent.click(screen.getByRole('button', { name: 'Unknown' }));+ assert.ok(screen.getByText('Bobby'), 'the push-name-only contact left the Unknown filter');+ assert.ok(!screen.queryByText('Alice'), 'a saved contact is listed as unknown');++ fireEvent.click(screen.getByRole('button', { name: 'Actions for Bobby' }));+ assert.ok(screen.getByRole('button', { name: /^Save contact/ }));+ assert.ok(!screen.queryByRole('button', { name: /^Rename contact/ }), 'an unsaved contact is offered Rename');+});++test('a chat keyed by a privacy id offers Save contact disabled, with the reason, and sends nothing', async () => {+ const { screen, fireEvent } = rtl;+ listExtra = true;+ renderPage();+ await screen.findByText('Lia');+ fireEvent.click(screen.getByRole('button', { name: 'Actions for Lia' }));+ const save = screen.getByRole('button', { name: /^Save contact/ }) as HTMLButtonElement;+ assert.equal(save.disabled, true, 'Save is offered for a @lid chat');+ assert.match(save.textContent ?? '', /privacy id \(@lid\)/);+ fireEvent.click(save);+ assert.ok(!screen.queryByRole('dialog'), 'the save dialog opened for a @lid chat');+ assert.ok(!fetchCalls.some(c => c.method === 'PUT' && c.path.includes('/contacts/')), 'a @lid id was sent');+});diff --git a/dashboard/src/pages/Chats.tsx b/dashboard/src/pages/Chats.tsxindex f9c30ecb8..717b248c4 100644--- a/dashboard/src/pages/Chats.tsx+++ b/dashboard/src/pages/Chats.tsx@@ -3,8 +3,27 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';import { Trans, useTranslation } from 'react-i18next';import { nextReconnectState } from '../utils/reconnectState';import { applyIncomingToChatList, promoteChatWithSnippet } from '../utils/chatList';-import { filterChats, filterChannels, groupStatusesByContact } from '../utils/chatFilters';-import { ArrowLeft, Loader2, Megaphone, CircleDashed, AlertCircle, MessageSquare } from 'lucide-react';+import {+ applyChatListFilter,+ contactKey,+ filterChats,+ filterChannels,+ groupStatusesByContact,+ phoneContactId,+ savedContactKeySet,+ type ChatListFilter,+} from '../utils/chatFilters';+import {+ ArrowLeft,+ Loader2,+ Megaphone,+ CircleDashed,+ AlertCircle,+ MessageSquare,+ CircleEllipsis,+ Copy,+ X,+} from 'lucide-react';import { useProfilePicture } from '../hooks/useProfilePicture';import { useProfilePictures } from '../hooks/useProfilePictures';import { useResolvedPhone } from '../hooks/useResolvedPhone';@@ -12,6 +31,7 @@ import { formatPhoneForDisplay } from '../utils/formatPhone';import {sessionApi,messageApi,+ contactApi,asMessageType,type Session,type Chat,@@ -58,6 +78,12 @@ 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 './Chats.css';// Quiet window for coalescing mark-as-read RPCs (see markReadCoalescer below).@@ -94,6 +120,30 @@ interface IncomingWsMessage {// system face); 3–5 are legacy slots older clients still emit. Approximated with generic// families/weights since the actual faces are proprietary; slot 0 and unknown slots keep the UI// default.+// The confirmation dialog's copy for each destructive chat row action; its confirm button repeats the title.+const CONFIRM_TEXT = {+ leave: {+ title: 'chats.group.leave',+ question: 'chats.group.leaveConfirm',+ warning: 'chats.group.leaveWarning',+ },+ clear: {+ title: 'chats.rowActions.clear',+ question: 'chats.rowActions.clearConfirm',+ warning: 'chats.rowActions.clearWarning',+ },+ block: {+ title: 'chats.rowActions.block',+ question: 'chats.rowActions.blockConfirm',+ warning: 'chats.rowActions.blockWarning',+ },+ delete: {+ title: 'chats.rowActions.delete',+ question: 'chats.rowActions.deleteConfirm',+ warning: 'chats.rowActions.deleteWarning',+ },+} as const;+const STATUS_FONT: Record<number, { family?: string; weight?: number }> = {1: { family: 'serif' },2: { family: 'cursive' },@@ -121,7 +171,7 @@ const statusFontStyle = (font?: number): { fontFamily?: string; fontWeight?: numexport function Chats() {const { t } = useTranslation();useDocumentTitle(t('nav.chats'));- const { error: showErrorToast, warning: showWarningToast } = useToast();+ const { error: showErrorToast, warning: showWarningToast, success: showSuccessToast } = useToast();const { canWrite, engineType } = useRole();// Sessions list & active session@@ -133,6 +183,25 @@ export function Chats() {const [chats, setChats] = useState<Chat[]>([]);const [loadingChats, setLoadingChats] = useState<boolean>(false);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.+ const [showNewChat, setShowNewChat] = 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.+ const [confirmAction, setConfirmAction] = useState<{+ 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);// Selected chat & message historyconst [activeChat, setActiveChat] = useState<Chat | null>(null);@@ -397,6 +466,14 @@ 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.+ setShowNewChat(false);+ setGroupDialogChat(null);+ setConfirmAction(null);+ setMuteDialogChat(null);+ setContactDialogChat(null);+ setShowArchived(false);}return () => {for (const controller of loads) controller.abort();@@ -447,9 +524,12 @@ export function Chats() {// effects flush would otherwise see the previous list, miss the chat and refetch the whole list.const chatsRef = useRef(chats);const activeChatIdRef = useRef<string | undefined>(undefined);+ // The session on screen, for requests that answer later to check they still belong to it.+ const selectedSessionRef = useRef(selectedSessionId);useLayoutEffect(() => {chatsRef.current = chats;activeChatIdRef.current = activeChat?.id;+ selectedSessionRef.current = selectedSessionId;});// A request that settles after the page is left no longer finds the chat open, so its follow-ups// (the reconnect mark-as-read) do nothing.@@ -984,7 +1064,283 @@ export function Chats() {// 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.- const filteredChats = filterChats(chats, searchQuery);+ // 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({+ queryKey: ['contacts', selectedSessionId],+ queryFn: () => contactApi.list(selectedSessionId),+ enabled: Boolean(selectedSessionId),+ staleTime: 5 * 60 * 1000,+ // contactApi.list already retried a throttled page; another attempt would walk every page again.+ retry: false,+ });+ const savedContactKeys = useMemo(() => savedContactKeySet(contactsQuery.data), [contactsQuery.data]);++ const searching = searchQuery.trim() !== '';+ const searchedChats = filterChats(chats, searchQuery);+ const archivedCount = filterChats(chats, '').filter(c => c.archived).length;+ const shownChats = applyChatListFilter(+ searching ? searchedChats : searchedChats.filter(c => c.archived === showArchived),+ chatFilter,+ savedContactKeys,+ );+ const filteredChats = showArchived+ ? shownChats+ : [...shownChats.filter(c => c.pinned), ...shownChats.filter(c => !c.pinned)];++ // Open a chat picked in the new-chat panel. A chat with no history is not in the engine's list, so+ // it is added to the sidebar locally until the first message, or the next list load, settles it.+ // The filter and search are cleared so the opened chat is visible in the list. A chat the panel found+ // through another session (a lookup that answered after a switch) is dropped: opening it here would+ // send the next message through the wrong account.+ const handleOpenNewChat = (chat: Chat, sessionId: string) => {+ if (sessionId !== selectedSessionRef.current) return;+ const existing = chats.find(c => c.id === chat.id);+ if (!existing) setChats(prev => [chat, ...prev]);+ setActiveTab('chats');+ setActiveChannel(null);+ setActiveStatusContactId(null);+ setActiveChat(existing ?? chat);+ setShowNewChat(false);+ setChatFilter('all');+ setSearchQuery('');+ };++ // Chat row actions. Everything but the info views is an operator route, so a read-only key gets only those.+ //+ // Every action is bound to the session it started in. Two sessions can list the same chat id (a group+ // both accounts are in), and a request that answers after a switch changed only the session it went to:+ // its result must not land on the list or the open chat of the session now selected.+ const stillOn = (sessionId: string) => sessionId === selectedSessionRef.current;++ const renameChat = useCallback((sessionId: string, chatId: string, name: string) => {+ if (sessionId !== selectedSessionRef.current) return;+ setChats(prev => prev.map(c => (c.id === chatId ? { ...c, name } : c)));+ setActiveChat(prev => (prev?.id === chatId ? { ...prev, name } : prev));+ }, []);++ // Several chat routes answer HTTP 200 with `{ success: false }` when the engine declined to act (WhatsApp+ // keeps at most three chats pinned; Baileys cannot clear or delete a chat it knows no last message of),+ // which is a failure here: nothing changed, so nothing local changes either.+ const expectSuccess = (result: { success: boolean }) => {+ if (!result.success) throw new Error(t('chats.rowActions.declined'));+ };+ const failWith = (key: string) => (err: unknown) =>+ showErrorToast(t(key), err instanceof Error ? err.message : undefined);++ const patchChat = (sessionId: string, chatId: string, patch: Partial<Chat>) => {+ if (!stillOn(sessionId)) return;+ setChats(prev => prev.map(c => (c.id === chatId ? { ...c, ...patch } : c)));+ setActiveChat(prev => (prev?.id === chatId ? { ...prev, ...patch } : prev));+ };++ const handleMarkUnread = async (chat: Chat) => {+ const sessionId = selectedSessionId;+ try {+ expectSuccess(await sessionApi.markChatUnread(sessionId, chat.id));+ if (!stillOn(sessionId)) return;+ // A negative count is how the list shows a chat marked unread (a badge with no number).+ patchChat(sessionId, chat.id, { unreadCount: -1 });+ if (activeChatIdRef.current === chat.id) setActiveChat(null);+ } catch (err) {+ failWith('chats.rowActions.markUnreadFailed')(err);+ }+ };++ // The blocklist decides whether a 1:1 chat offers Block or Unblock. Only a key that can act on it reads it.+ const blockedQuery = useQuery({+ queryKey: ['contacts-blocked', selectedSessionId],+ queryFn: () => contactApi.listBlocked(selectedSessionId),+ enabled: Boolean(selectedSessionId) && canWrite,+ staleTime: 60_000,+ retry: false,+ });+ const isBlocked = (chat: Chat) =>+ (blockedQuery.data ?? []).some(id => id === chat.id || id.split('@')[0] === chat.id.split('@')[0]);++ // The address book is keyed by phone number, so a contact can be saved only under a phone-based id: the+ // chat's own when it has one, else, for the open chat, the number the engine resolved for its @lid. The+ // digits of a @lid are no phone number and are never used as one.+ const addressbookIdOf = (chat: Chat): string | null =>+ phoneContactId(chat.id) ??+ (chat.id === activeChat?.id && resolvedPhoneQ.data ? `${resolvedPhoneQ.data.replace(/\D/g, '')}@c.us` : null);++ const handleTogglePin = (chat: Chat) => {+ const sessionId = selectedSessionId;+ return sessionApi+ .pinChat(sessionId, chat.id, !chat.pinned)+ .then(expectSuccess)+ .then(() => patchChat(sessionId, chat.id, { pinned: !chat.pinned }))+ .catch(failWith(chat.pinned ? 'chats.rowActions.unpinFailed' : 'chats.rowActions.pinFailed'));+ };++ const handleToggleArchive = (chat: Chat) => {+ const sessionId = selectedSessionId;+ return sessionApi+ .archiveChat(sessionId, chat.id, !chat.archived)+ .then(expectSuccess)+ .then(() => {+ showSuccessToast(t(chat.archived ? 'chats.rowActions.unarchived' : 'chats.rowActions.archived'));+ patchChat(sessionId, chat.id, { archived: !chat.archived });+ })+ .catch(failWith('chats.rowActions.archiveFailed'));+ };++ const MUTE_FOREVER = Date.UTC(2100, 0, 1);+ const handleMute = async (chat: Chat, duration: MuteDuration | null) => {+ const sessionId = selectedSessionId;+ const until =+ duration === null+ ? null+ : duration === 'always'+ ? MUTE_FOREVER+ : Date.now() + (duration === '8h' ? 8 * 3_600_000 : 7 * 86_400_000);+ setDialogBusy(true);+ try {+ expectSuccess(await sessionApi.muteChat(sessionId, chat.id, until));+ // The list reports an indefinite mute as expiry 0.+ patchChat(sessionId, chat.id, {+ muted: until !== null,+ muteExpiration: until === null ? undefined : duration === 'always' ? 0 : until,+ });+ if (stillOn(sessionId)) setMuteDialogChat(null);+ } catch (err) {+ failWith('chats.rowActions.muteFailed')(err);+ } finally {+ setDialogBusy(false);+ }+ };++ const handleSaveContact = async (chat: Chat, firstName: string, lastName: string) => {+ const sessionId = selectedSessionId;+ const contactId = addressbookIdOf(chat);+ if (!contactId) return;+ setDialogBusy(true);+ try {+ expectSuccess(await contactApi.upsert(sessionId, contactId, firstName, lastName || undefined));+ showSuccessToast(t('chats.rowActions.contactSaved'));+ void queryClient.invalidateQueries({ queryKey: ['contacts', sessionId] });+ renameChat(sessionId, chat.id, [firstName, lastName].filter(Boolean).join(' '));+ if (stillOn(sessionId)) setContactDialogChat(null);+ } catch (err) {+ failWith('chats.rowActions.contactSaveFailed')(err);+ } finally {+ setDialogBusy(false);+ }+ };++ const handleUnblock = (chat: Chat) => {+ const sessionId = selectedSessionId;+ return contactApi+ .unblock(sessionId, chat.id)+ .then(expectSuccess)+ .then(() => {+ showSuccessToast(t('chats.rowActions.unblocked', { name: chat.name || chat.id.split('@')[0] }));+ return queryClient.invalidateQueries({ queryKey: ['contacts-blocked', sessionId] });+ })+ .catch(failWith('chats.rowActions.blockFailed'));+ };++ const rowActions: ChatRowActions = {+ onGroupInfo: setGroupDialogChat,+ onSaveContact: canWrite ? setContactDialogChat : undefined,+ canSaveContact: chat => addressbookIdOf(chat) !== null,+ isSavedContact: chat => savedContactKeys?.has(contactKey(chat.id)) ?? false,+ onTogglePin: canWrite ? chat => void handleTogglePin(chat) : undefined,+ onMute: canWrite ? chat => (chat.muted ? void handleMute(chat, null) : setMuteDialogChat(chat)) : undefined,+ onToggleArchive: canWrite ? chat => void handleToggleArchive(chat) : undefined,+ onMarkUnread: canWrite ? chat => void handleMarkUnread(chat) : undefined,+ onLeaveGroup: canWrite ? chat => setConfirmAction({ kind: 'leave', chat }) : undefined,+ onToggleBlock: canWrite+ ? chat => (isBlocked(chat) ? void handleUnblock(chat) : setConfirmAction({ kind: 'block', chat }))+ : undefined,+ onClear: canWrite ? chat => setConfirmAction({ kind: 'clear', chat }) : undefined,+ onDelete: canWrite ? chat => setConfirmAction({ kind: 'delete', chat }) : undefined,+ isBlocked,+ };++ // Leaving a group, clearing a chat and deleting one all run from the confirmation dialog. On success the+ // dialog closes; on a failure, a declined one included, it stays open, so the action can be tried again.+ // A switch closes the dialog, and a request that answers after it changes nothing on the new session.+ const runConfirmedAction = async () => {+ if (!confirmAction) return;+ const { kind, chat } = confirmAction;+ const sessionId = selectedSessionId;+ const name = chat.name || chat.id.split('@')[0];+ setConfirmBusy(true);+ try {+ if (kind === 'leave') {+ expectSuccess(await sessionApi.leaveGroup(sessionId, chat.id));+ showSuccessToast(t('chats.group.left', { name }));+ if (stillOn(sessionId)) void loadChats(sessionId, { background: true });+ } else if (kind === 'block') {+ expectSuccess(await contactApi.block(sessionId, chat.id));+ showSuccessToast(t('chats.rowActions.blocked', { name }));+ await queryClient.invalidateQueries({ queryKey: ['contacts-blocked', sessionId] });+ } else if (kind === 'clear') {+ expectSuccess(await sessionApi.clearChatMessages(sessionId, chat.id));+ showSuccessToast(t('chats.rowActions.cleared', { name }));+ patchChat(sessionId, chat.id, { lastMessage: '', unreadCount: 0 });+ // The thread cache holds the messages just deleted; the next open reads the empty chat.+ await queryClient.invalidateQueries({ queryKey: messagesQueryKey(sessionId, chat.id) });+ } else {+ expectSuccess(await sessionApi.deleteChat(sessionId, chat.id));+ showSuccessToast(t('chats.rowActions.deleted', { name }));+ if (stillOn(sessionId)) setChats(prev => prev.filter(c => c.id !== chat.id));+ queryClient.removeQueries({ queryKey: messagesQueryKey(sessionId, chat.id) });+ }+ if (!stillOn(sessionId)) return;+ if ((kind === 'leave' || kind === 'delete') && activeChatIdRef.current === chat.id) setActiveChat(null);+ setConfirmAction(null);+ } catch (err) {+ const failed =+ kind === 'leave'+ ? 'chats.group.leaveFailed'+ : kind === 'block'+ ? 'chats.rowActions.blockFailed'+ : kind === 'clear'+ ? 'chats.rowActions.clearFailed'+ : 'chats.rowActions.deleteFailed';+ failWith(failed)(err);+ } finally {+ setConfirmBusy(false);+ }+ };++ const handleCopyChatId = async () => {+ if (!activeChat) return;+ setRoomMenuOpen(false);+ try {+ await navigator.clipboard.writeText(activeChat.id);+ showSuccessToast(t('chats.chatIdCopied'));+ } catch (err) {+ showErrorToast(t('chats.copyFailed'), err instanceof Error ? err.message : undefined);+ }+ };++ // The overflow menu closes on a press outside it, on Escape, and with the chat it belongs to. Escape+ // is taken in the capture phase and marked handled, like the emoji picker's, so the page's own+ // handler below leaves the room open.+ useEffect(() => {+ setRoomMenuOpen(false);+ }, [activeChat?.id]);+ useEffect(() => {+ if (!roomMenuOpen) return;+ const closeOnOutsidePress = (event: MouseEvent) => {+ if (!roomMenuRef.current?.contains(event.target as Node)) setRoomMenuOpen(false);+ };+ const closeOnEscape = (event: KeyboardEvent) => {+ if (event.key !== 'Escape' || event.isComposing || event.defaultPrevented) return;+ event.preventDefault();+ setRoomMenuOpen(false);+ };+ document.addEventListener('mousedown', closeOnOutsidePress);+ document.addEventListener('keydown', closeOnEscape, true);+ return () => {+ document.removeEventListener('mousedown', closeOnOutsidePress);+ document.removeEventListener('keydown', closeOnEscape, true);+ };+ }, [roomMenuOpen]);// The channels zero-state ("not subscribed to any channels") stays keyed on the UNFILTERED list// below, so a non-matching search renders an empty list rather than claiming there are none.const filteredChannels = filterChannels(channelsQuery.data ?? [], searchQuery);@@ -1021,12 +1377,13 @@ export function Chats() {if (activeStatusContactId !== null) setActiveStatusContactId(null);else if (activeChannel) setActiveChannel(null);else if (activeChat) setActiveChat(null);+ else if (showNewChat) setShowNewChat(false);else return;event.preventDefault();};document.addEventListener('keydown', closeOpenViewOnEscape);return () => document.removeEventListener('keydown', closeOpenViewOnEscape);- }, [activeStatusContactId, activeChannel, activeChat]);+ }, [activeStatusContactId, activeChannel, activeChat, 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`.@@ -1095,6 +1452,16 @@ export function Chats() {searchQuery={searchQuery}onSearchQueryChange={setSearchQuery}onComposeStatus={() => setComposeOpen(true)}+ onNewChat={canWrite ? () => setShowNewChat(true) : undefined}+ newChatPanel={+ canWrite && showNewChat ? (+ <NewChatPanel+ sessionId={selectedSessionId}+ onOpenChat={handleOpenNewChat}+ onClose={() => setShowNewChat(false)}+ />+ ) : null+ }formatChatTime={formatChatTime}chatsTab={{loading: loadingChats,@@ -1102,6 +1469,10 @@ export function Chats() {activeChatId: activeChat?.id,pictures: listPics.data,onSelectChat: setActiveChat,+ filter: chatFilter,+ onFilterChange: setChatFilter,+ rowActions,+ archive: { count: archivedCount, showing: showArchived, onToggle: () => setShowArchived(v => !v) },}}channelsTab={{engineLoading: engineType === null,@@ -1158,6 +1529,37 @@ export function Chats() {{activeChat.id}</span></div>+ <div className="room-header-actions">+ <div className="room-menu" ref={roomMenuRef}>+ <button+ type="button"+ className={`icon-btn room-menu-trigger ${roomMenuOpen ? 'active' : ''}`}+ onClick={() => setRoomMenuOpen(open => !open)}+ title={t('chats.moreActions')}+ aria-label={t('chats.moreActions')}+ aria-expanded={roomMenuOpen}+ >+ <CircleEllipsis size={22} />+ </button>+ {/* A disclosure of plain buttons, not role="menu": it keeps no roving focus or arrow+ keys, and the role would promise them. */}+ {roomMenuOpen && (+ <div className="room-menu-popover">+ {/* The row's actions, then what only an open room needs. */}+ <ChatActions chat={activeChat} actions={rowActions} onPicked={() => setRoomMenuOpen(false)} />+ <hr />+ <button type="button" onClick={() => void handleCopyChatId()}>+ <Copy size={16} />+ {t('chats.copyChatId')}+ </button>+ <button type="button" onClick={() => setActiveChat(null)}>+ <X size={16} />+ {t('chats.closeChat')}+ </button>+ </div>+ )}+ </div>+ </div></header>{/* Messages body (list, media, reactions, scroll-to-bottom) — components/chats/ChatThread. */}@@ -1311,6 +1713,64 @@ export function Chats() {onNavigate={setLightboxIndex}/>+ {groupDialogChat && sessions.some(s => s.id === selectedSessionId) && (+ <GroupInfoDialog+ session={sessions.find(s => s.id === selectedSessionId)!}+ group={groupDialogChat}+ onClose={() => setGroupDialogChat(null)}+ onRenamed={renameChat}+ />+ )}++ {confirmAction && (+ <Modal+ open+ onClose={() => setConfirmAction(null)}+ title={t(CONFIRM_TEXT[confirmAction.kind].title)}+ className="confirm-modal"+ closeLabel={t('common.close')}+ footer={+ <>+ <button className="btn-secondary" onClick={() => setConfirmAction(null)} disabled={confirmBusy}>+ {t('common.cancel')}+ </button>+ <button className="btn-danger" onClick={() => void runConfirmedAction()} disabled={confirmBusy}>+ {confirmBusy ? (+ <Loader2 className="animate-spin" size={16} />+ ) : (+ t(CONFIRM_TEXT[confirmAction.kind].title)+ )}+ </button>+ </>+ }+ >+ <p>+ {t(CONFIRM_TEXT[confirmAction.kind].question, {+ name: confirmAction.chat.name || confirmAction.chat.id.split('@')[0],+ })}+ </p>+ <p className="text-muted">{t(CONFIRM_TEXT[confirmAction.kind].warning)}</p>+ </Modal>+ )}++ {muteDialogChat && (+ <MuteChatDialog+ chat={muteDialogChat}+ busy={dialogBusy}+ onMute={duration => void handleMute(muteDialogChat, duration)}+ onClose={() => setMuteDialogChat(null)}+ />+ )}++ {contactDialogChat && (+ <SaveContactDialog+ chat={contactDialogChat}+ busy={dialogBusy}+ onSave={(first, last) => void handleSaveContact(contactDialogChat, first, last)}+ onClose={() => setContactDialogChat(null)}+ />+ )}+{composeOpen && (<StatusComposeModalsessionId={selectedSessionId}diff --git a/dashboard/src/services/api.ts b/dashboard/src/services/api.tsindex 245c214f4..d887f012d 100644--- a/dashboard/src/services/api.ts+++ b/dashboard/src/services/api.ts@@ -440,6 +440,24 @@ export interface ContactStatusGroup {// Minimal contact type for the recipient picker; the backend GET /sessions/:id/contacts// returns a Contact array; fields beyond id are optional.+/** GET /sessions/:id/groups/:groupId (GroupInfoDto). */+export interface GroupInfo {+ id: string;+ name: string;+ description?: string;+ owner?: string;+ createdAt?: number;+ participants: Array<{ id: string; number: string; name?: string; isAdmin: boolean; isSuperAdmin: boolean }>;+ /** Only admins may edit the group's info. */+ locked?: boolean;+ announce?: boolean;+}++export interface GroupAck {+ success: boolean;+ message: string;+}+export interface Contact {id: string;name?: string;@@ -879,6 +897,48 @@ export const sessionApi = {getStats: () => request<SessionStats>('/sessions/stats/overview'),getGroups: (id: string) =>request<{ id: string; name?: string; linkedParentJID?: string | null }[]>(`/sessions/${id}/groups`),+ // Operator route, Baileys only: whatsapp-web.js answers 501. Participants are WhatsApp ids (`…@c.us`).+ createGroup: (id: string, name: string, participants: string[]) =>+ request<{ id: string; name: string }>(`/sessions/${id}/groups`, {+ method: 'POST',+ body: JSON.stringify({ name, participants }),+ }),+ getGroup: (id: string, groupId: string) =>+ request<GroupInfo>(`/sessions/${id}/groups/${encodeURIComponent(groupId)}`),+ // The group writes below are operator routes. Whether WhatsApp lets this account make them (an admin,+ // or any member while the group's info is unlocked) is decided by WhatsApp; a refusal answers 403.+ setGroupSubject: (id: string, groupId: string, subject: string) =>+ request<GroupAck>(`/sessions/${id}/groups/${encodeURIComponent(groupId)}/subject`, {+ method: 'PUT',+ body: JSON.stringify({ subject }),+ }),+ setGroupDescription: (id: string, groupId: string, description: string) =>+ request<GroupAck>(`/sessions/${id}/groups/${encodeURIComponent(groupId)}/description`, {+ method: 'PUT',+ body: JSON.stringify({ description }),+ }),+ setGroupPicture: (id: string, groupId: string, base64: string, mimetype: string) =>+ request<GroupAck>(`/sessions/${id}/groups/${encodeURIComponent(groupId)}/picture`, {+ method: 'PUT',+ body: JSON.stringify({ base64, mimetype }),+ }),+ addGroupParticipants: (id: string, groupId: string, participants: string[]) =>+ request<GroupAck>(`/sessions/${id}/groups/${encodeURIComponent(groupId)}/participants`, {+ method: 'POST',+ body: JSON.stringify({ participants }),+ }),+ removeGroupParticipants: (id: string, groupId: string, participants: string[]) =>+ request<GroupAck>(`/sessions/${id}/groups/${encodeURIComponent(groupId)}/participants`, {+ method: 'DELETE',+ body: JSON.stringify({ participants }),+ }),+ setGroupAdmins: (id: string, groupId: string, participants: string[], admin: boolean) =>+ request<GroupAck>(+ `/sessions/${id}/groups/${encodeURIComponent(groupId)}/participants/${admin ? 'promote' : 'demote'}`,+ { method: 'POST', body: JSON.stringify({ participants }) },+ ),+ leaveGroup: (id: string, groupId: string) =>+ request<GroupAck>(`/sessions/${id}/groups/${encodeURIComponent(groupId)}/leave`, { method: 'POST' }),getChats: async (id: string, signal?: AbortSignal) => {let lastError: unknown;const { items, throttled } = await fetchAllPages<Chat>(@@ -910,6 +970,39 @@ export const sessionApi = {method: 'POST',body: JSON.stringify({ chatId }),}),+ // Both also delete the gateway's stored copy of the chat's messages (rows, media, search entries).+ clearChatMessages: (id: string, chatId: string) =>+ request<{ success: boolean }>(`/sessions/${id}/chats/${encodeURIComponent(chatId)}/messages`, {+ method: 'DELETE',+ }),+ deleteChat: (id: string, chatId: string) =>+ request<{ success: boolean }>(`/sessions/${id}/chats/delete`, {+ method: 'POST',+ body: JSON.stringify({ chatId }),+ }),+ // Archive, pin and mute answer `{ success: false }` when the engine declined to act (WhatsApp keeps at most+ // three chats pinned), which the callers treat as a failure.+ archiveChat: (id: string, chatId: string, archive: boolean) =>+ request<{ success: boolean }>(`/sessions/${id}/chats/archive`, {+ method: 'POST',+ body: JSON.stringify({ chatId, archive }),+ }),+ pinChat: (id: string, chatId: string, pin: boolean) =>+ request<{ success: boolean }>(`/sessions/${id}/chats/pin`, {+ method: 'POST',+ body: JSON.stringify({ chatId, pin }),+ }),+ /** `muteUntil` is epoch MILLISECONDS; null unmutes. */+ muteChat: (id: string, chatId: string, muteUntil: number | null) =>+ request<{ success: boolean }>(`/sessions/${id}/chats/mute`, {+ method: 'POST',+ body: JSON.stringify({ chatId, muteUntil }),+ }),+ markChatUnread: (id: string, chatId: string) =>+ request<{ success: boolean }>(`/sessions/${id}/chats/unread`, {+ method: 'POST',+ body: JSON.stringify({ chatId }),+ }),// `offset` counts DB rows already fetched for this chat, never rendered rows: the thread merges// these with engine history, so paging by the merged length would skip DB rows. `total` is not// read to decide whether an older page exists — a page short of `limit` is; a chat with live@@ -1049,6 +1142,22 @@ export const contactApi = {if (throttled) throw lastError;return items;},+ /** The ids of the contacts this account has blocked. */+ listBlocked: (sessionId: string) => request<string[]>(`/sessions/${sessionId}/contacts/blocked`),+ block: (sessionId: string, contactId: string) =>+ request<{ success: boolean }>(`/sessions/${sessionId}/contacts/${encodeURIComponent(contactId)}/block`, {+ method: 'POST',+ }),+ unblock: (sessionId: string, contactId: string) =>+ request<{ success: boolean }>(`/sessions/${sessionId}/contacts/${encodeURIComponent(contactId)}/block`, {+ method: 'DELETE',+ }),+ /** Save the contact to the account's address book, or rename the entry it has. */+ upsert: (sessionId: string, contactId: string, firstName: string, lastName?: string) =>+ request<{ success: boolean }>(`/sessions/${sessionId}/contacts/${encodeURIComponent(contactId)}`, {+ method: 'PUT',+ body: JSON.stringify({ firstName, ...(lastName ? { lastName } : {}) }),+ }),checkNumber: (sessionId: string, number: string) =>request<CheckNumberResponse>(`/sessions/${sessionId}/contacts/check/${encodeURIComponent(number)}`),// Returns the contact/group profile picture URL. Both engines return null when the user hid theirdiff --git a/dashboard/src/utils/chatFilters.test.ts b/dashboard/src/utils/chatFilters.test.tsindex e9f5d83c8..76d55d0f1 100644--- a/dashboard/src/utils/chatFilters.test.ts+++ b/dashboard/src/utils/chatFilters.test.ts@@ -1,9 +1,84 @@import { test } from 'node:test';import assert from 'node:assert/strict';-import { filterChats, filterChannels, groupStatusesByContact } from './chatFilters.ts';+import {+ applyChatListFilter,+ contactKey,+ filterChats,+ filterChannels,+ groupStatusesByContact,+ isUnsavedContact,+ phoneContactId,+ savedContactKeySet,+} from './chatFilters.ts';const chat = (id: string, name?: string, kind?: string) => ({ id, name, kind });+const row = (id: string, kind: string, unreadCount: number, name?: string) => ({ id, name, kind, unreadCount });++test('the unread filter keeps chats with a count and chats marked unread', () => {+ const all = [row('[email protected]', 'individual', 2), row('[email protected]', 'individual', 0), row('[email protected]', 'individual', -1)];++ assert.deepEqual(+ applyChatListFilter(all, 'unread').map(c => c.id),+ ['[email protected]', '[email protected]'],+ );+});++test('the direct and group filters split on the chat kind, and all keeps every row', () => {+ const all = [row('[email protected]', 'individual', 0), row('[email protected]', 'group', 0), row('b@broadcast', 'broadcast', 0)];++ assert.deepEqual(+ applyChatListFilter(all, 'direct').map(c => c.id),+ ['[email protected]'],+ );+ assert.deepEqual(+ applyChatListFilter(all, 'groups').map(c => c.id),+ ['[email protected]'],+ );+ assert.equal(applyChatListFilter(all, 'all'), all);+});++// The contacts route as the Baileys adapter answers it: a saved contact, and a peer known only by the push+// name WhatsApp sent (`notify`), which carries no `~` and no saved name.+const ADDRESS_BOOK = [+ { id: '[email protected]', name: 'Alice', isMyContact: true },+ { id: '[email protected]', pushName: 'Bob', isMyContact: false },+];++test('a 1:1 chat is unsaved when the address book does not hold its contact as saved, whatever its name', () => {+ const saved = savedContactKeySet(ADDRESS_BOOK);+ // Named by the bare push name, as Baileys lists it: still unsaved.+ assert.equal(isUnsavedContact(chat('[email protected]', 'Bob', 'individual'), saved), true);+ assert.equal(isUnsavedContact(chat('[email protected]', 'Alice', 'individual'), saved), false);+ // whatsapp-web.js spells the same phone `@c.us`.+ assert.equal(isUnsavedContact(chat('[email protected]', 'Alice', 'individual'), saved), false);+ // A group is never a contact, saved or not.+ assert.equal(isUnsavedContact(chat('[email protected]', undefined, 'group'), saved), false);+ // Until the address book loads no chat is called unsaved, rather than every one.+ assert.equal(isUnsavedContact(chat('[email protected]', 'Bob', 'individual'), undefined), false);+});++test('the Unknown filter keeps the push-name-only contact and drops the saved one', () => {+ const all = [+ row('[email protected]', 'individual', 0, 'Alice'),+ row('[email protected]', 'individual', 0, 'Bob'),+ ];+ assert.deepEqual(+ applyChatListFilter(all, 'unknown', savedContactKeySet(ADDRESS_BOOK)).map(c => c.id),+ ['[email protected]'],+ );+});++test('only a phone-based chat id can key the address book; a @lid never passes for a phone', () => {+ assert.equal(phoneContactId('[email protected]'), '[email protected]');+ assert.equal(phoneContactId('[email protected]'), '[email protected]');+ assert.equal(phoneContactId('262813461250071@lid'), null);+ assert.equal(phoneContactId('[email protected]'), null);+ // A @lid keeps its full key, so its digits never match a phone's.+ assert.equal(contactKey('628111@lid'), '628111@lid');+ assert.equal(contactKey('[email protected]'), contactKey('[email protected]'));+});+test('the chats tab hides channel and status rows, which have their own tabs', () => {const all = [chat('[email protected]', 'Alice'), chat('n@newsletter', 'News', 'channel'), chat('s@broadcast', 'S', 'status')];diff --git a/dashboard/src/utils/chatFilters.ts b/dashboard/src/utils/chatFilters.tsindex 6fac35e19..258c92907 100644--- a/dashboard/src/utils/chatFilters.ts+++ b/dashboard/src/utils/chatFilters.ts@@ -27,6 +27,67 @@ export function filterChats<T extends ChatLike>(chats: T[], query: string): T[]return chats.filter(c => c.kind !== 'channel' && c.kind !== 'status' && matches(query, c.name, c.id));}+/** The quick filters above the Chats tab list, applied after the search box. */+export const CHAT_LIST_FILTERS = ['all', 'unread', 'direct', 'groups', 'unknown'] as const;+export type ChatListFilter = (typeof CHAT_LIST_FILTERS)[number];++/**+ * The key a contact and a chat share in the address book. Engines spell a phone-based user id as+ * `…@c.us` (whatsapp-web.js) or `…@s.whatsapp.net` (Baileys), so both reduce to the phone digits; any+ * other id (a `@lid` privacy id among them) keeps its full form, so its digits never pass for a phone.+ */+export function contactKey(id: string): string {+ const [user, domain] = id.split('@');+ const phone = user.split(':')[0];+ return (domain === 'c.us' || domain === 's.whatsapp.net') && /^\d+$/.test(phone) ? phone : id;+}++/** The keys of the contacts the address book holds as saved (`isMyContact`); undefined until loaded. */+export function savedContactKeySet(+ contacts: Array<{ id: string; isMyContact: boolean }> | undefined,+): ReadonlySet<string> | undefined {+ return contacts && new Set(contacts.filter(c => c.isMyContact).map(c => contactKey(c.id)));+}++/**+ * A 1:1 chat whose contact the address book does not hold as saved. Decided from the address book, not+ * from the chat's name: Baileys names an unsaved contact by its bare push name (`Bob`), with no marker.+ * Until the address book has loaded no chat counts as unsaved, rather than all of them.+ */+export function isUnsavedContact(chat: ChatLike, savedKeys: ReadonlySet<string> | undefined): boolean {+ if (chat.kind !== 'individual' || !savedKeys) return false;+ return !savedKeys.has(contactKey(chat.id));+}++/**+ * The phone-based contact id the address book can store a 1:1 chat's contact under: the chat id itself+ * when it is one, otherwise null. The gateway refuses a `@lid` id for the address book, and its digits are+ * no phone number.+ */+export function phoneContactId(chatId: string): string | null {+ return /^\d+@(c\.us|s\.whatsapp\.net)$/.test(chatId) ? chatId : null;+}++/** A negative unread count is a chat marked unread (Baileys reports -1), which the Unread filter keeps. */+export function applyChatListFilter<T extends ChatLike & { unreadCount: number }>(+ chats: T[],+ filter: ChatListFilter,+ savedKeys?: ReadonlySet<string>,+): T[] {+ switch (filter) {+ case 'unread':+ return chats.filter(c => c.unreadCount !== 0);+ case 'direct':+ return chats.filter(c => c.kind === 'individual');+ case 'groups':+ return chats.filter(c => c.kind === 'group');+ case 'unknown':+ return chats.filter(c => isUnsavedContact(c, savedKeys));+ default:+ return chats;+ }+}+/** Channels tab: same search box, matched on the channel's own name/id. */export function filterChannels<T extends { id: string; name: string }>(channels: T[], query: string): T[] {return channels.filter(ch => matches(query, ch.name, ch.id));diff --git a/docs/17-dashboard-design.md b/docs/17-dashboard-design.mdindex fe8356a4a..7413d3f2d 100644--- a/docs/17-dashboard-design.md+++ b/docs/17-dashboard-design.md@@ -108,9 +108,11 @@ mounted for any admin key.```/ → Dashboard (overview + charts)/sessions → Sessions (create / start / stop / QR / delete)-/chats → Chats (Chats / Channels / Status tabs; chat list + message thread live via- WebSocket; thread pages older history in on scroll-up; read-only channel- feed on whatsapp-web.js)+/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, clear, delete, leave group) [operator]; 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)@@ -415,11 +417,15 @@ Chat-specific pieces live one level down in `components/chats/`: `MessageBody` (formatting + link detection), `ChatThread` (bubble list, including inbound Baileys prompt buttonsthat call `POST /sessions/:id/messages/click-button`), and `MediaLightbox` (the media viewer, builton `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 choicesarrive 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 theengine 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.+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.The message thread is paged. `useChatMessages` is a `useInfiniteQuery` whose cursor is the numberof DB rows fetched so far, not the length of the rendered list — the thread also carries engine@@ -479,8 +485,8 @@ Three pages keep a server list in local state instead of the query cache:it applies, it invalidates the `['sessions']` key prefix so the Dashboard and per-session viewsrefetch.- **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- and marking a chat read update.+ 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.- **Plugins** (`Plugins.tsx`) keeps the catalog in local state. It prefetches it silently on mountso installed cards can show an update chip, fetches it again when the Catalog tab opens with anempty list, and reloads it after any install, update or uninstall.