Skip to content

fix(ui): show local project icons in the chat header - #122406

Merged
vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/project-icon-conventions
Aug 12, 2026
Merged

vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/project-icon-conventions

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where users opening a project chat would see the generic folder mark even when the project already provides a conventional local favicon. It also fixes the project breadcrumb sitting slightly below the sidebar and search controls in the chat topbar.

Why This Change Was Made

The Gateway now resolves the first valid icon from one short, deterministic list of literal paths, in this exact precedence:

favicon.svg
favicon.ico
favicon.png
public/favicon.svg
public/favicon.ico
public/favicon.png
public/favicon-32.png
public/apple-touch-icon.png
static/favicon.svg
static/favicon.ico
static/favicon.png
ui/public/favicon-32.png
ui/public/favicon.svg
ui/public/favicon.ico
ui/public/favicon.png
app/favicon.ico
app/favicon.png
app/icon.svg
app/icon.png
app/icon.ico
src/favicon.ico
src/favicon.svg
src/app/favicon.ico
src/app/icon.svg
src/app/icon.png
assets/icon.svg
assets/icon.png
assets/logo.svg
assets/logo.png

There is no recursive search or dynamic scoring. Multiple matches always resolve by this fixed order; invalid or absent candidates continue to the next literal path, and a project with no valid match keeps the folder fallback.

Performance contract:

  • chat.startup prepares the icon snapshot once when the project chat opens. The authenticated asset route performs zero filesystem/session-store discovery per request and never freshness-polls.
  • This follows the repository's process-stable Gateway metadata rule: icon changes become visible after Gateway restart, not through hot-path stat/realpath/reread work.
  • Every icon filesystem operation is asynchronous. The prior synchronous descriptor close was replaced; this path contains no statSync, readFileSync, existsSync, or closeSync.
  • The selected icon bytes and content-derived ETag are read once and cached in the bounded process snapshot. Repeated HTTP requests serve those bytes even if the source file is subsequently removed.

The breadcrumb trail also receives a one-pixel optical lift as a unit, keeping the project icon, labels, and separator aligned with the topbar action glyphs.

User Impact

Projects with an icon in one of the listed local locations now show their own identity in the chat header. ClawHub resolves public/favicon.ico; OpenClaw resolves ui/public/favicon-32.png; projects without an icon continue to show the generic folder. No remote icon fetch is introduced.

Evidence

All screenshots were captured on Testbox from head 6fc0eed28dc at the same 760×520 viewport. Each image is a tight crop of the rendered chat topbar, including sidebar/search controls for axis comparison.

Project source Light Dark
ClawHub — public/favicon.ico ClawHub icon and aligned breadcrumb in light theme ClawHub icon and aligned breadcrumb in dark theme
OpenClaw — ui/public/favicon-32.png OpenClaw icon and aligned breadcrumb in light theme OpenClaw icon and aligned breadcrumb in dark theme
No matching icon — folder fallback Folder fallback and aligned breadcrumb in light theme Folder fallback and aligned breadcrumb in dark theme

Remote focused validation:

node scripts/run-vitest.mjs src/gateway/workspace-icon-http.test.ts
58 passed

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-header-axis.e2e.test.ts
2 passed (light + dark)

Temporary remote capture harness on the same head
6 passed (three project states × light/dark)

The Gateway tests remove the selected file after preparation and confirm that later HTTP requests still serve the original cached bytes without invoking session-root resolution again. They also prove that serving a session refreshes its recency so a 129th insertion evicts the oldest inactive snapshot, not the actively read one. The E2E asserts the action glyph centers and the breadcrumb's one-pixel optical offset in both themes.

Prepare project icon bytes during chat startup and serve only the process-stable snapshot. Keep all filesystem work asynchronous and lift the breadcrumb trail onto the topbar's optical axis.
@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Aug 12, 2026
Drop the IDE-specific icon convention so every candidate remains an explicit web project path.
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 11, 2026, 11:24 PM ET / August 12, 2026, 03:24 UTC.

ClawSweeper review

What this changes

The PR prepares local project icons during chat startup, expands favicon locations, serves cached snapshots to the chat header, and lifts breadcrumb alignment by one pixel.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Needs maintainer review before merge - 5 items remain

Keep open: the startup-prepared snapshot is directionally sound and the PR includes credible visual proof, but it regresses current icon conventions and makes the bounded session cache insertion-ordered rather than LRU.

Priority: P2
Reviewed head: 0750cf81dfeb0aa629a1318b0678e3ebfa89d3ca

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong visible proof supports a useful change, but two concrete compatibility and cache-lifetime defects block merge readiness.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The PR body includes after-fix Testbox screenshots of the visible header states in both themes and focused Gateway/UI validation from the submitted head.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR body includes after-fix Testbox screenshots of the visible header states in both themes and focused Gateway/UI validation from the submitted head.
Evidence reviewed 6 items Current convention contract: Current main explicitly accepts public/apple-touch-icon.png and static/favicon.svg, static/favicon.ico, and static/favicon.png as icon candidates.
Current regression coverage: The current table-driven resolver test covers the four conventions removed by this branch.
Branch removes accepted paths: The PR head replaces the existing list with one that omits all four current conventions, and its test now classifies public/apple-touch-icon.png as unconventional.
Findings 2 actionable findings [P1] Retain the existing web icon conventions
[P2] Refresh session icon snapshots on reads
Security None None.

