[Bug] macOS Dock 图标在启动前后切换为两套不同样式
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
- 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category
UI / 界面体验 · UI / UX
涉及的 Agent 框架 · Agent framework
不涉及框架 · Not framework-specific
严重程度 · Severity
轻微 · Minor (小问题不影响主流程 / minor, no impact on main flow)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
macOS 上,ZCode 固定在 Dock 中的图标会在应用启动时明显切换为另一套视觉样式:未启动时为黑灰渐变、带高光和立体阴影的图标;启动后切换成纯黑背景、扁平白色 Z 图标;退出后又恢复。移除 Dock 固定项、从 /Applications/ZCode.app 重新打开并再次固定后仍稳定复现。只读检查发现 CFBundleIconFile 指向 icon.icns,同时 Contents/Resources 中另有 icon.png,打包的主进程代码包含 macOS app.dock.setIcon(...) 调用,并从 process.resourcesPath/icon.png 解析运行时图标。这与实际现象吻合:未启动时 macOS 显示 icon.icns,启动后应用主动将 Dock 图标替换成 icon.png。
复现步骤 · Steps to reproduce
- 将
/Applications/ZCode.app固定到 macOS Dock。 - 完全退出 ZCode,观察 Dock 图标。
- 启动 ZCode。
- 图标由渐变立体版本切换为纯黑扁平版本。
- 退出 ZCode,图标恢复。
期望表现 · Expected behavior
ZCode 在未启动、运行中和退出后的 Dock 图标应保持同一视觉资源和样式。建议统一 icon.icns、Resources/icon.png 与运行时 app.dock.setIcon(...) 使用的图标,或取消不必要的运行时覆盖。
实际表现 · Actual behavior
启动前后使用两套明显不同的 Dock 图标;重新固定 /Applications/ZCode.app 后仍必现。
ZCode 版本 · ZCode version
3.11.2 (build 3.11.2.6792)
设备 / 系统 / 浏览器 · Device / OS / Browser
macOS 26.6.2 Build 25G83, Apple Silicon arm64, ZCode Desktop
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
已获得启动前与启动后的对比截图。只读核验:Bundle identifier 为 dev.zcode.app;CFBundleIconFile = icon.icns;运行时图标资源为 Contents/Resources/icon.png;主进程包含 app.dock.setIcon(...)。如维护者需要,可补充原始对比截图。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the main-process app.dock.setIcon(...) call and checking how it resolves process.resourcesPath/icon.png. Compare that runtime resource with the bundle's CFBundleIconFile value, icon.icns, and Contents/Resources/icon.png. Done means the Dock shows the same visual icon before launch, while running, and after exit; verify all three states on macOS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, macos
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100