-
Notifications
You must be signed in to change notification settings - Fork 794
feat: Open the app when clicking the tray icon #3116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughUnifies tray icon click handling by always retrieving the root window, showing-and-focusing on macOS, and toggling visibility on other platforms. Keeps existing balloon-click behavior and right-click context menu; adds error logging when obtaining the root window fails. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant T as TrayIcon
participant A as App
participant W as RootWindow
U->>T: click
T->>A: getRootWindow()
A-->>T: RootWindow (W) / error
alt error
T->>T: log error
else
alt platform == 'darwin'
T->>W: show()
T->>W: focus()
else
T->>W: isVisible?
alt visible
T->>W: hide()
else
T->>W: show()
end
end
end
note over T,W: Balloon-click and right-click context menu unchanged
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/ui/main/trayIcon.ts (1)
33-47: Add explicit focus() after show() on non-macOS platforms. BrowserWindow.show() may not reliably activate the window on Windows/Linux; follow it with browserWindow.focus() in src/ui/main/trayIcon.ts (around lines 43–47).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/ui/main/trayIcon.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Follow existing TypeScript patterns with strict mode enabled
All new code must pass ESLint and TypeScript checks
Avoid unnecessary comments; only add comments for complex logic or non-obvious decisions
Files:
src/ui/main/trayIcon.ts
🧬 Code graph analysis (1)
src/ui/main/trayIcon.ts (2)
src/ui/main/rootWindow.ts (1)
getRootWindow(47-52)src/store/index.ts (1)
select(63-64)
This feature makes the app open when you push the tray icon.
Summary by CodeRabbit