How this fits together

The Gateway resolves a chat session’s local workspace icon before replying to chat startup, then an authenticated asset route provides those bytes to the Control UI header. The header falls back to a folder glyph when no icon is available.

flowchart LR
  A[Chat startup] --> B[Workspace icon preparation]
  B --> C[Session icon snapshot]
  C --> D[Authenticated asset route]
  D --> E[Chat header]
  B --> F[Folder fallback]
Loading

Before merge

  • Retain the existing web icon conventions (P1) - This rewritten list drops public/apple-touch-icon.png and all three static/favicon.* candidates that current main both resolves and table-tests. Projects using only one of those paths will regress to the folder glyph after merge; retain them unless an explicit deprecation is intended and tested.
  • Refresh session icon snapshots on reads (P2) - This bounded map is pruned at 128 entries but its read path only calls get, so it is insertion-ordered rather than LRU. Later chat openings can evict a still-used session snapshot; its asset route then returns 503 and the UI falls back until a later retry. Move a found entry to the end on read and cover eviction/refresh behavior.
  • Resolve merge risk (P2) - Merging would silently replace the folder fallback for projects using current apple-touch or static favicon conventions.
  • Resolve merge risk (P1) - The bounded snapshot cache can evict a still-relevant session and leave its next asset fetch at a retryable 503 until another render retries.
  • Complete next step (P2) - This protected, member-authored PR should stay open for its author and area owners to resolve the two concrete findings before merge.

Findings

  • [P1] Retain the existing web icon conventions — src/gateway/workspace-icon-http.ts:34-60
  • [P2] Refresh session icon snapshots on reads — src/gateway/workspace-icon-http.ts:229-233
Agent review details

Security

None.

PR surface

Source +66, Tests +77. Total +143 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 92 26 +66
Tests 2 91 14 +77
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 183 40 +143

Review metrics

Metric Value Why it matters
Production vs test delta production +66, tests +77 The gateway snapshot/cache change is substantive runtime growth rather than CSS-only polish, so its compatibility behavior needs to be correct before merge.

Stored data model

Persistent data-model change detected: serialized state: ui/src/e2e/chat-header-axis.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Preserve existing conventions and LRU behavior (recommended)
    Restore the apple-touch and static favicon candidates, refresh a snapshot’s recency when it is served, and add focused regression coverage before merge.

Technical review

Best possible solution:

Keep the startup-prepared snapshot design, retain all currently accepted icon paths unless an explicit deprecation is approved, and refresh session-snapshot recency on successful reads.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: current main accepts apple-touch and static favicon locations, while the PR removes them and explicitly tests apple-touch as rejected.

Is this the best way to solve the issue?

No: preparing immutable bytes at chat startup is the right hot-path boundary, but the branch should preserve existing conventions and use LRU reads for the bounded session cache.

Full review comments:

  • [P1] Retain the existing web icon conventions — src/gateway/workspace-icon-http.ts:34-60
    This rewritten list drops public/apple-touch-icon.png and all three static/favicon.* candidates that current main both resolves and table-tests. Projects using only one of those paths will regress to the folder glyph after merge; retain them unless an explicit deprecation is intended and tested.
    Confidence: 0.99
  • [P2] Refresh session icon snapshots on reads — src/gateway/workspace-icon-http.ts:229-233
    This bounded map is pruned at 128 entries but its read path only calls get, so it is insertion-ordered rather than LRU. Later chat openings can evict a still-used session snapshot; its asset route then returns 503 and the UI falls back until a later retry. Move a found entry to the end on read and cover eviction/refresh behavior.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b024f01171b4.

Labels

Label changes:

  • add P2: This is a bounded but user-visible Control UI regression risk in project identity rendering.
  • add merge-risk: 🚨 compatibility: The branch removes four currently accepted local icon locations, so existing projects can lose their header icon after upgrade.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix Testbox screenshots of the visible header states in both themes and focused Gateway/UI validation from the submitted head.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes after-fix Testbox screenshots of the visible header states in both themes and focused Gateway/UI validation from the submitted head.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The PR body includes after-fix Testbox screenshots of the visible header states in both themes and focused Gateway/UI validation from the submitted head.

