fix(electron): open Lody on Windows tray left click - #75
Merged
Conversation
The Windows tray icon popped up the context menu for both mouse buttons because the `click` handler explicitly called `popUpContextMenu()`. Left click now opens or focuses the main window; `setContextMenu` keeps the menu on right click. Model: claude-opus-5 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Author type
Problem / pressure
On Windows, left-clicking the tray icon behaved exactly like right-clicking: it popped up the context menu instead of opening the app. That is contrary to the platform convention, so the common action (show Lody) cost an extra click and an extra decision.
Summary
WindowsTrayService'sclickhandler calledthis.tray.popUpContextMenu(). It now callsopenOrFocusMainWindow()— the same callback the tray menu's "Open Lody" item already uses.setContextMenuis untouched, so the menu still opens on right click (on Windows that call only binds the right-click gesture, which is why the explicitpopUpContextMenu()existed in the first place).Before / after
Test plan
node_modules, sopnpm check/tsgoare unavailable here. CI covers type/lint/test.Open ${productName}menu item's handler in the same file, so no new API surface or types are introduced.Agent handoff
Instructions for reviewing agents
apps/electron/src/main/services/windows-tray-service.ts— the singletray.on('click')handler; confirmsetContextMenustill yields right-click menu behavior on your target Windows/Electron version.setContextMenurather than bindingright-click→popUpContextMenu()explicitly; also whether left click should toggle (hide when already focused) instead of always opening/focusing.setContextMenualso intercept left click, this handler would never fire and the change would silently regress to the old behavior.Authoring context
node_modulesin this worktree) and there was no Windows host for a manual click test; both are stated in the test plan rather than papered over.Sharing consent (author side)
Declining context sharing is respected, but it does not guarantee review. If withheld context prevents maintainers from assessing provenance, scope, or risk, they may decline the contribution or close the pull request.
N/A/ redacted🤖 Generated with Claude Code