From 95ed49ce9adfedd1ea7fd80fd3499012bd7fc579 Mon Sep 17 00:00:00 2001 From: DB Hurley Date: Mon, 12 Jan 2026 20:03:06 -0500 Subject: [PATCH] feat(ui): display per-account status for multi-account Telegram When multiple Telegram accounts are configured, the Connections UI now displays individual status cards for each account showing: - Bot username and account ID - Running/configured status - Last inbound message time - Per-account errors Falls back to the existing summary view for single-account configs. No changes needed to types (already added upstream). --- ui/src/ui/views/connections.ts | 86 ++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 20 deletions(-) diff --git a/ui/src/ui/views/connections.ts b/ui/src/ui/views/connections.ts index 3201ab93c..095006ab8 100644 --- a/ui/src/ui/views/connections.ts +++ b/ui/src/ui/views/connections.ts @@ -4,6 +4,7 @@ import { formatAgo } from "../format"; import type { DiscordStatus, IMessageStatus, + ProviderAccountSnapshot, ProvidersStatusSnapshot, SignalStatus, SlackStatus, @@ -132,6 +133,7 @@ export function renderConnections(props: ConnectionsProps) { slack, signal, imessage, + providerAccounts: props.snapshot?.providerAccounts ?? null, }), )} @@ -216,6 +218,7 @@ function renderProvider( slack?: SlackStatus | null; signal?: SignalStatus | null; imessage?: IMessageStatus | null; + providerAccounts?: Record | null; }, ) { switch (key) { @@ -321,33 +324,76 @@ function renderProvider( } case "telegram": { const telegram = data.telegram; + const telegramAccounts = data.providerAccounts?.telegram ?? []; + const hasMultipleAccounts = telegramAccounts.length > 1; + + const renderAccountCard = (account: ProviderAccountSnapshot) => { + const probe = account.probe as { bot?: { username?: string } } | undefined; + const botUsername = probe?.bot?.username; + const label = account.name || account.accountId; + return html` +
+
+ ${botUsername ? `@${botUsername}` : label} + (${account.accountId}) +
+
+
+ Running + ${account.running ? "Yes" : "No"} +
+
+ Configured + ${account.configured ? "Yes" : "No"} +
+
+ Last inbound + ${account.lastInboundAt ? formatAgo(account.lastInboundAt) : "n/a"} +
+ ${account.lastError ? html` +
+ ${account.lastError} +
+ ` : nothing} +
+
+ `; + }; + return html`
Telegram
Bot token and delivery options.
-
-
- Configured - ${telegram?.configured ? "Yes" : "No"} + ${hasMultipleAccounts ? html` +
+
Accounts (${telegramAccounts.length})
+ ${telegramAccounts.map((account) => renderAccountCard(account))}
-
- Running - ${telegram?.running ? "Yes" : "No"} + ` : html` +
+
+ Configured + ${telegram?.configured ? "Yes" : "No"} +
+
+ Running + ${telegram?.running ? "Yes" : "No"} +
+
+ Mode + ${telegram?.mode ?? "n/a"} +
+
+ Last start + ${telegram?.lastStartAt ? formatAgo(telegram.lastStartAt) : "n/a"} +
+
+ Last probe + ${telegram?.lastProbeAt ? formatAgo(telegram.lastProbeAt) : "n/a"} +
-
- Mode - ${telegram?.mode ?? "n/a"} -
-
- Last start - ${telegram?.lastStartAt ? formatAgo(telegram.lastStartAt) : "n/a"} -
-
- Last probe - ${telegram?.lastProbeAt ? formatAgo(telegram.lastProbeAt) : "n/a"} -
-
+ `} ${telegram?.lastError ? html`