ui: refresh dashboard-v2 theme and visual styles#36856
ui: refresh dashboard-v2 theme and visual styles#36856BunsDev wants to merge 1 commit intodashboard-v2-structurefrom
Conversation
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🟡 Phishing/UI deception risk: automatic blurring of link text via chat-link-tail-blur class
DescriptionThe UI introduces a new CSS rule that blurs the rendered text of certain links in chat messages, only revealing the link on hover/focus. This becomes security-relevant because the class is applied automatically during markdown sanitization for any anchor whose
Vulnerable behavior (CSS): .chat-text :where(a.chat-link-tail-blur) {
filter: blur(4px);
}Relevant application logic (not in diff but activates the new CSS): if (href.toLowerCase().includes("tail")) {
node.classList.add("chat-link-tail-blur");
}Notes:
RecommendationAvoid obscuring link destinations in security-relevant contexts (chat content is adversary-controllable). Suggested mitigations (pick one):
// Example idea: render as <a><span class="url-host">…</span><span class="url-tail">…</span></a>.chat-text a .url-tail { filter: blur(4px); }
.chat-text a:focus-visible .url-tail,
.chat-text a:hover .url-tail { filter: blur(0); }
Additionally, if you keep any conditional styling, do not base it on attacker-controlled substrings like Analyzed PR: #36856 at commit Last updated on: 2026-03-05T23:45:04Z |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e2e5dacbb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var t = s && s.theme; | ||
| if (t && VALID.indexOf(t) !== -1) { | ||
| document.documentElement.setAttribute("data-theme", t); |
There was a problem hiding this comment.
Resolve stored theme selection before setting data-theme
This bootstrap script reads openclaw.control.settings.v1.theme and applies it directly as data-theme, but settings now persist theme family ("claw" | "knot" | "dash") plus themeMode (see ui/src/ui/storage.ts / ui/src/ui/theme.ts). As a result, the prepaint theme is wrong for most users (e.g. claw/knot are ignored, and dash + light mode is forced to dark dash), so the page flashes to a different theme once the app initializes and calls resolveTheme.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR isolates the visual/theme refresh for Key Issues Found:
The new Confidence Score: 2/5
Last reviewed commit: 3e2e5da |
| <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" /> | ||
| <script> | ||
| (function () { | ||
| var VALID = ["dark", "light", "openknot", "dash", "openai", "clawdash"]; |
There was a problem hiding this comment.
The VALID allowlist includes "openai", but there is no matching [data-theme="openai"] CSS rule in base.css and no entry for "openai" in the LEGACY_MAP in theme.ts. If a user has { theme: "openai" } in localStorage, this script will write data-theme="openai" to the root element, but no CSS will match it, causing a silent fallback to the dark theme defaults. This entry should either be removed or mapped via LEGACY_MAP to an actual defined theme (e.g., "dark").
| var VALID = ["dark", "light", "openknot", "dash", "openai", "clawdash"]; | |
| var VALID = ["dark", "light", "openknot", "dash", "clawdash"]; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/index.html
Line: 13
Comment:
The `VALID` allowlist includes `"openai"`, but there is no matching `[data-theme="openai"]` CSS rule in `base.css` and no entry for `"openai"` in the `LEGACY_MAP` in `theme.ts`. If a user has `{ theme: "openai" }` in localStorage, this script will write `data-theme="openai"` to the root element, but no CSS will match it, causing a silent fallback to the dark theme defaults. This entry should either be removed or mapped via `LEGACY_MAP` to an actual defined theme (e.g., `"dark"`).
```suggestion
var VALID = ["dark", "light", "openknot", "dash", "clawdash"];
```
How can I resolve this? If you propose a fix, please make it concise.| <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" /> | ||
| <script> | ||
| (function () { | ||
| var VALID = ["dark", "light", "openknot", "dash", "openai", "clawdash"]; |
There was a problem hiding this comment.
"clawdash" is in the VALID list and has a matching [data-theme="clawdash"] CSS definition in base.css (chrome metallic theme, lines 391–445). However, theme.ts maps the raw value "clawdash" via LEGACY_MAP (line 26) to { theme: "dash", mode: "light" }, which resolves to the "dash-light" theme (warm parchment colors, lines 333–387) — a completely different palette. Users with "clawdash" stored in localStorage will see the chrome metallic style (from the pre-render) immediately flash to warm parchment (when JS hydrates and resolves to "dash-light").
Either remove [data-theme="clawdash"] from base.css and replace "clawdash" in the VALID list with "dash-light" (if it is truly a legacy alias), or remove the LEGACY_MAP entry and treat "clawdash" as a first-class theme.
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/index.html
Line: 13
Comment:
`"clawdash"` is in the `VALID` list and has a matching `[data-theme="clawdash"]` CSS definition in `base.css` (chrome metallic theme, lines 391–445). However, `theme.ts` maps the raw value `"clawdash"` via `LEGACY_MAP` (line 26) to `{ theme: "dash", mode: "light" }`, which resolves to the `"dash-light"` theme (warm parchment colors, lines 333–387) — a completely different palette. Users with `"clawdash"` stored in localStorage will see the chrome metallic style (from the pre-render) immediately flash to warm parchment (when JS hydrates and resolves to `"dash-light"`).
Either remove `[data-theme="clawdash"]` from `base.css` and replace `"clawdash"` in the `VALID` list with `"dash-light"` (if it is truly a legacy alias), or remove the `LEGACY_MAP` entry and treat `"clawdash"` as a first-class theme.
How can I resolve this? If you propose a fix, please make it concise.3e2e5da to
9dcdb8b
Compare
dac2c5c to
1f1f444
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dcdb8b4d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| .cmd-palette__item:hover, | ||
| .cmd-palette__item--active { | ||
| background: var(--hover); |
There was a problem hiding this comment.
Use a defined token for command palette row highlighting
cmd-palette__item:hover/--active sets background: var(--hover), but this commit does not define --hover in the theme tokens (the palette tokens in ui/src/styles/base.css define --bg-hover instead). Because var(--hover) is unresolved, the declaration is dropped, so hover and keyboard-active command palette rows have no visual highlight, which makes result selection hard to track.
Useful? React with 👍 / 👎.
|
Triaged this PR alongside #36857. The base branch diverged ~3,135 commits from The FOUC-prevention concept from All CSS rewrites and production TS deletions were discarded — the deleted files and gutted modules are still actively used on the current branch. See #36857 comment for the full breakdown. |
Summary
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
dashboard-v2-theme.pnpm ui:build.Expected
Actual
pnpm ui:buildpassed.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm ui:buildondashboard-v2-theme.Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoFailure Recovery (if this breaks)
ui/src/styles/**,ui/index.html, andui/public/*files from the previous stacked branch.Risks and Mitigations
dashboard-v2-structureand does not add new behavior changes.Review Guidance