Repository navigation
feat(control-ui): add the Absolutely theme with self-hosted typography - #129885
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Adds the woff2 faces the Absolutely theme paints in, plus the stylesheet that declares them. Both families are SIL Open Font License 1.1 and ship unmodified, with their upstream license text beside the files as the license requires. Latin and latin-ext subsets only, 184 KB total. Serving these from the gateway rather than a font CDN keeps font-src 'self' intact, avoids a third-party request on every load, and works on an offline or LAN-only gateway. The stylesheet is a static asset rather than a bundled import: it is linked at runtime only while a theme that declares faces is active, so it stays out of the startup CSS budget and out of every other theme's load.
Adds a fourth built-in Control UI theme: terracotta clay on warm graphite in dark mode, burnt clay on ivory in light mode, with its own typography — Space Grotesk for chrome and Lora for chat prose. Typography is theme-owned rather than global. A new --font-chat token defaults to --font-body, so every other theme is byte-for-byte unchanged, and the face declarations live in a static stylesheet that the theme applier links only while a theme that declares fonts is active. Themes without declared faces issue no font request at all. The faces themselves are vendored in the preceding commit. Also fixes two defects found while building it: - Theme cards overflowed their border on long labels: the grid's 1fr label track floors at min-content, so a long name pushed the trailing column past the card edge. The track is now minmax(0, 1fr) with an ellipsis, which also covers imported tweakcn labels. The selected-state checkmark that made the overflow visible is gone; the accent border, tint, and ring already carry selection, and aria-pressed owns the semantics. - index.html's first-paint bootstrap only knew claw/knot/dash, so any new theme flashed the default palette before the app corrected it. It now resolves the new theme and has a matching pre-paint background, with mount-fallback coverage for both modes. Startup JS grows 198 B for the theme wiring, appearance option, locale strings, and font loader, which fits the existing ratchet tolerance, so no budget baseline moves. Startup CSS stays within its 45 KiB ceiling, which is why the faces are a linked static asset rather than a bundled import.
7af5938 to
820978d
Compare
The generated @font-face block kept its upstream single-line unicode-range declarations, which oxfmt wraps. Repo-wide `pnpm format:check` is clean.
Reuses the chat-flow requireRecord/requireString helpers instead of asserting the params shape, so runId is a real string rather than an unknown coerced by String() (oxlint no-base-to-string).
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 3:41 AM ET / 07:41 UTC. ClawSweeper reviewWhat this changesThis PR adds an Absolutely Control UI theme with conditional self-hosted fonts, theme-card overflow handling, and startup-paint support. Merge readinessKeep open for maintainer product/merge review. The prior mounted-path finding is addressed on the PR head, and no new concrete patch defect was found; current-main blob hydration failed locally, so current-main equivalence could not be independently completed. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Control UI reads synced appearance preferences and resolves them into browser theme tokens during startup and preference changes. The selected Absolutely theme additionally loads a Gateway-served stylesheet containing its local font faces. flowchart LR
A[Synced appearance preference] --> B[Theme resolver]
B --> C[Startup and live theme application]
C --> D[Conditional font stylesheet]
D --> E[Gateway static font assets]
C --> F[Control UI chrome and chat]
E --> F
Decision needed
Why: This is a new core visual capability with vendored assets and a synchronized preference value; correctness does not establish whether that product scope is desired. Before merge
Agent review detailsSecurityNone. PR surfaceSource +531, Tests +216, Docs 0. Total +747 across 29 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: If maintainers endorse another bundled theme, retain the conditional local-font design and land after exact-head CI confirms the UI/config paths; do not add a parallel theme mechanism. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature PR; its browser behavior is covered by supplied visual evidence and focused browser tests rather than a reported failure reproduction. Is this the best way to solve the issue? Unclear on product scope: the implementation reuses the existing theme, preference, and public-asset owners, but maintainers must decide whether another bundled theme and its font payload belong in core. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0dfd87ebe781. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
The theme font stylesheet and its faces used root-absolute URLs, so a gateway served under a configured Control UI base path (gateway.controlUi.basePath, for example /openclaw) fetched them from the wrong origin path. Both requests 404ed there and Absolutely silently fell back to system fonts while its palette still applied, which reads as "the theme looks a bit off" rather than as a broken asset. The link href now goes through inferControlUiPublicAssetPath, the same helper plugin art and provider icons already use, and the stylesheet's own url() references are relative to it, so both levels follow the mount without the loader knowing the base path. Adds an e2e case under /openclaw asserting the resolved href and that the browser fetches below the mount; it fails on the previous code with the root-absolute path. Reported by ClawSweeper review on #129885.
|
Thanks — the base-path finding was correct and is fixed in Route theme fonts through the configured UI base path (P2) — done. Both levels were root-absolute. The link href now resolves through Added a mounted-path E2E case ( Merge risk (P1) — resolved by the above. Non-root mounts now get the theme's typography rather than a silent fallback to system faces. Stored data model — skipping, false positive. The report lists The one genuine persistence note is the one already flagged under review metrics: Gates re-run on the new head: full |
…d test `bounds dedicated reads without timing out shared clients` asserted the mock server received exactly two requests, but the read client aborts at 20ms and the server records on arrival, so whether the aborted request lands first is a race. It failed on a loaded CI runner with 1 received. The bound is still asserted directly (read rejects, shared resolves); the count now only requires the shared client's arrival, and checks its token so the dedicated client is still proven not to have carried the call. Unrelated to this PR's theme work; fixed here rather than left red.
|
Merged via squash.
|
openclaw#129885) * chore(control-ui): vendor Space Grotesk and Lora webfont subsets Adds the woff2 faces the Absolutely theme paints in, plus the stylesheet that declares them. Both families are SIL Open Font License 1.1 and ship unmodified, with their upstream license text beside the files as the license requires. Latin and latin-ext subsets only, 184 KB total. Serving these from the gateway rather than a font CDN keeps font-src 'self' intact, avoids a third-party request on every load, and works on an offline or LAN-only gateway. The stylesheet is a static asset rather than a bundled import: it is linked at runtime only while a theme that declares faces is active, so it stays out of the startup CSS budget and out of every other theme's load. * feat(control-ui): add the Absolutely theme with self-hosted typography Adds a fourth built-in Control UI theme: terracotta clay on warm graphite in dark mode, burnt clay on ivory in light mode, with its own typography — Space Grotesk for chrome and Lora for chat prose. Typography is theme-owned rather than global. A new --font-chat token defaults to --font-body, so every other theme is byte-for-byte unchanged, and the face declarations live in a static stylesheet that the theme applier links only while a theme that declares fonts is active. Themes without declared faces issue no font request at all. The faces themselves are vendored in the preceding commit. Also fixes two defects found while building it: - Theme cards overflowed their border on long labels: the grid's 1fr label track floors at min-content, so a long name pushed the trailing column past the card edge. The track is now minmax(0, 1fr) with an ellipsis, which also covers imported tweakcn labels. The selected-state checkmark that made the overflow visible is gone; the accent border, tint, and ring already carry selection, and aria-pressed owns the semantics. - index.html's first-paint bootstrap only knew claw/knot/dash, so any new theme flashed the default palette before the app corrected it. It now resolves the new theme and has a matching pre-paint background, with mount-fallback coverage for both modes. Startup JS grows 198 B for the theme wiring, appearance option, locale strings, and font loader, which fits the existing ratchet tolerance, so no budget baseline moves. Startup CSS stays within its 45 KiB ceiling, which is why the faces are a linked static asset rather than a bundled import. * style(control-ui): format the vendored font stylesheet The generated @font-face block kept its upstream single-line unicode-range declarations, which oxfmt wraps. Repo-wide `pnpm format:check` is clean. * test(control-ui): type the chat runId in the typography e2e Reuses the chat-flow requireRecord/requireString helpers instead of asserting the params shape, so runId is a real string rather than an unknown coerced by String() (oxlint no-base-to-string). * fix(control-ui): resolve theme fonts against the configured UI mount The theme font stylesheet and its faces used root-absolute URLs, so a gateway served under a configured Control UI base path (gateway.controlUi.basePath, for example /openclaw) fetched them from the wrong origin path. Both requests 404ed there and Absolutely silently fell back to system fonts while its palette still applied, which reads as "the theme looks a bit off" rather than as a broken asset. The link href now goes through inferControlUiPublicAssetPath, the same helper plugin art and provider icons already use, and the stylesheet's own url() references are relative to it, so both levels follow the mount without the loader knowing the base path. Adds an e2e case under /openclaw asserting the resolved href and that the browser fetches below the mount; it fails on the previous code with the root-absolute path. Reported by ClawSweeper review on openclaw#129885. * test(slack): stop racing the aborted read request in the Web API bound test `bounds dedicated reads without timing out shared clients` asserted the mock server received exactly two requests, but the read client aborts at 20ms and the server records on arrival, so whether the aborted request lands first is a race. It failed on a loaded CI runner with 1 received. The bound is still asserted directly (read rejects, shared resolves); the count now only requires the shared client's arrival, and checks its token so the dedicated client is still proven not to have carried the call. Unrelated to this PR's theme work; fixed here rather than left red.




What Problem This Solves
The Control UI ships three built-in themes, all of them cool-toned and all of them typographically identical: every theme renders in whatever sans the operator's OS provides. The
--font-bodytoken nominally asks for Inter, but nothing self-hosts it, so in practice the UI is SF Pro on macOS and Segoe UI on Windows and there is no way to pick a different feel.This adds a fourth theme, Absolutely — warm, paper-and-clay, with its own typography — for operators who want the console to read like a writing surface instead of a control panel.
Why This Change Was Made
The theme is terracotta clay on warm graphite in dark mode and burnt clay on ivory in light mode, and it is the first theme with typography of its own: Space Grotesk for chrome, Lora for chat prose.
Typography is deliberately theme-owned, not global. A new
--font-chattoken defaults to--font-body, so Claw, Knot, and Dash are byte-for-byte unchanged. The face declarations live in a static stylesheet that the theme applier links only while a theme that declares fonts is active, which means a default-theme load issues no font request at all — asserted directly in the new e2e test.Both families are OFL-1.1 and vendored unmodified with their upstream license text, latin and latin-ext subsets only, 184 KB total. They are served from the gateway rather than a font CDN: this keeps
font-src 'self'intact, avoids a third-party request on every page load, and works on an offline or LAN-only gateway. (The CSP already permits Google Fonts, so the CDN was available — self-hosting is a deliberate choice, not a workaround.)Two defects surfaced while building this and are fixed here rather than left behind:
1frlabel track floors at min-content, so a label longer than "Claw" pushed the trailing column past the card edge — measured atscrollWidth173 againstclientWidth163, with the trailing element's right edge 10px outside the card. The track is nowminmax(0, 1fr)with an ellipsis, which also covers imported tweakcn labels, verified with a 44-character label. The selected-state checkmark that made the overflow visible is removed: the accent border, tint, and ring already carry selection, andaria-pressedowns the semantics (the checkmark wasaria-hidden). The active skin is strengthened to stay clearly ahead of hover now that it stands alone.claw|knot|dash. Any new theme flashed the default palette before the app corrected it.index.htmlnow resolves the new theme and has a matching pre-paint background, withmount-fallbackcoverage for both modes and a matcher that no longer breaks when the theme map changes.Non-goals: no existing theme changes appearance, and no global typography change.
User Impact
Operators get a fourth theme in Settings → Appearance, in both light and dark, with chat prose set in a reading serif while chrome, chips, tables, and code stay in the UI face. Selecting it is the only way to get the new fonts; every other theme loads exactly what it loads today.
Long theme names — including imported tweakcn themes — no longer spill outside their card.
Evidence
Palette and typography, captured from a real browser against the built bundle:
Chat — default Claw (unchanged, system sans):
Chat — Absolutely (Space Grotesk chrome, Lora prose):
Appearance panel, dark and light:
Accessibility. Every text-token-on-surface pairing is asserted at WCAG AA by the existing guardrails, which the new theme is now enumerated in (
base-theme-contrast.node.test.ts,theme-contrast.test.ts,theme-muted-contrast.e2e.test.ts). Worst measured pair in a real browser:--mutedon--bg-mutedat 4.68:1 (dark) and 4.80:1 (light), both above the 4.5:1 floor. I confirmed the guardrail actually covers the new theme by temporarily dimming--mutedand watching it fail with five namedabsolutely:violations.New regression test (
ui/src/e2e/theme-typography.e2e.test.ts, 2 tests): asserts the font stylesheet is linked, both families reachloaded, every/fonts/response is 200, and the computed primary family is Space Grotesk for chrome and Lora for chat prose — and, for a default theme, that no link is injected and no font request is made at all.Live gateway. An isolated gateway (own state dir, port 19317) serves
/fonts/absolutely.cssand the woff2 faces at HTTP 200.Bundle budgets. Startup CSS stays within its 45 KiB ceiling, which is why the faces are a linked static asset rather than a bundled import — declaring them in the startup stylesheet pushed it over. Startup JS grows 198 B (theme wiring, appearance option, locale strings, font loader), which fits the existing ratchet tolerance, so no budget baseline moves in this PR and the fixed 350 KiB ceiling is untouched.
Tests and checks.
ui/src/styles,ui/src/app,ui/src/pages/config(1,203 passed),src/config(3,511 passed), the two theme e2e suites,pnpm ui:i18n:verifyclean with no baseline drift,check-changedclean, and a cleanpnpm ui:build. Autoreview (Codex, gpt-5.6-sol, high) returned no findings.Only
en.tscarries new locale strings; the translation workflow owns the other locales post-merge.