Skip to content

fix: align status bar right-click menu with icon left edge - #48

Merged
bgultekin merged 1 commit into
mainfrom
fix/status-bar-menu-alignment
May 7, 2026
Merged

bgultekin merged 1 commit into
mainfrom
fix/status-bar-menu-alignment

Conversation

@bgultekin

@bgultekin bgultekin commented May 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Fixes the right-click context menu on the status bar icon so it aligns with the left edge of the icon, matching native macOS behavior.
  • Uses the standard AppKit pattern of temporarily assigning the menu to the status item instead of manually positioning with popUp(positioning:at:in:).

Test plan

  • Right-click the status bar icon and verify the menu appears aligned with the icon's left edge
  • Left-click still toggles the drawer as before

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced right-click menu handling on the menu bar icon for improved interaction and consistency.

Use the standard AppKit pattern of temporarily assigning the menu to
the status item so the system positions it correctly, instead of
manually popping up at a hardcoded coordinate.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented May 7, 2026 •

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e5ab4d1b-43b3-4082-a6ef-888b09ba9258

📥 Commits

Reviewing files that changed from the base of the PR and between f2328c6 and e1f773c.

📒 Files selected for processing (1)
  • macos/Sources/Ocak/App/AppDelegate.swift

📝 Walkthrough

Walkthrough

The PR refactors how the status bar item displays its context menu on right-click. Instead of calling NSMenu.popUp(...) with explicit positioning, the menu is assigned to statusItem.menu, a synthetic click is performed, and the menu assignment is cleared, leveraging macOS's native menu-attachment behavior.

Changes

Status bar menu interaction

Layer / File(s) Summary
Right-click menu handling
macos/Sources/Ocak/App/AppDelegate.swift
Right-click handling for the status item transitions from explicit menu positioning using statusMenu.popUp(...) to assigning statusMenu to statusItem.menu, calling sender.performClick(nil), and clearing the menu assignment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • bgultekin/ocak#45: Both PRs modify status bar click handling and introduce the statusItemClicked(_:) method to distinguish left-click (toggle drawer) and right-click (show menu) behavior.

Poem

🐰 A click, a menu, a swift refactor,
From popUp calls to native happenings,
The status bar now dances cleaner,
With assigned menus and clicks performed bright,
Small but mighty, this rightful change. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing the alignment of the right-click status bar menu with the icon's left edge, which matches the primary objective of the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/status-bar-menu-alignment

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.

@bgultekin
bgultekin marked this pull request as ready for review May 7, 2026 09:32
@bgultekin
bgultekin merged commit 0c4436b into main May 7, 2026
2 checks passed
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.

1 participant