# Ianitor Domi web UI: hand-off for the Svelte build What apps/web and packages/ui are built from. This file is enough by itself: you never need to open the design artifact. Where the artifact and this file disagree, this file wins, and §14 lists every such place. Sources: the approved design (claude.ai artifact "Ianitor Domi — UI", 9 boards, murex palette on Domi), docs/ui-api.md (the contract), docs/api.md (the built API), crates/control/src/messages.rs (the server's sentences), ROADMAP §3 and §4, and Mark's decisions of 2026-11-07. Conventions in this file: - "Quoted text" is exact UI copy. `{x}` is a value: from `params` on an error, or from a field. **Hostnames, addresses (upstreams, paths) and match codes are bold** wherever they appear in a sentence. - **[built]** means the API exists (Phase 2). **[proposed]** means the shape is mine and the API is not built yet (engine switch, PKI, sign-in). Build the UI against the proposed shape behind a typed client, so only the client changes if control lands differently. - Click counts follow ROADMAP §4: typing is not a click; a click that only opens a menu is a click. --- ## 0. Ground rules for the build - Svelte 5 runes, TypeScript strict. apps/web holds no business logic: every decision (validation, health state, undo target, restore effects) comes from the API. The UI formats and arranges. - One typed API client (`apps/web/src/lib/api.ts`) owns: base path `/api/v1`, the `X-Ianitor-UI: 1` header on every request, `redirect: "manual"`, an `Idempotency-Key` per click (see §11.3), the error envelope, the server-clock offset (§7.2), and the signed-out and lost-contact detection (§10, §11). - Show the server's `error.message` as the sentence, verbatim. The UI switches on `error.code` only to decide which buttons to offer, which field to mark and which words to bold (`params`). The table in §12 gives every code, its sentence and its offer, so you can test that the sentence arrives and that the right button appears. The UI writes its own sentence only for `ui.*` codes and for the few codes the server has no sentence for (marked "UI text" in §12). - Never put a token, share URL, password or one-time password in `localStorage`, `sessionStorage`, the URL, a log line or an error report. Drop them from component state when their dialog closes. - Dark only. No light theme, no theme switch. - No external requests at runtime: fonts are self-hosted (§1.3), no CDN, no analytics. - Dev server on 127.0.0.1 only (`pnpm --filter web dev`, never `--host`). --- ## 1. Design tokens (packages/ui) > Since 2026-11-22 the roles, fonts and controls come from @domi/ui (docs/domi-ui.md): the colours below are its > `--domi-*` roles with Ianitor's values, and the buttons and fields are its components. The rest of this section > still describes what Ianitor keeps. ### 1.1 The block to paste `packages/ui/src/tokens.css`. Apply the class `ia` to `` (the artifact puts the tokens on `.ia`; `:root` would also work, but keep `.ia` so the shared Domi components scope the same way). The root font size is left at the browser default (16 px). The artifact rendered with rem = 16 px, so every rem value below reproduces it exactly, and the UI still follows a user's own font-size setting. Body text is 0.9375rem (15 px), as drawn. ```css .ia { /* ── Ground and structure: violet-tinted iron black ───────────────────── */ --ground: #0c0b0f; /* page ground; every ratio is measured on it */ --colonnade: #121016; /* sidebar, phone bars, menus, dialogs, side panel */ --surface: #18151d; /* fields, the last-change bar, cards */ --surface-2: #221d28; /* hover, the current place, a chosen option */ --hairline: #2c2633; /* dividers only, never a control edge */ --hairline-strong: #3c3445; /* chip and frame edges (facts, not controls) */ --control-edge: #7d7189; /* edge of every field, button, segmented control, engine chip */ /* ── Text ──────────────────────────────────────────────────────────────── */ --text: #f1edf3; /* body text, hostnames */ --text-2: #cfc6d4; /* secondary text, field labels */ --muted: #a99eb1; /* hints, section labels, times */ --disabled: #7a7183; /* disabled controls only, never content */ /* ── The lead: murex (Tyrian purple) ───────────────────────────────────── */ --accent: #e0a3dc; /* links, focus ring, the current place, running state */ --accent-strong: #f2c9ee; /* focus ring on the primary button; match codes */ --primary-high: #8d3b89; /* primary fill, top */ --primary-mid: #76306f; /* primary fill, 55 % */ --primary-low: #5c2257; /* primary fill, foot */ --primary-edge: #c77cc1; /* primary button edge */ --on-primary: #ffffff; /* label on the primary fill */ /* ── Metal ─────────────────────────────────────────────────────────────── */ --bronze: #b6adbe; /* ornaments: the interpunct rule (iron, not bronze) */ --gilt: #f6f0f7; /* the wordmark only */ /* ── Second light: quiet iron (Domi's .domi-pill and .domi-status use these) */ --second: #cfc6d4; --second-strong: #f1edf3; --second-edge: #7d7189; /* ── Status: blue / amber / vermilion, stepped in lightness (L* 84 / 68 / 58) */ --healthy: #a6d6fa; /* host answers; a change was kept. Filled dot. */ --kept: #a6d6fa; --degraded: #d99a35; /* partly failing; a change was reverted or not applied. Half dot. */ --reverted: #d99a35; --down: #e2683a; /* not reachable; needs attention; paused; danger actions. Hollow ring. */ --danger: #e2683a; --on-danger: #170804; /* text on a filled danger button (none is planned) */ --unknown: #a99eb1; /* no health check set; waiting for first check. Dashed ring. */ --running: #e0a3dc; /* queued, applying, watching, switching, waiting for Custos (= accent) */ /* Status washes (banner backgrounds) and edges. color-mix() is what the artifact uses; the resolved hex is in the comment, for tools that need a literal. */ --wash-degraded: color-mix(in srgb, var(--degraded) 10%, var(--ground)); /* #201913 */ --wash-kept: color-mix(in srgb, var(--kept) 10%, var(--ground)); /* #1b1f26 */ --wash-down: color-mix(in srgb, var(--down) 10%, var(--ground)); /* #211413 */ --edge-degraded: color-mix(in srgb, var(--degraded) 65%, var(--ground)); /* #916828 */ --edge-kept: color-mix(in srgb, var(--kept) 65%, var(--ground)); /* #708fa8 */ --edge-down: color-mix(in srgb, var(--down) 80%, var(--ground)); /* #b75531 */ --edge-outline: color-mix(in srgb, var(--accent) 60%, var(--ground)); /* #8b668a, outline button */ --hover-wash: color-mix(in srgb, var(--accent) 8%, transparent); /* quiet button hover */ --danger-hover: color-mix(in srgb, var(--danger) 7%, transparent); /* ── Type ──────────────────────────────────────────────────────────────── */ --font-inscription: Cinzel, "Trajan Pro", "Cormorant Garamond", Georgia, "Times New Roman", serif; --font-book: "Cormorant Garamond", Cormorant, "EB Garamond", Garamond, Georgia, "Times New Roman", serif; --font-hand: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif; --fs-display: 2.6rem; --lh-display: 1.1; /* book 500: a view title ("Hosts") */ --fs-h2: 1.9rem; --lh-h2: 1.15; /* book 500: panel title; phone view title uses 2.1rem */ --fs-h3: 1.45rem; --lh-h3: 1.15; /* book 600: dialog and section titles */ --fs-body: 0.9375rem; --lh-body: 1.6; /* hand 400: everything read (15 px) */ --fs-host: 0.98rem; /* hand 600: hostname in a row */ --fs-button: 0.95rem; /* hand 600; 700 on primary */ --fs-field-label: 0.92rem; /* hand 400, text-2 */ --fs-hint: 0.88rem; --lh-hint: 1.5; /* hand 400, muted: hints, notes */ --fs-sub: 0.86rem; /* hand 400, muted: row sub-lines, times */ --fs-chip: 0.78rem; /* 12.5 px, hand 400, text-2 */ --fs-state: 0.95rem; /* hand 700, all-small-caps, tracking 0.12em */ --fs-label: 0.74rem; /* hand 700, tracking 0.26em: SECTION LABELS */ --fs-nav: 0.95rem; /* sidebar item, hand 600 */ --fs-tab-phone: 0.78rem; /* bottom-bar label, hand 600 */ --fs-wordmark: 0.8125rem; /* 13 px Cinzel 500, tracking 0.3em; phone 12 px, 0.26em */ --fs-code: 2.2rem; /* Cinzel 500, tracking 0.16em: Custos match code */ --tracking-state: 0.12em; --tracking-label: 0.26em; --tracking-wordmark: 0.3em; /* ── Spacing (Domi) ────────────────────────────────────────────────────── */ --space-1: 0.35rem; /* label to its field */ --space-2: 0.6rem; /* between buttons in a row, list items */ --space-3: 1rem; /* field to field */ --space-4: 1.4rem; /* panel padding */ --space-5: 2rem; /* between sections of a view */ --space-6: 3.5rem; /* a view's bottom padding */ --target: 44px; /* minimum height and width of every control and touch target */ /* ── Radii ─────────────────────────────────────────────────────────────── */ --radius-chip: 6px; --radius-sm: 10px; /* quiet buttons, fields, nav items, menu items */ --radius: 12px; /* primary button, cards inside panels */ --radius-lg: 18px; /* panels, banners, the bar, the host list, dialogs */ --radius-pill: 999px; /* chips, the engine chip */ /* ── Shadows ───────────────────────────────────────────────────────────── */ --leaf-bevel: 0 0 0 1px rgba(199,124,193,0.25), 0 12px 40px -14px rgba(141,59,137,0.6), inset 0 1px 0 rgba(255,220,250,0.30), inset 0 -2px 0 #3a1237; /* primary button */ --carved: inset 0 2px 6px rgba(12,11,15,0.8), inset 0 -1px 0 rgba(182,173,190,0.16); /* fields */ --inset-lit: inset 0 0 18px rgba(224,163,220,0.07); /* current nav item */ --shadow-dialog: 0 40px 100px -40px rgba(0,0,0,0.95); /* dialogs, menus, popover */ --scrim: rgba(12,11,15,0.82); /* behind modals */ /* ── Focus ─────────────────────────────────────────────────────────────── */ --focus-ring: 2px solid var(--accent); /* outline, offset 3px, on every :focus-visible */ --focus-ring-primary: 2px solid var(--accent-strong); --focus-offset: 3px; --focus-halo: 0 0 0 4px rgba(224,163,220,0.16); /* fields: border goes accent, plus this halo */ /* ── Motion (Domi's transitions; the last three are new for this UI) ──── */ --dur-color: 0.3s; /* border, background, colour */ --dur-lift: 0.45s; /* box-shadow, transform (primary hover lifts 1px) */ --ease: ease; --dur-tick: 1s; /* watch progress bar: linear, one step per second */ --dur-enter: 0.18s; /* dialog, panel, menu, toast enter (opacity + 8px) */ --dur-exit: 0.12s; /* ── Layout ────────────────────────────────────────────────────────────── */ --sidebar-w: 232px; --main-pad: 26px 32px 40px; /* desktop; phone 18px 16px 20px */ --gutter-phone: 16px; --panel-w: 480px; /* add/edit host side panel */ --dialog-w: 520px; /* share, token, device dialogs */ --popover-w: 420px; /* engine popover */ --phone-bar-h: 56px; /* bottom navigation item height */ --bp-phone: 720px; /* below: phone layout (header + bottom bar) */ color-scheme: dark; background: var(--ground); color: var(--text); font-family: var(--font-hand); font-size: var(--fs-body); line-height: var(--lh-body); font-variant-numeric: tabular-nums; } .ia *, .ia *::before, .ia *::after { box-sizing: border-box; } .ia :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); } .ia h1, .ia h2, .ia h3, .ia p { margin: 0; } .ia button { font: inherit; } @media (prefers-reduced-motion: reduce) { .ia *, .ia *::before, .ia *::after { animation: none !important; transition: none !important; } } ``` Two things the artifact's theme.css also does, which you must keep in packages/ui: the Domi button edges raised for contrast (`.domi-btn` edge = `--control-edge`; outline button edge = `--edge-outline`; danger edge = `--edge-down`; primary edge = `--primary-edge`), and the primary gradient `linear-gradient(180deg, var(--primary-high) 0%, var(--primary-mid) 55%, var(--primary-low) 100%)`. ### 1.2 Contrast, every pair used (WCAG 2.x) Measured with the resolved hex values above. AA needs 4.5:1 for text, 3:1 for large text (24 px, or 18.7 px bold) and for control edges and focus indicators (1.4.11). **Text on the backgrounds it appears on** | Text \ background | ground #0c0b0f | colonnade #121016 | surface #18151d | surface-2 #221d28 | wash-degraded #201913 | wash-kept #1b1f26 | wash-down #211413 | |:--|--:|--:|--:|--:|--:|--:|--:| | text #f1edf3 | 16.95 | 16.33 | 15.59 | 14.24 | 15.00 | 14.28 | 15.46 | | text-2 #cfc6d4 | 11.85 | 11.41 | 10.90 | 9.95 | 10.48 | 9.98 | 10.80 | | muted #a99eb1 | 7.67 | 7.39 | 7.06 | 6.44 | 6.79 | 6.46 | 6.99 | | accent #e0a3dc (links, running) | 9.76 | 9.39 | 8.97 | 8.19 | 8.63 | 8.22 | 8.89 | | accent-strong #f2c9ee (match code) | 13.42 | 12.92 | 12.34 | 11.27 | n/u | n/u | n/u | | healthy / kept #a6d6fa | 12.72 | 12.25 | 11.70 | 10.69 | n/u | 10.72 | n/u | | degraded / reverted #d99a35 | 8.06 | 7.76 | 7.41 | 6.77 | 7.13 | n/u | n/u | | down / danger #e2683a | 5.86 | 5.65 | 5.39 | 4.92 | n/u | n/u | 5.34 | | gilt #f6f0f7 (wordmark) | 17.49 | 16.85 | n/u | n/u | n/u | n/u | n/u | | disabled #7a7183 | 4.22 | 4.06 | 3.88 | 3.54 | | | | n/u = not used together. Every used pair passes AA for small text. `disabled` is below 4.5 by design: WCAG exempts inactive controls, and a disabled control always has its reason in readable text nearby. Never use `disabled` for content. Button labels on fills: on-primary #fff on primary-high 6.73, on primary-mid 8.67, on primary-low 11.53 (the label sits across the gradient, so the floor is 6.73). on-danger on down 5.85 (reserved). Quiet-button hover background (8 % accent over ground, #1d171f): text 15.19, text-2 10.62. **Edges and indicators (3:1 needed)** | Element | Against | Ratio | |:--|:--|--:| | control-edge #7d7189 (fields, quiet buttons, engine chip, segmented control) | ground / colonnade / surface / surface-2 | 4.29 / 4.13 / 3.95 / 3.61 | | control-edge on banner washes | degraded / kept / down | 3.80 / 3.62 / 3.91 | | outline-button edge #8b668a | ground / colonnade / surface | 4.08 / 3.93 / 3.75 | | danger-button edge #b75531 | ground / colonnade | 4.07 / 3.92 | | primary-edge #c77cc1 | ground / colonnade | 6.62 / 6.37 | | focus ring accent #e0a3dc | ground / surface-2 | 9.76 / 8.19 | | focus ring on primary, accent-strong | ground (outside the button) / primary-high | 13.42 / 4.61 | | banner edges degraded #916828 / kept #708fa8 / down #b75531 | ground | 3.94 / 5.78 / 4.07 | | status dots healthy / degraded / down / unknown | ground | 12.72 / 8.06 / 5.86 / 7.67 | | progress fill accent | track surface-2 | 8.19 | | chosen segment ring (accent 55 % over surface-2, #8b678b) | surface-2 | 3.46 | Decoration only, not required to pass: hairline 1.34, hairline-strong 1.65 (dividers and chip edges; chips are facts, not controls). Status colours against each other: healthy/degraded 1.58, degraded/down 1.37. Not enough alone, which is why every status carries a word and a shape (§2.2). Never colour alone. ### 1.3 Fonts Self-host the Latin woff2 subsets in packages/ui/fonts (all OFL): Cinzel 500; Cormorant Garamond 500, 600, 500 italic; Manrope 400, 600, 700. `font-display: swap`. No Google Fonts request at runtime (the UI runs on a home server behind Authelia and makes no outside requests). Italic Cormorant is only in the Domi system; this UI does not use it. Where each face goes: Cinzel only for the wordmark "IANITOR DOMI" (written in capitals as is, never text-transformed) and the Custos match code. Cormorant Garamond (book) only for headings: view title, panel title, dialog title. Manrope (hand) for everything else. --- ## 2. Components Each component lists: what it looks like, states, keyboard, ARIA. Class names follow the artifact (`ia-*`, `domi-*`) so packages/ui can carry the CSS as drawn; Svelte components wrap them. ### 2.1 Buttons (`Button.svelte`, Domi `.domi-btn`) | Variant | Look | Use | |:--|:--|:--| | primary | min-height 50px, padding 0 1.6rem, radius 12px, gradient fill, primary-edge, leaf-bevel, label #fff 700 | at most one per screen: "+ Host", "Apply", "Restore this version", "Copy link", "Issue", "Copy token", "Restore the last kept version" in the needs-attention banner | | quiet (default) | min-height 44px, padding 0 1.1rem, radius 10px, transparent, control-edge, text-2 600 | Undo, Cancel, Close, secondary actions | | outline | as quiet, edge #8b668a, label accent | an action inside a banner or card that leads but is not the primary: "Renew", "Edit and try again", "+ Device", "New token", "Switch to Caddy", "Turn on share links and copy link" | | danger | as quiet, edge #b75531, label danger | "Revoke", "Stop all share links", menu item "Remove host" (as menu text colour) | | link | no edge, no padding, accent, underline offset 0.2em, hit area ≥ 44px tall (pad vertically) | "More options…", "Show details", "Add a password", "See history" | States: hover (quiet: edge accent, bg `--hover-wash`, label text; primary: lifts 1px), focus-visible (2px accent outline, offset 3px; primary uses accent-strong), active (no extra style), pending, disabled. - **Pending**: after a click that waits on the API for more than 300 ms, keep the label, add a 16px spinner before it, set `aria-busy="true"` and `aria-disabled="true"`, ignore further clicks. No width change (reserve the spinner slot). - **Disabled**: use `aria-disabled="true"` (not the `disabled` attribute) so the button stays focusable and its reason can be read: `aria-describedby` points at the visible reason text. Look: label `--disabled`, edge `--hairline`, no hover. - Icon-only buttons (`.ia-icon-btn`, 44×44, radius 10px, text-2): always an `aria-label` ("More for photos.home.example", "Close"). - Icons are inline stroke SVGs, 18px, stroke 1.8–2.2, `aria-hidden="true"`. The artifact's set: plus, undo arrow, check, clock, link, pencil, history, trash, key, gear, building (hosts), swap arrows, copy, chevron down, dots. ### 2.2 Status: dot and word (`Status.svelte`) Always the pair: a 12px shape (decorative, `aria-hidden`) plus a word in small capitals (700, `font-variant-caps: all-small-caps`, tracking 0.12em, 0.95rem). The word is the accessible text. | `data-s` | Dot | Word colour | Words used | |:--|:--|:--|:--| | healthy | filled circle, healthy | healthy | "healthy" | | kept | (no dot; check icon) | kept | "kept" | | degraded | 2px ring, left half filled, degraded | degraded | "degraded" | | reverted | (undo-arrow icon) | reverted | "reverted", "not applied" | | down | 3px hollow ring, down | down | "down", "needs attention", "paused", "renew now", "expired" | | unknown | 2px dashed ring, unknown | muted | "not checked", "waiting" (pending health), "stopped", "revoked" | | running | clock icon, accent | accent | "waiting", "applying", "watching", "switching" | The degraded dot: `border: 2px solid var(--degraded); background: linear-gradient(90deg, var(--degraded) 50%, transparent 50%)`. A dot with no word is only allowed where the word is next to it in the same row on phone (the phone row repeats the word in the sub-line). ### 2.3 Chips (`Chip.svelte`, `.ia-chip`) Facts about a host, not controls: pill, 1px hairline-strong, text-2, 12.5px, `white-space: nowrap`, padding 1px 10px, gap 6px between chips, wraps. Not focusable, no role. | Field | Chip text | |:--|:--| | tls = domi | "Domi certificate" | | tls = letsencrypt | "Let's Encrypt" | | auth = forward-auth | "Sign-in first" | | auth = none | no chip (see open question Q11) | | share_links = true | "Share links on" | | websockets = false | "No websockets" (G19: no chip when true, the default) | | access_log = truncated | "Visit log on" | ### 2.4 Engine chip (`EngineChip.svelte`, `.ia-engine`) A control: pill, min-height 44px, padding 0 16px 0 14px, control-edge, surface background, text 600 0.92rem. Content: status dot · `` "Engine" (muted, 400) · engine name · chevron down. - Pingora running: dot healthy, "Engine Pingora". - Caddy running: dot healthy, "Engine Caddy" ``"(fallback)"``. - Switching: clock icon in accent instead of the dot, "Engine Switching…". - Stopped (control cannot reach the engine, `engine.state = "stopped"`): dot down, "Engine Pingora" and the word is announced: accessible name "Engine: Pingora, not answering". Phone: no "Engine" label (as drawn): dot · name · chevron, padding 0 12px. `