Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): address the redesign review

Rezk Jörg Sebening775f92dd719c
diff --git a/dashboard/src/components/chats/ChatSidebar.tsx b/dashboard/src/components/chats/ChatSidebar.tsx
index 097f3779c..7fa35f7aa 100644
--- a/dashboard/src/components/chats/ChatSidebar.tsx
+++ b/dashboard/src/components/chats/ChatSidebar.tsx
@@ -98,7 +98,7 @@ function ChatSidebar({
}: ChatSidebarProps) {
const { t } = useTranslation();
// Posting a status needs an operator key; a read-only key would only reach a 403.
- const { canWrite } = useRole();
+ const { canWrite, scoped } = useRole();
const [showMessageSearch, setShowMessageSearch] = useState(false);
const formatLastMessageSnippet = (chat: Chat) => chat.lastMessage || '';
@@ -184,7 +184,9 @@ function ChatSidebar({
sessions={pickerSessions ?? sessions}
selectedSessionId={selectedSessionId}
onSelectSession={onSelectSession}
- canAddSession={canWrite}
+ // A session-scoped key cannot create a session (the Sessions page hides its form), so it gets no
+ // link to pair another number.
+ canAddSession={canWrite && !scoped}
/>
<div className="sidebar-header-actions">
diff --git a/dashboard/src/components/chats/ChatThread.tsx b/dashboard/src/components/chats/ChatThread.tsx
index ebc1fca6d..82ca83033 100644
--- a/dashboard/src/components/chats/ChatThread.tsx
+++ b/dashboard/src/components/chats/ChatThread.tsx
@@ -121,7 +121,7 @@ function ChatThread({
onDelete,
onClickButton,
}: ChatThreadProps) {
- const { t, i18n } = useTranslation();
+ const { t } = useTranslation();
// Reply, react, delete and prompt taps all need an operator key, like the composer; a viewer
// would only reach a 403.
const { canWrite } = useRole();
@@ -415,10 +415,10 @@ function ChatThread({
setButtonClick({});
}, [activeChat?.id]);
- // Helper formats, in the dashboard's language rather than the browser's.
+ // Helper formats. Times and dates follow the browser's locale, as on the other pages.
const formatTime = (timestamp?: number) => {
if (!timestamp) return '';
- return new Date(timestamp * 1000).toLocaleTimeString(i18n.language, { hour: '2-digit', minute: '2-digit' });
+ return new Date(timestamp * 1000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
};
// The pill above the first message of each day: Today, Yesterday, else a short date (with the year
@@ -429,7 +429,7 @@ function ChatThread({
yesterday.setDate(yesterday.getDate() - 1);
if (date.toDateString() === new Date().toDateString()) return t('chats.today');
if (date.toDateString() === yesterday.toDateString()) return t('chats.yesterday');
- return date.toLocaleDateString(i18n.language, {
+ return date.toLocaleDateString([], {
weekday: 'short',
day: '2-digit',
month: 'short',
diff --git a/dashboard/src/pages/Chats.css b/dashboard/src/pages/Chats.css
index 569e57882..48c0d27e6 100644
--- a/dashboard/src/pages/Chats.css
+++ b/dashboard/src/pages/Chats.css
@@ -11,11 +11,15 @@
--chat-bubble-in: #ffffff;
--chat-bubble-out: #d9fdd3;
--chat-bubble-text: #111b21;
- --chat-meta: #667781;
+ /* Text tokens clear WCAG AA (4.5:1) on every surface they land on: the list rows (resting, hover,
+ active) and both bubbles. theme-contrast.test.ts checks each pair. */
+ --chat-meta: #54656f;
+ --chat-meta-out: #54656f;
--chat-pill: #ffffff;
--chat-pill-active-bg: #d9fdd3;
--chat-pill-active-text: #008069;
--chat-accent: #00a884;
+ --chat-accent-text: #017561;
--chat-accent-hover: #008f6f;
--chat-quote-accent: #06cf9c;
--chat-link: #027eb5;
@@ -43,7 +47,9 @@
--chat-bubble-in: #202c33;
--chat-bubble-out: #005c4b;
--chat-bubble-text: #e9edef;
- --chat-meta: #8696a0;
+ --chat-meta: #9aa8b0;
+ --chat-meta-out: #c2d6cf;
+ --chat-accent-text: #1fbf95;
--chat-pill: #202c33;
--chat-pill-active-bg: #0a332c;
--chat-pill-active-text: #00a884;
@@ -67,7 +73,9 @@
--chat-bubble-in: #202c33;
--chat-bubble-out: #005c4b;
--chat-bubble-text: #e9edef;
- --chat-meta: #8696a0;
+ --chat-meta: #9aa8b0;
+ --chat-meta-out: #c2d6cf;
+ --chat-accent-text: #1fbf95;
--chat-pill: #202c33;
--chat-pill-active-bg: #0a332c;
--chat-pill-active-text: #00a884;
@@ -342,7 +350,15 @@
.chats-page .session-picker-add:hover,
.chats-page .session-picker-add:focus-visible {
background: var(--chat-hover);
- outline: none;
+}
+
+/* The hover tint alone is too faint to show keyboard focus (about 1.1:1 against the panel), so focus keeps a
+ ring, drawn inside so the scrolling list does not clip it. */
+.chats-page .session-picker-option:focus-visible,
+.chats-page .session-picker-add:focus-visible,
+.chats-page .chat-row-menu-popover button:focus-visible {
+ outline: 2px solid var(--chat-accent);
+ outline-offset: -2px;
}
.chats-page .session-picker-option:disabled {
@@ -508,18 +524,13 @@
/* Filter pills */
.chats-page .chat-filters {
display: flex;
+ flex-wrap: wrap;
gap: 0.5rem;
padding-block: 0.75rem;
padding-inline: 1rem;
- overflow-x: auto;
- scrollbar-width: none;
flex-shrink: 0;
}
-.chats-page .chat-filters::-webkit-scrollbar {
- display: none;
-}
-
.chats-page .chat-filter-pill {
flex-shrink: 0;
padding-block: 0.375rem;
@@ -748,7 +759,7 @@
}
.chats-page .chat-item-card.unread .chat-item-time {
- color: var(--chat-accent);
+ color: var(--chat-accent-text);
font-weight: 600;
}
@@ -890,7 +901,6 @@
.chats-page .chat-row-menu-popover button:hover,
.chats-page .chat-row-menu-popover button:focus-visible {
background: var(--chat-hover);
- outline: none;
}
.chats-page .chat-row-menu-group {
@@ -2105,6 +2115,11 @@
color: var(--chat-meta);
}
+.chats-page .message-bubble.outgoing .message-edited,
+.chats-page .message-bubble.outgoing .message-time {
+ color: var(--chat-meta-out);
+}
+
/* A styled status bubble sets its own inline background + white text; let its timestamp inherit
instead of staying the muted gray meant for the default bubble. */
.chats-page .message-bubble[style] .message-edited,
diff --git a/dashboard/src/pages/Chats.features.test.ts b/dashboard/src/pages/Chats.features.test.ts
index 62ffc1a02..3b5b76fce 100644
--- a/dashboard/src/pages/Chats.features.test.ts
+++ b/dashboard/src/pages/Chats.features.test.ts
@@ -8,7 +8,7 @@ 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';
+import { lastSocket, resetSocketDouble } from '../test-helpers/socket-io-double.ts';
const SESSION: Session = {
id: 'session-1',
@@ -412,6 +412,73 @@ test('the session switcher lists every session with its state, and only a connec
assert.equal(screen.getAllByRole('option').length, 1, 'the search did not narrow the list');
});
+test('the session switcher follows live session status: a session that connects can be picked, one that drops cannot', async () => {
+ const { screen, fireEvent, act } = rtl;
+ listOffline = true;
+ listSecond = true;
+ renderPage();
+ await screen.findByText('Alice');
+ const pushStatus = (sessionId: string, status: string) =>
+ act(() => {
+ lastSocket()?.receive('message', {
+ type: 'event',
+ timestamp: new Date(1_700_003_000_000).toISOString(),
+ payload: { event: 'session.status', sessionId, data: { status } },
+ });
+ });
+ const disabledOf = (name: string) =>
+ (screen.getAllByRole('option').find(option => option.textContent?.includes(name)) as HTMLButtonElement).disabled;
+
+ fireEvent.click(screen.getByRole('button', { name: /Main/ }));
+ assert.deepEqual([disabledOf('Main'), disabledOf('Second'), disabledOf('Marie Haas')], [false, false, true]);
+
+ pushStatus(OFFLINE_SESSION.id, 'ready');
+ pushStatus(SECOND_SESSION.id, 'disconnected');
+ assert.equal(disabledOf('Marie Haas'), false, 'a session that connected stayed unpickable');
+ assert.equal(disabledOf('Second'), true, 'a session that dropped could still be picked');
+
+ // The open session stays selected when it drops; the switcher shows its state.
+ pushStatus(SESSION.id, 'disconnected');
+ assert.ok(screen.getByRole('button', { name: /Main/ }), 'the open session left the switcher');
+});
+
+test('the session switcher links to pairing another number only for a key that may create a session', async () => {
+ const { screen, fireEvent } = rtl;
+ const { MemoryRouter } = await import('react-router-dom');
+ const renderInRouter = () => {
+ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false, gcTime: 1_000 } } });
+ queryClients.push(queryClient);
+ return rtl.render(
+ createElement(
+ MemoryRouter,
+ null,
+ createElement(
+ QueryClientProvider,
+ { client: queryClient },
+ createElement(RoleProvider, null, createElement(ToastProvider, null, createElement(Chats))),
+ ),
+ ),
+ );
+ };
+
+ renderInRouter();
+ await screen.findByText('Alice');
+ fireEvent.click(screen.getByRole('button', { name: /Main/ }));
+ assert.ok(screen.getByText('Pair another number'), 'an unscoped operator key got no pairing link');
+ rtl.cleanup();
+
+ // A session-scoped key is refused on the create route, so the link would end on a page with nothing to do.
+ window.sessionStorage.setItem('openwa_key_scoped', 'true');
+ try {
+ renderInRouter();
+ await screen.findByText('Alice');
+ fireEvent.click(screen.getByRole('button', { name: /Main/ }));
+ assert.ok(!screen.queryByText('Pair another number'), 'a session-scoped key got a pairing link');
+ } finally {
+ window.sessionStorage.removeItem('openwa_key_scoped');
+ }
+});
+
test('Escape closes the session switcher, not the open chat', async () => {
const { screen, fireEvent, waitFor } = rtl;
const { container } = renderPage();
@@ -915,7 +982,7 @@ test('on Baileys neither the row nor the room menu offers Clear chat or Delete c
assert.ok(!screen.queryByRole('button', { name: 'Delete chat' }), 'the row menu offered Delete chat');
fireEvent.keyDown(document, { key: 'Escape' });
- fireEvent.click(container.querySelector('.room-menu-trigger') as HTMLElement);
+ fireEvent.click(container.querySelector('.room-menu > button') as HTMLElement);
const menu = container.querySelector('.room-menu-popover') as HTMLElement;
assert.ok(within(menu).getByRole('button', { name: 'Copy chat ID' }), 'the room menu did not open');
assert.ok(!within(menu).queryByRole('button', { name: 'Clear chat' }), 'the room menu offered Clear chat');
diff --git a/dashboard/src/pages/Chats.test.ts b/dashboard/src/pages/Chats.test.ts
index fea3a5a9b..a74e1170b 100644
--- a/dashboard/src/pages/Chats.test.ts
+++ b/dashboard/src/pages/Chats.test.ts
@@ -1910,7 +1910,9 @@ test('a background reload that lands before the initial list is not overwritten
const { screen, waitFor } = rtl;
const answers = holdChatLists();
const { container } = renderChats();
- await screen.findByText('Main (15551234567)');
+ await waitFor(() =>
+ assert.equal(container.querySelector('.session-switcher-btn .session-name')?.textContent, SESSION.name),
+ );
await waitFor(() => assert.equal(answers.length, 1));
assert.ok(container.querySelector('.chats-list-loading'), 'the initial list showed no spinner');
@@ -1936,7 +1938,7 @@ test('a background reload that lands before the initial list is not overwritten
});
test("a session switch drops the previous session's trailing reload and lets the new session reload at once", async () => {
- const { screen, fireEvent, waitFor } = rtl;
+ const { screen, waitFor } = rtl;
twoSessions = true;
const asked = { one: 0, two: 0 };
const held: Array<() => void> = [];
@@ -1964,9 +1966,7 @@ test("a session switch drops the previous session's trailing reload and lets the
await waitFor(() => assert.equal(held.length, 1));
assert.equal(asked.one, 2);
- fireEvent.change(container.querySelector('select.session-selector') as HTMLSelectElement, {
- target: { value: SESSION_2.id },
- });
+ selectSession(container, SESSION_2.id);
await screen.findByText('carol on two');
// Session 2 is not queued behind the reload session 1 left out.
diff --git a/dashboard/src/pages/Chats.tsx b/dashboard/src/pages/Chats.tsx
index 207cbac6d..65fc55222 100644
--- a/dashboard/src/pages/Chats.tsx
+++ b/dashboard/src/pages/Chats.tsx
@@ -55,6 +55,7 @@ import {
type MessageMedia,
} from '../utils/chatMessages';
import { useWebSocket } from '../hooks/useWebSocket';
+import { createSessionFeedState, noteSessionFeedError, subscribeSessionFeed } from '../utils/sessionFeedSubscription';
import { useDocumentTitle } from '../hooks/useDocumentTitle';
import { useToast } from '../hooks/useToast';
import { useRole } from '../hooks/useRole';
@@ -175,7 +176,7 @@ const statusFontStyle = (font?: number): { fontFamily?: string; fontWeight?: num
};
export function Chats() {
- const { t, i18n } = useTranslation();
+ const { t } = useTranslation();
useDocumentTitle(t('nav.chats'));
const { error: showErrorToast, warning: showWarningToast, success: showSuccessToast } = useToast();
const { canWrite, engineType } = useRole();
@@ -806,10 +807,39 @@ export function Chats() {
[queryClient],
);
+ // The session switcher shows every session's state and lets only a ready one be picked, so both lists
+ // follow the live session feed the Sessions page uses (the '*' room, or one room per listed session for
+ // a session-scoped key) instead of the read at mount alone. The open session stays selectable when it
+ // drops, so the page does not switch away under the operator.
+ const listedSessionsRef = useRef(listedSessions);
+ useEffect(() => {
+ listedSessionsRef.current = listedSessions;
+ });
+ const sessionFeedRef = useRef(createSessionFeedState());
+ const [sessionFeedError, setSessionFeedError] = useState<string | null>(null);
+ const handleSessionStatus = useCallback((event: { sessionId: string; status: string }) => {
+ const status = event.status as Session['status'];
+ const withStatus = (session: Session) => (session.id === event.sessionId ? { ...session, status } : session);
+ setListedSessions(prev => prev.map(withStatus));
+ setSessions(prev => {
+ if (status === 'ready') {
+ if (prev.some(session => session.id === event.sessionId)) return prev.map(withStatus);
+ const listed = listedSessionsRef.current.find(session => session.id === event.sessionId);
+ return listed ? [...prev, { ...listed, status }] : prev;
+ }
+ return prev
+ .filter(session => session.id !== event.sessionId || session.id === selectedSessionRef.current)
+ .map(withStatus);
+ });
+ }, []);
+ const handleServerError = useCallback((frame: { code: string }) => setSessionFeedError(frame.code), []);
+
// The events object must be referentially stable: useWebSocket re-registers its socket handler
// on every identity change, so an inline literal would tear down and re-attach per render.
const wsEvents = useMemo(
() => ({
+ onSessionStatus: handleSessionStatus,
+ onServerError: handleServerError,
onMessage: handleIncomingMessage,
onMessageAck: handleIncomingMessageAck,
onMessageReaction: handleIncomingMessageReaction,
@@ -818,6 +848,8 @@ export function Chats() {
onStatusReceived: handleStatusReceived,
}),
[
+ handleSessionStatus,
+ handleServerError,
handleIncomingMessage,
handleIncomingMessageAck,
handleIncomingMessageReaction,
@@ -828,6 +860,29 @@ export function Chats() {
);
const { isConnected, connectionFailed, reconnect, subscribe, unsubscribe } = useWebSocket(wsEvents);
+ // A session-scoped key may not join '*': fall back to one subscription per listed session.
+ useEffect(() => {
+ if (sessionFeedError && noteSessionFeedError(sessionFeedRef.current, sessionFeedError)) {
+ subscribeSessionFeed(
+ { subscribe },
+ sessionFeedRef.current,
+ listedSessionsRef.current.map(session => session.id),
+ );
+ }
+ }, [sessionFeedError, subscribe]);
+
+ // Join the feed on connect and for every listed session. A reconnect lands on a fresh socket, and a
+ // session switch leaves every room of the session left behind, its feed room included, so both make the
+ // listed sessions subscribable again.
+ const listedSessionIds = listedSessions.map(session => session.id).join(',');
+ useEffect(() => {
+ if (!isConnected) {
+ sessionFeedRef.current.subscribedIds.clear();
+ return;
+ }
+ subscribeSessionFeed({ subscribe }, sessionFeedRef.current, listedSessionIds ? listedSessionIds.split(',') : []);
+ }, [isConnected, subscribe, listedSessionIds, selectedSessionId]);
+
// A transient WebSocket gap means message.received/ack/revoke/status events were missed. On a
// reconnect (isConnected false→true after a prior connect), refresh what the gap left stale; the
// threads are refreshed by the subscribe effect below, which runs on every connect. A failed feed
@@ -886,6 +941,7 @@ export function Chats() {
useEffect(() => {
if (selectedSessionId && isConnected) {
+ const sessionFeed = sessionFeedRef.current;
subscribe(selectedSessionId, [
'message.received',
'message.sent',
@@ -900,6 +956,8 @@ export function Chats() {
void queryClient.invalidateQueries({ queryKey: ['messages', selectedSessionId] });
return () => {
unsubscribe(selectedSessionId);
+ // Leaving the session's rooms leaves its feed room too, so the feed effect joins it again.
+ sessionFeed.subscribedIds.delete(selectedSessionId);
};
}
}, [selectedSessionId, isConnected, subscribe, unsubscribe, queryClient]);
@@ -1119,14 +1177,14 @@ export function Chats() {
// Helper formats. The list time follows WhatsApp's ladder, so the list scans the way operators
// expect: the clock for today, "Yesterday", the weekday within the last week, else a short date.
- // In the dashboard's language rather than the browser's.
+ // Times and dates follow the browser's locale, as on the other pages.
const formatChatTime = useCallback(
(timestamp?: number) => {
if (!timestamp) return '';
const date = new Date(timestamp * 1000);
const today = new Date();
if (date.toDateString() === today.toDateString()) {
- return date.toLocaleTimeString(i18n.language, { hour: '2-digit', minute: '2-digit' });
+ return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
}
const yesterday = new Date(today);
yesterday.setDate(yesterday.getDate() - 1);
@@ -1137,16 +1195,16 @@ export function Chats() {
weekAgo.setHours(0, 0, 0, 0);
weekAgo.setDate(weekAgo.getDate() - 6);
if (date >= weekAgo) {
- return date.toLocaleDateString(i18n.language, { weekday: 'long' });
+ return date.toLocaleDateString([], { weekday: 'long' });
}
- return date.toLocaleDateString(i18n.language, {
+ return date.toLocaleDateString([], {
weekday: 'short',
day: '2-digit',
month: 'short',
...(date.getFullYear() !== today.getFullYear() ? { year: 'numeric' } : {}),
});
},
- [t, i18n.language],
+ [t],
);
// One search box drives all three tabs; each matches on its own fields. Plain consts (not useMemo)
diff --git a/dashboard/src/pages/chats-focus.test.ts b/dashboard/src/pages/chats-focus.test.ts
new file mode 100644
index 000000000..e54fe039d
--- /dev/null
+++ b/dashboard/src/pages/chats-focus.test.ts
@@ -0,0 +1,22 @@
+// Keyboard focus on the chat page stays visible: no `:focus-visible` rule in Chats.css may remove the outline
+// the app draws for focus (index.css), since a hover-like tint alone is too faint to tell which control has it.
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
+import { dirname, join } from 'node:path';
+
+const CSS = readFileSync(join(dirname(fileURLToPath(import.meta.url)), 'Chats.css'), 'utf8').replace(
+ /\/\*[\s\S]*?\*\//g,
+ '',
+);
+
+test('no :focus-visible rule in Chats.css removes the focus outline', () => {
+ const offending: string[] = [];
+ for (const [, selectors, body] of CSS.matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
+ if (selectors.includes(':focus-visible') && /outline\s*:\s*(none|0)\b/.test(body)) {
+ offending.push(selectors.trim().replace(/\s+/g, ' '));
+ }
+ }
+ assert.deepEqual(offending, []);
+});
diff --git a/dashboard/src/theme-contrast.test.ts b/dashboard/src/theme-contrast.test.ts
index c81108065..b396a9ce4 100644
--- a/dashboard/src/theme-contrast.test.ts
+++ b/dashboard/src/theme-contrast.test.ts
@@ -42,3 +42,38 @@ test('dark --error-text clears AA on every error tint it lands on, in both dark
}
}
});
+
+// The chat page's own palette (pages/Chats.css): every text token against every surface it lands on, in the
+// light set and both dark sets. Light --chat-panel is the app's white card, so it resolves through App.css.
+const CHATS_CSS = readFileSync(join(dirname(fileURLToPath(import.meta.url)), 'pages', 'Chats.css'), 'utf8');
+const chatBlock = (anchor: string): string => {
+ const from = CHATS_CSS.indexOf(anchor);
+ assert.notEqual(from, -1, `Chats.css no longer contains "${anchor}"`);
+ return CHATS_CSS.slice(from, CHATS_CSS.indexOf('}', from));
+};
+const chatToken = (block: string, name: string): string =>
+ block.match(new RegExp(`${name}:\\s*var\\(--bg-white\\)`))
+ ? token(blockAfter(':root {'), '--bg-white')
+ : token(block, name);
+
+const CHAT_TEXT_ON: Array<[string, string[]]> = [
+ ['--chat-meta', ['--chat-panel', '--chat-hover', '--chat-active', '--chat-bubble-in']],
+ ['--chat-accent-text', ['--chat-panel', '--chat-hover', '--chat-active']],
+ ['--chat-meta-out', ['--chat-bubble-out']],
+];
+
+for (const anchor of [
+ '.chats-page {',
+ "[data-theme='dark'] .chats-page {",
+ ":root:not([data-theme='light']) .chats-page {",
+]) {
+ test(`chat text clears AA on every surface it lands on (${anchor})`, () => {
+ const block = chatBlock(anchor);
+ for (const [text, surfaces] of CHAT_TEXT_ON) {
+ for (const surface of surfaces) {
+ const ratio = contrast(rgb(chatToken(block, text)), rgb(chatToken(block, surface)));
+ assert.ok(ratio >= 4.5, `${anchor} ${text} is ${ratio.toFixed(2)}:1 on ${surface}`);
+ }
+ }
+ });
+}
diff --git a/docs/17-dashboard-design.md b/docs/17-dashboard-design.md
index 60ad195ab..6bdd740eb 100644
--- a/docs/17-dashboard-design.md
+++ b/docs/17-dashboard-design.md
@@ -491,8 +491,10 @@ Three pages keep a server list in local state instead of the query cache:
refetch.
- **Chats** (`Chats.tsx`) reads the sessions directly on mount, and again when a search hit names a
session that list lacks. The session switcher lists all of them, but only a ready one can be
- selected. The page keeps the chat list in local state that socket pushes, sends, marking a chat
- read and the chat actions (pin, mute, archive, rename) update.
+ selected; it follows `session.status` pushes through the same live session feed the Sessions page
+ joins (`utils/sessionFeedSubscription`), so a session that connects or drops changes in place. The
+ page keeps the chat list in local state that socket pushes, sends, marking a chat read and the chat
+ actions (pin, mute, archive, rename) update.
- **Plugins** (`Plugins.tsx`) keeps the catalog in local state. It prefetches it silently on mount
so installed cards can show an update chip, fetches it again when the Catalog tab opens with an
empty list, and reloads it after any install, update or uninstall.