feat(webui): rebuild the dashboard

The old UI was a single 200-line Go file serving one hand-written HTML
page of task rows. It showed that archied was running and almost nothing
about what it was doing -- skills, workflows, memory, channels, logs and
configuration were all invisible unless you read the source or the
config file.

The dashboard now covers each of those as its own section, built as a
Vite app under ui/ at the repo root: it is a separate artefact from the
Go daemon, not an internal package of it. dist/ is committed so building
archied never needs a Node toolchain, and the !no_ui build tag keeps an
embed-free build available.

Both sides are split by concern rather than by layer -- one Go file per
API area, one folder per UI section with its own CSS -- so a change to
logs cannot disturb tasks.

Pages report consequences, not just state: an empty memory page says
Archie starts every conversation with no recollection of earlier ones,
and the setup checklist names what is missing in plain language instead
of showing a grid of zeroes. Nothing greets by a hardcoded name; the
operator comes from [chat], which is deployment data.

Auth is exposure control, not capability control -- the agent already
holds this user's authority through its own tools. So a loopback bind
needs no token, and only a reachable bind mints one and logs a URL,
which means an instance cannot be exposed merely by omitting config.

Container startup now degrades instead of aborting, for the reason
resolveForge already does: a missing agent image should not deny the
operator chat and the dashboard, and under Restart=on-failure it turns a
recoverable problem into a crash loop with the real error scrolling past.

