🤖 fix: restore browser favicon loading in web UI#2380
Conversation
Switch the browser favicon links to PNG assets with relative paths, update theme-based favicon swapping to resolve against the document base URL, and harden static serving so missing asset requests are not rewritten to index.html. Also add PNG favicon outputs to icon generation, include .ico files in npm packaging for compatibility, and extend tests around static asset fallback and themed favicon behavior. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.73`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.73 -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ff4c3bd8b
ℹ️ 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".
| if (path.extname(req.path)) { | ||
| return next(); |
There was a problem hiding this comment.
Preserve SPA fallback for dotted workspace IDs
The new path.extname(req.path) check classifies any URL whose final segment contains a dot as a static file request, so SPA fallback is skipped for routes like /workspace/project-1.2.3. That breaks browser-mode reload/direct-link flows because workspace URLs are path-based (/workspace/${encodeURIComponent(id)} in src/browser/contexts/RouterContext.tsx) and legacy IDs derived from workspace basenames can include dots (generateLegacyId in src/node/config.ts). In that scenario the server now returns 404 instead of index.html, preventing the app from loading.
Useful? React with 👍 / 👎.
Summary
Fix browser-tab favicon rendering when mux is loaded in Chrome by serving and referencing favicon assets in a way that works in both source-tree server mode and built/dist mode.
Background
In browser mode, users could see a tab title but no favicon. This came from a few compounding issues:
public/assets at rootindex.htmlfor missing asset requests (including favicon lookups).icoextension, which can produce MIME/type mismatches in browser contextsImplementation
index.htmlfavicon references to use relative PNG paths (favicon.png,icon.png) for browser compatibility behind URL prefixes.ThemeContextto use PNG assets and resolve URLs againstdocument.baseURI.resolveOrpcStaticDir()insrc/node/orpc/server.tsto detect both dist and source layouts.resolvedStaticDirresolvedStaticDir/publicwhen presentServerServiceto useresolveOrpcStaticDir()..icoand.pngfavicons.dist/**/*.icoto npmfilesso ico assets are included in published package artifacts.Validation
make static-check✅bun test src/node/orpc/server.test.ts src/browser/contexts/ThemeContext.test.tsx✅Risks
Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh• Cost:$0.73