Skip to content

Conversation

@jkiddo
Copy link

@jkiddo jkiddo commented Oct 7, 2025

This feature makes the app open when you push the tray icon.

Summary by CodeRabbit

  • Refactor
    • Unified tray icon click behavior across platforms for a more consistent experience.
    • macOS: clicking the tray icon now always brings the main window to the front and focuses it.
    • Windows/Linux: clicking the tray icon now toggles the main window’s visibility.
    • Balloon notifications and the right-click context menu remain unchanged.

@CLAassistant
Copy link

CLAassistant commented Oct 7, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Walkthrough

Unifies 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

Cohort / File(s) Summary
Tray icon click handling
src/ui/main/trayIcon.ts
Consolidated click handler: always call getRootWindow() inside try/catch; on macOS (darwin) call show() then focus() and return; on non-macOS toggle show()/hide() based on visibility. Preserves balloon-click and right-click menu logic; adds error logging when root window retrieval fails.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I tap the tray with curious cheer,
Root window climbs and soon appears.
On mac I show and focus true,
Elsewhere I hide or show for you.
A rabbit claps — the click's anew. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the primary change of enabling the app to open upon tray icon clicks, matching the implemented behavior across platforms and clearly indicating the feature added.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 00fa6b2 and 35d6a46.

📒 Files selected for processing (1)
  • src/ui/main/trayIcon.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/ui/main/trayIcon.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.

📥 Commits

Reviewing files that changed from the base of the PR and between d614c2c and 00fa6b2.

📒 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants