Skip to content

fix(webui): use public directory icon for favicon#1857

Merged
piorpua merged 2 commits intomainfrom
fix/issue-1178
Mar 29, 2026
Merged

fix(webui): use public directory icon for favicon#1857
piorpua merged 2 commits intomainfrom
fix/issue-1178

Conversation

@kaizhou-lab
Copy link
Copy Markdown
Collaborator

Summary

  • Fix WebUI page tab not showing favicon icon
  • The favicon <link> in index.html used ../../resources/icon.png which works in Electron (file://) but resolves outside the Express static root in WebUI mode
  • Changed to ./pwa/icon-192.png which exists in public/ and works in both Electron and WebUI contexts

Related Issues

Closes #1178

Test Plan

  • Unit test validates favicon href references a file within the public directory
  • Type check passes
  • Lint and format pass

The favicon <link> in index.html used a relative path ../../resources/icon.png
that escapes the Express static root in WebUI mode. Changed to ./pwa/icon-192.png
which exists in the public/ directory and resolves correctly in both Electron
(file://) and WebUI (Express static serving).

Closes #1178
@piorpua piorpua added the bot:reviewing Review in progress (mutex) label Mar 29, 2026
@piorpua
Copy link
Copy Markdown
Contributor

piorpua commented Mar 29, 2026

Code Review:fix(webui): use public directory icon for favicon (#1857)

变更概述

本 PR 修复了 WebUI 模式下 favicon 图标无法显示的问题。src/renderer/index.html 中的 favicon <link> 原来使用 ../../resources/icon.png,该路径在 Electron 的 file:// 协议下可以正常工作,但在 WebUI 的 Express 静态资源服务下会逃出 served 目录导致 404。修改为 ./pwa/icon-192.png(该文件存在于 public/ 目录)后,两种运行模式均可正常显示图标。同时新增了一个单元测试验证 favicon href 合规性。


方案评估

结论:✅ 方案合理

修复精准定位了根本原因(路径逃出 Express 静态根目录),使用 public/ 中已有的 PWA 图标是最简洁的解决方案。pwa/icon-192.png 已存在且被项目使用,无需新增资源。单元测试通过直接读取 index.html 并验证文件存在性,为防止将来的回归提供了合理保护。


问题清单

未发现任何问题。


汇总

无问题。

结论

批准合并 — 修复正确,测试充分,代码干净,无阻塞性问题。


本报告由本地 pr-review skill 生成,包含完整项目上下文,无截断限制。

@piorpua
Copy link
Copy Markdown
Contributor

piorpua commented Mar 29, 2026

✅ 已自动 review,无阻塞性问题,正在触发自动合并。

@piorpua piorpua merged commit aaa406e into main Mar 29, 2026
17 checks passed
@piorpua piorpua deleted the fix/issue-1178 branch March 29, 2026 09:55
@piorpua piorpua added bot:done Auto-merged by bot and removed bot:reviewing Review in progress (mutex) labels Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:done Auto-merged by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

【Bug】WebUI 页面 Tab 未显示图标 / WebUI page tab icons not showing

2 participants