Repository navigation
fix(ui): resolve undefined --panel-2 token and harden the theme-token guard - #113776
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 25, 2026, 1:26 PM ET / 17:26 UTC. ClawSweeper reviewWhat this changesThe PR replaces an undefined skills-page panel token with the canonical elevated-panel token, expands the theme-token guard to scan Control UI CSS and TypeScript templates, and updates the spacing-scale guidance comment. Merge readinessKeep this PR open: it addresses a concrete Control UI rendering defect with a bounded source-level guard, but the Priority: P3 Review scores
Verification
How this fits togetherControl UI components render their styles from the canonical theme tokens in flowchart LR
A[Canonical theme tokens] --> B[Control UI components]
B --> C[Skills-page verdict callout]
C --> D[Rendered panel background]
A --> E[Theme-token guard test]
F[CSS and TypeScript templates] --> E
E --> G[Reject known undefined aliases]
Decision needed
Why: The code path is bounded and the supplied proof is relevant, but repository policy keeps items carrying the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +2, Tests +14. Total +16 across 3 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the narrow token substitution and source-boundary guard after refreshing the branch against current Do we have a high-confidence way to reproduce the issue? Yes, from source: the skills-page callout references Is this the best way to solve the issue? Yes. Replacing the undefined use with the existing canonical token and extending the existing guard to the affected CSS-and-TypeScript source boundary is narrower and safer than introducing a new theme alias. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ce7ec43c4501. 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
|
… guard The skills page ClawHub verdict callout referenced var(--panel-2), which is defined nowhere, silently dropping its background; use the canonical --panel-strong tier. Extend base-theme-tokens.node.test.ts to every alias name this bug class has produced (--success/--warning/--panel-2 included) and scan all of ui/src including TS inline styles and Lit css templates, not just the styles directory. Codify the real spacing-scale policy in base.css: settings surfaces use --space-*, elsewhere raw px is grandfathered and migrates opportunistically.
a1d448d to
f9ce02e
Compare
|
Merged via squash.
|
… guard (openclaw#113776) The skills page ClawHub verdict callout referenced var(--panel-2), which is defined nowhere, silently dropping its background; use the canonical --panel-strong tier. Extend base-theme-tokens.node.test.ts to every alias name this bug class has produced (--success/--warning/--panel-2 included) and scan all of ui/src including TS inline styles and Lit css templates, not just the styles directory. Codify the real spacing-scale policy in base.css: settings surfaces use --space-*, elsewhere raw px is grandfathered and migrates opportunistically.
Control UI declares its typography tokens once, in ui/src/styles/base.css: --mono and --font-body. Fifteen rules asked for --font-mono / --font-sans instead, names that only exist in other documents (canvas widget host, provider OAuth page, MCP Apps spec keys). Those references are invalid at computed-value time, so the declarations were dropped: nine had no fallback and silently inherited the body font, and the four `font:` shorthand sites lost their size, weight, and line height along with the family. Point every reference at the canonical token and drop the now-dead generic fallbacks so ui/src has one spelling per font token. ui/src/styles/base-theme-tokens.node.test.ts already guards this bug class for color tokens (#113726, #113776) but never listed the font aliases; add them so a re-introduction fails the existing lane instead of shipping.
Control UI declares its typography tokens once, in ui/src/styles/base.css: --mono and --font-body. Fifteen rules asked for --font-mono / --font-sans instead, names that only exist in other documents (canvas widget host, provider OAuth page, MCP Apps spec keys). Those references are invalid at computed-value time, so the declarations were dropped: nine had no fallback and silently inherited the body font, and the four `font:` shorthand sites lost their size, weight, and line height along with the family. Point every reference at the canonical token and drop the now-dead generic fallbacks so ui/src has one spelling per font token. ui/src/styles/base-theme-tokens.node.test.ts already guards this bug class for color tokens (#113726, #113776) but never listed the font aliases; add them so a re-introduction fails the existing lane instead of shipping.
Control UI declares its typography tokens once, in ui/src/styles/base.css: --mono and --font-body. Fifteen rules asked for --font-mono / --font-sans instead, names that only exist in other documents (canvas widget host, provider OAuth page, MCP Apps spec keys). Those references are invalid at computed-value time, so the declarations were dropped: nine had no fallback and silently inherited the body font, and the four `font:` shorthand sites lost their size, weight, and line height along with the family. Point every reference at the canonical token and drop the now-dead generic fallbacks so ui/src has one spelling per font token. ui/src/styles/base-theme-tokens.node.test.ts already guards this bug class for color tokens (openclaw#113726, openclaw#113776) but never listed the font aliases; add them so a re-introduction fails the existing lane instead of shipping.
What Problem This Solves
Closes out the Carapace design-contract review series (#113684, #113724, #113726). A final sweep of all of
ui/src— CSS plus TS inline styles and Litcsstemplates — found one surviving undefined-token bug: the skills page's ClawHub verdict callout usesvar(--panel-2), which is defined nowhere, so its background silently drops and the callout renders flat on the page. The token guard test added in #113726 only covers six alias names and only scansui/src/styles/*.css, so this class of bug could keep reappearing in TS templates. Separately,base.cssstill carried a spacing mandate ("use--space-*instead of hardcoded px") that ~800 existing sites ignore, leaving contributors with a rule that contradicts the codebase.Why This Change Was Made
The callout maps to the canonical
--panel-strongtier. The guard test now covers every alias name this bug class has produced (--success,--warning,--warning-subtle,--panel-2, and the six from #113726) and scans all.cssand non-test.tsfiles underui/src, killing the class rather than patching instances. The spacing comment now codifies the actual policy: settings surfaces use the scale (perui/docs/design-system/settings-design.md, which settings.css follows), everywhere else raw px is grandfathered and migrates opportunistically when rules are rewritten — no mass migration.User Impact
The ClawHub verdict callout on the skills page gets its intended elevated panel background (previously invisible). No other visual change; the test and comment changes are contributor-facing only.
Evidence
node scripts/run-vitest.mjs ui/src/styles/base-theme-tokens.node.test.ts: 2/2 passing with the extended name list over all ofui/src— proving no other instance of this bug class exists anywhere in the Control UI today.node scripts/check-changed.mjsover the three touched files: coreTests + ui lanes green on delegated Testbox (exit 0).gpt-5.6-sol, xhigh): clean, 0 findings.base.cssby scripted comparison (token names and hex values): all six docs clean.(Artifact manifest: https://artifacts.openclaw.ai/pr-carapace-closeout-a1d448d5ecc/artifact-manifest.json)