Label justifications:

  • P2: This is a bounded but user-visible Control UI regression risk in project identity rendering.
  • merge-risk: 🚨 compatibility: The branch removes four currently accepted local icon locations, so existing projects can lose their header icon after upgrade.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The PR body includes after-fix Testbox screenshots of the visible header states in both themes and focused Gateway/UI validation from the submitted head.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix Testbox screenshots of the visible header states in both themes and focused Gateway/UI validation from the submitted head.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes after-fix Testbox screenshots of the visible header states in both themes and focused Gateway/UI validation from the submitted head.

Evidence

What I checked:

  • Current convention contract: Current main explicitly accepts public/apple-touch-icon.png and static/favicon.svg, static/favicon.ico, and static/favicon.png as icon candidates. (src/gateway/workspace-icon-http.ts:34, b024f01171b4)
  • Current regression coverage: The current table-driven resolver test covers the four conventions removed by this branch. (src/gateway/workspace-icon-http.test.ts:75, b024f01171b4)
  • Branch removes accepted paths: The PR head replaces the existing list with one that omits all four current conventions, and its test now classifies public/apple-touch-icon.png as unconventional. (src/gateway/workspace-icon-http.ts:34, 0750cf81dfeb)
  • Cache eviction behavior: The new 128-entry session snapshot cache is pruned on insertion, while reads only call Map.get; unlike the workspace cache, reads do not refresh recency. (src/gateway/workspace-icon-http.ts:229, 0750cf81dfeb)
  • Feature provenance: Blame attributes the current icon-convention list to the resolver’s introducing commit, which is also the only local history entry for that module. (src/gateway/workspace-icon-http.ts:34, acb7f7192a41)
  • Real behavior proof: The PR body supplies Testbox screenshots for icon-present and fallback states in light and dark themes, plus focused Gateway and UI E2E command results from the submitted head. (0750cf81dfeb)

Likely related people:

  • joshavant: Introduced the current workspace-icon resolver and its convention list in the local history. (role: introduced current resolver behavior; confidence: high; commits: acb7f7192a41; files: src/gateway/workspace-icon-http.ts, src/gateway/workspace-icon-http.test.ts)
  • steipete: Recent main history shows repeated ownership of the chat-header surface, including the session-menu refactor. (role: recent chat-header contributor; confidence: high; commits: 9d77e5c3b75b, 0ce757027ab0; files: ui/src/pages/chat/chat-pane-header.ts, ui/src/styles/chat/split-view.css)
  • vyctorbrzezowski: Already appears in merged current-main history for nested chat-header breadcrumbs, beyond this proposed branch. (role: recent adjacent contributor; confidence: medium; commits: fe1dafbada36; files: ui/src/pages/chat/chat-pane-header.ts, ui/src/styles/chat/split-view.css)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Restore current apple-touch and static favicon conventions with regression coverage.
  • Make session snapshot reads LRU and test an eviction/reuse scenario.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Restore existing web icon paths and refresh bounded session snapshots when they are served. Keep the IDE-specific path excluded per the final product decision.
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Pre-merge verification for 6fc0eed28dca30bdc03e3cd20f37dca2762d01b4:

  • Addressed both ClawSweeper Rank-up moves. The deterministic table retains public/apple-touch-icon.png and static/favicon.{svg,ico,png} with regression coverage; .idea/icon.svg is intentionally excluded from the final product convention set.
  • Session snapshot reads now refresh LRU recency, with a 129-entry eviction/reuse regression proving an actively reused session remains cached.
  • Root cause: the existing header only consumed a prepared workspace icon when one was already known; the gateway owner now resolves the fixed local path table once during chat startup, caches the bytes in the process-stable snapshot, and serves them with zero request-time filesystem work or freshness polling.
  • Production delta: +97/−22 (net +75), representing the new deterministic local-icon capability and lifecycle cache. Test delta: +106/−10 (net +96).
  • Sibling coverage: ClawHub via public/, OpenClaw via ui/public/, legacy root/public/static/app/src/assets paths, and folder fallback when no icon exists; light and dark header alignment are covered in the remote UI harness.
  • Sequential technical cleanup, autoreview, and native review-artifact validation completed cleanly with zero findings.
  • Remote exact-head proof: gateway icon suite 58/58, Control UI axis/capture suite 8/8, and CI run https://github.com/openclaw/openclaw/actions/runs/31560386635 is green with openclaw/ci-gate successful.

@vyctorbrzezowski
vyctorbrzezowski merged commit 2a1eba7 into main Aug 12, 2026
205 of 208 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/project-icon-conventions branch August 12, 2026 03:52
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 2026
* fix(ui): resolve project icons from deterministic paths

Prepare project icon bytes during chat startup and serve only the process-stable snapshot. Keep all filesystem work asynchronous and lift the breadcrumb trail onto the topbar's optical axis.

* fix(ui): keep project icon paths web-focused

Drop the IDE-specific icon convention so every candidate remains an explicit web project path.

* fix(ui): preserve project icon compatibility

Restore existing web icon paths and refresh bounded session snapshots when they are served. Keep the IDE-specific path excluded per the final product decision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant