Files
archie/ui/src/lib/connection.ts
T
sam 4ffebb855d feat(webui): five-place top bar with Settings, New task and one connection pill
Dashboard, Tasks, Workflows, Events and Settings replace the Work, Agent
and System menus. Configuration pages move under /settings/* with
redirects from their old paths; Logs and Appearance leave the bar and stay
reachable from Jump to, the Dashboard and the account menu. New task opens
the Start work form in a dialog and lands on the new task. One pill reports
the live stream's state.

Drops docs/prds/dashboard-navigation-groups.md: web UI design is not
tracked in PRDs.
2026-09-25 15:09:18 +10:00

14 lines
503 B
TypeScript

import type { StreamState } from "./stream-state";
export type ConnectionState = StreamState | "connecting";
/** What the UI calls the live stream's state, and the tone it is shown in. */
export function connectionStatus(state: ConnectionState): {
label: string;
tone: "ok" | "warn" | "danger";
} {
if (state === "live") return { label: "Connected", tone: "ok" };
if (state === "unavailable") return { label: "Disconnected", tone: "danger" };
return { label: "Connecting", tone: "warn" };
}