`task dev` runs the daemon under air and the Vite server together in one
terminal.
This commit is contained in:
sam committed 2026-08-04 01:45:36 +10:00
1 parent 449c925f29
commit 4d44ef76f5
61 files changed
+5889 -576

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
/*
* Style entry point. One file per concern, imported here in cascade order:
* tokens first (everything depends on them), then element defaults, then
* layout, then components. Feature folders own their own CSS and import it
* from their JS rather than adding to this list.
*/
@import "./tokens.css";
@import "./base.css";
@import "./layout.css";
@import "./page.css";
@import "./button.css";
@import "./card.css";
@import "./pill.css";
@import "./table.css";
@import "./empty.css";
@import "./responsive.css";
+32
View File
@@ -0,0 +1,32 @@
/* Element defaults. Nothing here is component-specific. */
/*
* App shell and shared primitives. Feature folders style their own specifics;
* anything that appears on more than one page lives here so pages cannot
* drift into three visual languages.
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body {
margin: 0;
height: 100%;
}
body {
color: var(--fg);
font-family: var(--font-sans);
font-size: var(--text-base);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
a {
color: inherit;
text-decoration: none;
}
+37
View File
@@ -0,0 +1,37 @@
/* Buttons. One shape, three weights. */
.btn {
display: inline-flex;
align-items: center;
gap: var(--sp-2);
padding: var(--sp-2) var(--sp-4);
border-radius: var(--radius-pill);
border: 1px solid var(--border-strong);
background: var(--surface);
color: var(--fg);
font: inherit;
font-size: var(--text-sm);
cursor: pointer;
transition: background var(--transition), border-color var(--transition);
}
.btn:hover {
background: var(--surface-hover);
}
.btn-primary {
background: var(--accent);
border-color: var(--accent);
color: var(--accent-fg);
font-weight: 500;
}
.btn-primary:hover {
filter: brightness(1.08);
background: var(--accent);
}
.btn-icon {
padding: var(--sp-2);
border-radius: var(--radius-sm);
}
+43
View File
@@ -0,0 +1,43 @@
/* Cards and the grids that arrange them. */
.card {
background: var(--surface-glass);
backdrop-filter: blur(14px);
border: 1px solid var(--hairline);
border-radius: var(--radius-lg);
padding: var(--sp-5);
box-shadow: var(--shadow-sm);
}
.card-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--sp-3);
margin-bottom: var(--sp-4);
}
.card-title {
font-size: var(--text-base);
font-weight: 600;
margin: 0;
}
.card-sub {
font-size: var(--text-xs);
color: var(--fg-muted);
margin: var(--sp-1) 0 0;
}
.grid {
display: grid;
gap: var(--sp-4);
}
.grid-4 {
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.grid-2 {
grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
+26
View File
@@ -0,0 +1,26 @@
/* Empty and loading states. */
.empty {
text-align: center;
padding: var(--sp-7) var(--sp-4);
color: var(--fg-muted);
}
.empty-title {
color: var(--fg);
font-weight: 500;
margin-bottom: var(--sp-1);
}
.skeleton {
background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
background-size: 200% 100%;
animation: shimmer 1.4s infinite;
border-radius: var(--radius-sm);
}
@keyframes shimmer {
to {
background-position: -200% 0;
}
}
+242
View File
@@ -0,0 +1,242 @@
/* The shell: one contained, rounded application surface floating on a lit
* canvas.
*
* The dashboard is a *workspace*, not a document that fills the viewport --
* framing it gives the panels an edge to sit against, and lets the canvas
* behind read as light rather than wallpaper. Everything inside is translucent
* so that light carries through instead of stopping at the first opaque card.
*/
body {
/* The luminous canvas. Large, off-axis and low-frequency, so it lights the
workspace rather than competing with it. */
background:
radial-gradient(70rem 40rem at 8% -10%, var(--wash-a), transparent 62%),
radial-gradient(56rem 34rem at 92% 4%, var(--wash-b), transparent 58%),
radial-gradient(48rem 30rem at 50% 108%, var(--wash-c), transparent 60%),
var(--bg);
background-attachment: fixed;
padding: var(--sp-4);
}
.shell {
min-height: calc(100vh - var(--sp-4) * 2);
display: flex;
flex-direction: column;
border-radius: var(--radius-xl);
border: 1px solid var(--hairline);
background: var(--workspace);
backdrop-filter: blur(28px) saturate(120%);
box-shadow: var(--shadow-workspace);
overflow: hidden;
}
/* ── Command bar ────────────────────────────────────────────────────────── */
.topbar {
display: flex;
align-items: center;
gap: var(--sp-4);
padding: var(--sp-3) var(--sp-4);
border-bottom: 1px solid var(--hairline);
background: var(--bg-blur);
position: sticky;
top: 0;
z-index: 10;
}
.brand {
display: flex;
align-items: center;
gap: var(--sp-2);
font-weight: 600;
font-size: var(--text-sm);
letter-spacing: -0.01em;
flex: none;
}
.brand-mark {
width: 26px;
height: 26px;
border-radius: 8px;
background: linear-gradient(135deg, var(--accent), var(--accent-2));
display: grid;
place-items: center;
color: #fff;
font-size: var(--text-xs);
font-weight: 700;
}
/* Compact icon navigation: one pill, icons only, label on the active item. */
.nav {
display: flex;
align-items: center;
gap: 2px;
margin: 0 auto;
padding: 3px;
border-radius: var(--radius-pill);
background: var(--surface-glass-strong);
border: 1px solid var(--hairline);
}
.nav-item {
display: inline-flex;
align-items: center;
gap: var(--sp-2);
padding: var(--sp-2) var(--sp-3);
border-radius: var(--radius-pill);
color: var(--fg-muted);
font-size: var(--text-sm);
white-space: nowrap;
cursor: pointer;
transition: background var(--transition), color var(--transition);
}
.nav-item:hover {
color: var(--fg);
background: var(--surface-hover);
}
.nav-item[aria-current="page"] {
background: var(--accent);
color: var(--accent-fg);
font-weight: 500;
padding-right: var(--sp-4);
}
.nav-item .nav-label {
display: none;
}
.nav-item[aria-current="page"] .nav-label {
display: inline;
}
/* ── Utility cluster ────────────────────────────────────────────────────── */
.topbar-end {
display: flex;
align-items: center;
gap: var(--sp-2);
flex: none;
}
.topbar-search {
display: flex;
align-items: center;
gap: var(--sp-2);
padding: var(--sp-2) var(--sp-3);
border-radius: var(--radius-pill);
background: var(--surface-glass-strong);
border: 1px solid var(--hairline);
color: var(--fg-subtle);
}
.topbar-search input {
background: none;
border: 0;
color: var(--fg);
font: inherit;
font-size: var(--text-sm);
width: 8rem;
outline: none;
}
.topbar-search input::placeholder {
color: var(--fg-subtle);
}
.icon-btn {
display: grid;
place-items: center;
width: 32px;
height: 32px;
border-radius: var(--radius-pill);
border: 1px solid var(--hairline);
background: var(--surface-glass-strong);
color: var(--fg-muted);
cursor: pointer;
transition: color var(--transition), background var(--transition);
}
.icon-btn:hover {
color: var(--fg);
background: var(--surface-hover);
}
.avatar {
width: 32px;
height: 32px;
border-radius: var(--radius-pill);
display: grid;
place-items: center;
font-size: var(--text-xs);
font-weight: 600;
color: #fff;
background: linear-gradient(135deg, var(--accent), var(--accent-2));
cursor: pointer;
flex: none;
}
.ico {
flex: none;
display: block;
}
/* ── Canvas ─────────────────────────────────────────────────────────────── */
.main {
padding: var(--sp-6);
width: 100%;
flex: 1;
overflow-x: hidden;
}
/* ── Narrow screens ─────────────────────────────────────────────────────── */
/* The frame is a desktop affordance. Below the breakpoint the workspace goes
edge to edge -- a rounded card inset on a phone wastes the only axis that
matters -- and the icon bar becomes a scrollable labelled row. */
@media (max-width: 900px) {
body {
padding: 0;
}
.shell {
min-height: 100vh;
border-radius: 0;
border: 0;
box-shadow: none;
}
.topbar {
flex-wrap: wrap;
padding: var(--sp-3);
gap: var(--sp-2);
}
.nav {
order: 3;
width: 100%;
overflow-x: auto;
justify-content: flex-start;
border-radius: var(--radius-lg);
scrollbar-width: none;
}
.nav::-webkit-scrollbar {
display: none;
}
.nav-item .nav-label {
display: inline;
}
.topbar-search {
display: none;
}
.main {
padding: var(--sp-4);
}
}
+29
View File
@@ -0,0 +1,29 @@
/* Page header: title, subtitle and the actions that belong to a page. */
.page-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: var(--sp-5);
margin-bottom: var(--sp-6);
flex-wrap: wrap;
}
.page-title {
font-size: var(--text-2xl);
font-weight: 600;
letter-spacing: -0.02em;
margin: 0;
}
.page-sub {
color: var(--fg-muted);
font-size: var(--text-sm);
margin: var(--sp-1) 0 0;
}
.page-actions {
display: flex;
gap: var(--sp-2);
align-items: center;
}
+43
View File
@@ -0,0 +1,43 @@
/* Status pills. The only place status colour is decided. */
/* Status is always a pill, never bare text: a colour and a shape are read at
a glance where a word has to be parsed. */
.pill {
display: inline-flex;
align-items: center;
gap: var(--sp-1);
padding: 2px var(--sp-2);
border-radius: var(--radius-pill);
font-size: var(--text-xs);
font-weight: 500;
white-space: nowrap;
}
.pill::before {
content: "";
width: 5px;
height: 5px;
border-radius: 50%;
background: currentColor;
}
.pill-ok {
color: var(--ok);
background: var(--ok-soft);
}
.pill-warn {
color: var(--warn);
background: var(--warn-soft);
}
.pill-danger {
color: var(--danger);
background: var(--danger-soft);
}
.pill-info {
color: var(--info);
background: var(--info-soft);
}
.pill-idle {
color: var(--idle);
background: var(--idle-soft);
}
+30
View File
@@ -0,0 +1,30 @@
/* Motion preferences and narrow viewports. */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
.nav-soon {
margin-left: auto;
font-size: var(--text-xs);
color: var(--fg-subtle);
background: var(--surface-hover);
padding: 1px var(--sp-2);
border-radius: var(--radius-pill);
}
.nav-item[aria-disabled] {
opacity: 0.55;
cursor: default;
}
.nav-item[aria-disabled]:hover {
background: none;
color: var(--fg-muted);
}
+42
View File
@@ -0,0 +1,42 @@
/* Data tables. */
.table {
width: 100%;
border-collapse: collapse;
font-size: var(--text-sm);
}
.table th {
text-align: left;
font-weight: 500;
font-size: var(--text-xs);
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--fg-subtle);
padding: 0 var(--sp-3) var(--sp-3);
border-bottom: 1px solid var(--border);
}
.table td {
padding: var(--sp-3);
border-bottom: 1px solid var(--border);
color: var(--fg-muted);
}
.table tbody tr:last-child td {
border-bottom: 0;
}
.table tbody tr:hover td {
background: var(--surface-hover);
}
.table td.strong {
color: var(--fg);
font-weight: 500;
}
.mono {
font-family: var(--font-mono);
font-size: 0.95em;
}
+130
View File
@@ -0,0 +1,130 @@
/*
* Design tokens. Dark is the default because archied is a daemon you check at
* odd hours; light is a toggle, not an afterthought, so both themes define the
* same variable set and nothing else in the app references a raw colour.
*
* Semantic names only. Never `--blue`; always `--accent` or `--status-running`,
* so a palette change is one file rather than a grep.
*/
:root {
/* Type */
--font-sans:
ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
--font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
--text-xs: 0.6875rem;
--text-sm: 0.8125rem;
--text-base: 0.875rem;
--text-lg: 1.0625rem;
--text-xl: 1.375rem;
--text-2xl: 1.875rem;
--text-3xl: 2.5rem;
/* Spacing: a 4px scale. Layout uses these, never magic pixels. */
--sp-1: 0.25rem;
--sp-2: 0.5rem;
--sp-3: 0.75rem;
--sp-4: 1rem;
--sp-5: 1.5rem;
--sp-6: 2rem;
--sp-7: 3rem;
--radius-sm: 6px;
--radius-md: 10px;
--radius-lg: 14px;
--radius-xl: 20px;
--radius-pill: 999px;
--transition: 140ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* ── Dark (default) ─────────────────────────────────────────────────────── */
[data-theme="dark"] {
--bg: #0d1014;
--bg-raised: #141920;
--surface: #171d25;
--surface-hover: #1d242e;
--border: #232b36;
--border-strong: #303a48;
--fg: #e8edf4;
--fg-muted: #8b97a8;
--fg-subtle: #5d6878;
--accent: #4c8dff;
--accent-fg: #ffffff;
--accent-soft: rgba(76, 141, 255, 0.14);
/* Status. Used for task state, gate results and trend direction alike, so
the same colour always means the same thing wherever it appears. */
--ok: #3fbf7f;
--ok-soft: rgba(63, 191, 127, 0.14);
--warn: #e8a33d;
--warn-soft: rgba(232, 163, 61, 0.14);
--danger: #f0616d;
--danger-soft: rgba(240, 97, 109, 0.14);
--info: #4c8dff;
--info-soft: rgba(76, 141, 255, 0.14);
--idle: #6b7688;
--idle-soft: rgba(107, 118, 136, 0.14);
--accent-2: #7b5cff;
--bg-blur: rgba(20, 25, 32, 0.55);
/* Panels are translucent so the canvas wash shows through and the whole
workspace reads as one lit surface rather than opaque cards on a picture. */
--surface-glass: rgba(23, 29, 37, 0.62);
--surface-glass-strong: rgba(20, 25, 32, 0.78);
--workspace: rgba(17, 21, 27, 0.55);
--hairline: rgba(255, 255, 255, 0.06);
--wash-a: rgba(76, 141, 255, 0.10);
--wash-b: rgba(123, 92, 255, 0.12);
--wash-c: rgba(63, 191, 127, 0.06);
--shadow-workspace: 0 24px 70px rgba(0, 0, 0, 0.5);
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
--shadow-md: 0 8px 28px rgba(0, 0, 0, 0.42);
}
/* ── Light ──────────────────────────────────────────────────────────────── */
[data-theme="light"] {
--bg: #f6f8fb;
--bg-raised: #ffffff;
--surface: #ffffff;
--surface-hover: #f1f4f9;
--border: #e2e8f0;
--border-strong: #cbd5e1;
--fg: #16202e;
--fg-muted: #5a6779;
--fg-subtle: #8c99ab;
--accent: #2563eb;
--accent-fg: #ffffff;
--accent-soft: rgba(37, 99, 235, 0.1);
--ok: #10935c;
--ok-soft: rgba(16, 147, 92, 0.12);
--warn: #b87514;
--warn-soft: rgba(184, 117, 20, 0.12);
--danger: #d4344a;
--danger-soft: rgba(212, 52, 74, 0.12);
--info: #2563eb;
--info-soft: rgba(37, 99, 235, 0.1);
--idle: #64748b;
--idle-soft: rgba(100, 116, 139, 0.12);
--accent-2: #7c3aed;
--bg-blur: rgba(255, 255, 255, 0.6);
--surface-glass: rgba(255, 255, 255, 0.72);
--surface-glass-strong: rgba(255, 255, 255, 0.88);
--workspace: rgba(255, 255, 255, 0.55);
--hairline: rgba(15, 23, 42, 0.06);
--wash-a: rgba(37, 99, 235, 0.10);
--wash-b: rgba(124, 58, 237, 0.12);
--wash-c: rgba(16, 147, 92, 0.07);
--shadow-workspace: 0 24px 70px rgba(15, 23, 42, 0.14);
--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
--shadow-md: 0 8px 28px rgba(15, 23, 42, 0.10);
}