diff --git a/CLAUDE.md b/CLAUDE.md index dff64d5..44597f8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,7 +9,7 @@ crates/core config model, schema, compilers (Pingora runtime + Caddy JSON), crates/edge Pingora data plane. Reads compiled config, serves traffic. Never decides policy. crates/control API, git routes repo, apply/rollback, share links, PKI flows. Loopback only. Never serves public traffic. apps/web Svelte 5 (runes, TypeScript strict). A client of the API; no logic. -packages/ui shared dark Domi theme, murex palette. +packages/ui Ianitor's own components on @domi/ui (the shared Domi design system, pinned by tag; docs/domi-ui.md). tests/diff same requests against Ianitor and Caddy, responses compared. tests/support shared test fixtures (test CA, upstreams, mock Authelia, clients); test-only. tests/fuzz cargo-fuzz targets. diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 92c3e9d..e739539 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -170,6 +170,22 @@ Identity gate, tunnel, Domi templates, ACME server, HTTP/3, migrating public sit ## 10. Handover (Rewritten at the end of every session: what changed, what was not verified, which build is deployed, the next step.) +**2026-11-22: the web UI on @domi/ui, the shared Domi design system (docs/domi-ui.md). Open as a PR, not merged.** +- **Changed:** `@domi/ui` v1.0.0 pinned by tag in apps/web and packages/ui; its fonts, roles (`data-domi-room="ianitor"`, + the same hex) and controls replace Ianitor's copies. Buttons are its Button through Ianitor's adapter (desktop sizes + kept); every text field is its TextField with a seal; checkboxes, the secret picker and segmented controls are its + components. Ianitor's 22 role names are renamed to `--domi-*`; its own tokens and components stay in packages/ui. + Disabled buttons are natively disabled now (their reasons are visible text). A types-only shim covers + @domi/ui's Strike.svelte until it is fixed upstream. +- **Tests:** vitest 21; svelte-check clean; Playwright web 6/6 (the Apply lookup is exact now), aula 5/5; 13 screens + compared before and after (in the PR). No Rust change. +- **Deployed:** nothing. +- **Blocker (Mark):** domi-design is private, and the Nix build fetches pnpm dependencies without credentials, so + `nix build .#ianitor` would fail. Either Gitea serves domi-design to anonymous readers (as domi-pki), or Ianitor + vendors the tagged files. Then update `fetchPnpmDeps`'s hash in deploy/nixos/web.nix and merge. +- **Not verified:** the Nix build; Fabrica's runners installing @domi/ui; a phone (the 48 px touch sizes). + + **2026-11-22: Phase 4, hardening and release.** - **Changed:** - Edge: a 60 s header deadline (slowloris), lookups on its own bounded resolver threads with one lookup per name, pipelining on both listeners, a proxy socket (`/run/ianitor-proxy/edge.sock`, sticky 3770) on which edge trusts Caddy's X-Forwarded-For, and `unix:` upstreams with a strict charset. diff --git a/docs/domi-ui.md b/docs/domi-ui.md new file mode 100644 index 0000000..c00d7c9 --- /dev/null +++ b/docs/domi-ui.md @@ -0,0 +1,86 @@ +# Ianitor on @domi/ui + +The web UI's controls and roles come from **@domi/ui**, the shared Domi design system (Gitea `mnovak/domi-design`, +its `docs/INTEGRATE.md` and `docs/MIGRATION.md`). It is pinned by tag in `apps/web` and `packages/ui`: + +```json +"@domi/ui": "git+https://gitea.marek-novak.cz/mnovak/domi-design.git#v1.0.0" +``` + +The lockfile holds the tag's commit (a8d69a9). Upgrade by changing the tag after reading its CHANGELOG.md. + +## What comes from where + +| Part | From | Notes | +| :-- | :-- | :-- | +| Fonts (Cinzel, Cormorant Garamond, Manrope; latin and latin-ext) | @domi/ui `domi.css` | bundled from npm, nothing fetched at run time. The `@fontsource` packages are gone | +| Roles: ground, text, accent, leaf, ok, warning, danger | @domi/ui, `data-domi-room="ianitor"` on `` | the same hex as before (domi-design PALETTE.md). Ianitor's old names are renamed to `--domi-*` (MIGRATION.md, ianitor table); no legacy alias file | +| Buttons | @domi/ui `Button`, through Ianitor's `Button.svelte` | see the mapping below | +| Text fields | @domi/ui `TextField`, every one with its seal | see the actions below | +| Checkboxes, the secret picker, segmented controls | @domi/ui `Checkbox`, `Select`, `Segmented` | Ianitor's `Segmented.svelte` keeps the visible name above the choices | +| Banners, dialogs, status, chips, lists, menus, toasts, the number and file inputs | Ianitor (`packages/ui`, `ia-*`) | Ianitor's own tokens (status names, washes, type sizes, spacing, radii) stay in `packages/ui/src/tokens.css` | + +`packages/ui` is now Ianitor's own components on top of @domi/ui. Its old `.domi-btn`, `.domi-field` and +`.domi-input` rules are gone (they had the same class names as @domi/ui's); the link-style button is `.ia-link`. + +## Buttons + +| Ianitor | @domi/ui | Desktop height | +| :-- | :-- | :-- | +| default (`quiet`), `outline` | `plate`, size `lg` | 44 px, as before | +| `primary` | `primary` (the leaf), size `xl` | 50 px, as before | +| `danger` | `danger`, size `lg` | 44 px | +| `small` | size `md` | 34 px (was 36) | +| `full` | `block` | | +| `pending` | `status="loading"` (the interpuncts) | | +| `label` | the accessible name, through `aria-labelledby` | "+ Host" is still "Add a host" | + +On a touch screen every button is at least 48 px (@domi/ui). An `onclick` that returns a Promise shows loading, +then a check or a refusal, by itself. + +**A change in behaviour:** a disabled button is now natively disabled, so it is skipped by Tab. Before, it was +`aria-disabled` and stayed focusable so its reason could be read. Every disabled button with a reason (Apply, +Restore this version, + Host while changes are blocked) shows that reason as visible text beside it, which is +@domi/ui's rule ("say elsewhere why"). Copy link is *working*, not disabled, while the link is being made, so the +share dialog still opens with the focus on it. + +## Text fields and their seals + +| Field | Seal | Enter | +| :-- | :-- | :-- | +| Host form: every text field but the last | `next` | goes to the next field | +| Host form: the last text field shown | `save`, "Apply this host" | applies the form, as Apply does | +| Share link: only addresses starting with | `save`, "Make the link for these addresses" | makes a new link (as leaving the field did) | +| Share link: password | `save`, "Ask for this password on the link" | as Use this password | +| Device name | `send`, "Request the certificate" | as Issue | +| New token's name | `save`, "Rename the token" | renames it now (before, only when the dialog closed) | +| Signed certificate (pasted) | `send`, "Use the pasted certificate" | a new line (`enterSends="never"`); Ctrl+Enter or the seal uses it | + +The host form still checks a field when the focus leaves it, now when it leaves the field and its seal. + +## Type checking: a shim until @domi/ui fixes Strike.svelte + +@domi/ui 1.0's `index.ts` imports `Strike.svelte`, which has no `