Fix Electron development startup and macOS tray icon - #31
Merged
Alpaca233114514 merged 2 commits intoAug 7, 2026
Conversation
Alpaca233114514
marked this pull request as ready for review
August 7, 2026 07:18
Alpaca233114514
self-requested a review
August 7, 2026 07:19
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.
Summary
/wsbackend for note database changesRoot cause
Electron development applied both the checked-in meta CSP and a response CSP that rejected Vite's injected inline React refresh preamble, leaving the app on its splash screen. When the notes page mounted, both policies also rejected its WebSocket connection; after allowing the loopback connection, the request still failed because the backend had no
/wshandler. The hook then reconnected repeatedly because stale socket callbacks could overwrite the current connection state.The macOS tray reused the full application icon as a Template Image; because that icon has an opaque background, macOS rendered the entire mask as a black square.
Impact
npm run electron:devnow renders the React app normally, while packaged production keeps its strict script policy. The notes page maintains one authenticated realtime connection without CSP failures or reconnect spam. Development authentication is injected by the Vite proxy, so the local API token does not appear in the WebSocket URL. The macOS menu-bar icon now uses a transparent monochrome template that adapts to light and dark appearances, including Retina displays.Validation
npm test --prefix backend -- --runInBand --detectOpenHandles tests/integration/realtime-websocket.test.ts- 3 tests passed with no open handlesnpm run test:electron:macos- 11 tests passednpm run typecheck --prefix backendnpm run typecheck --prefix frontendnpm run build:frontendfrontend/dist/index.htmlkeepsscript-src 'self'101 Switching Protocolsand remained pendingnode --check electron/main.jsnode --check frontend/vite.config.jsgit diff --check