fix(app): show Dock icon + menu-bar item reliably#7
Open
ShadowEsu wants to merge 2 commits into
Open
Conversation
The built app shipped with no bundled icon assets: dist/assets/ was empty because the root .gitignore's `build/` rule also matched app/build/, so the source icons were never committed. At runtime trayTemplate.png loaded as an empty image, so new Tray() created a zero-width, invisible menu-bar item, and there was no Dock icon. - Commit the real designed assets in app/build/ (icon.png, icon.icns, trayTemplate.png, entitlements.mac.plist) and fix .gitignore so app/build/ source assets are tracked (matching codex trunk). - main.ts: call app.dock?.show() on macOS; extract a resilient createTray() that falls back to an embedded glyph when the asset is missing and is wrapped in try/catch so a tray failure can't abort the bar/companion/shortcut. - Add pure src/core/trayIcon.ts (embedded fallback + PNG validator) and tests. - build.mjs: warn loudly when an icon asset is missing instead of silently swallowing the error. - Docs: app/CHANGELOG.md + docs/automation continuity notes. Typecheck, build, and 15/15 unit tests pass. macOS Dock/menu-bar appearance and packaging still need verification on a real Mac (not runnable in CI here). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XppKQSzGjDtp3sAGi6qJvJ
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XppKQSzGjDtp3sAGi6qJvJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The built desktop app didn't show a Dock icon or a menu-bar item on macOS.
Root cause: the build shipped with no bundled icon assets.
dist/assets/was empty because the root.gitignorerulebuild/also matchedapp/build/, so the app's source icons were never committed on this branch. At runtimetrayTemplate.pngloaded as an empty image →new Tray(emptyImage)created a zero-width, invisible menu-bar item, and there was no Dock icon. (Codex trunk had already fixed this; this branch simply diverged before that work landed.)Solution
app/build/(icon.png1024²,icon.icns,trayTemplate.png32² template,entitlements.mac.plist) and fix.gitignoresoapp/build/source assets are tracked — matching codex trunk's approach.main.ts: callapp.dock?.show()on macOS; extract a resilientcreateTray()that falls back to an embedded glyph when the asset is missing and is wrapped intry/catchso a tray failure can never abort the floating bar / companion window / global shortcut.src/core/trayIcon.ts(embedded base64 fallback + a tiny PNG validator) with unit tests guaranteeing the fallback is always a valid, non-empty, square PNG.scripts/build.mjs: warn loudly when an icon asset is missing instead of swallowing the error.Tests
npm run typecheck— passnpm run build— pass (now copies real icons intodist/assets/)npm test— 15/15 pass (4 new tray-icon tests)Run on a Linux runner, so the toolchain checks above are green but the actual macOS Dock/menu-bar appearance and DMG packaging were not exercised here.
Risk
Low. Adds icon assets, a defensive fallback, and a gitignore correction; removes no working behavior. Renderer/UI and network paths are untouched.
Follow-up
.app, confirm the Dock icon + menu-bar item appear, then package the DMG.app/; decide between continued surgical ports vs. a reviewed merge before resuming the vibe-island redesign.🤖 Generated with Claude Code
https://claude.ai/code/session_01XppKQSzGjDtp3sAGi6qJvJ
Generated by Claude Code