Skip to content

rt-tray: add a Window menu so cmd-W closes the window - #286

Merged
m4ttheweric merged 1 commit into
mainfrom
window-close-shortcut
Sep 16, 2026
Merged

m4ttheweric merged 1 commit into
mainfrom
window-close-shortcut

Conversation

@m4ttheweric

@m4ttheweric m4ttheweric commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

cmd-W did nothing in the mattstack window: AppKit only routes a key equivalent that a menu item claims, and this app builds its own menu bar (App + Edit) with no Close item.

Adds a Window menu with Close (cmd-W) and Minimize (cmd-M), both dispatched through performClose: / performMiniaturize: so closing follows the same path as the titlebar button, including the activation-policy flip back to accessory.

No File menu: this app has no documents, and Close lives under Window on macOS.

216 checks green.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a Window menu with shortcuts for closing and minimizing the application window.
    • Retained access to Settings from the main menu.

AppKit routes a key equivalent only when a menu item claims it, and the
app's custom menu bar had no Close item, so cmd-W did nothing in the
mattstack window. Adds Close (cmd-W) and Minimize (cmd-M); both go
through performClose:/performMiniaturize: on the key window, so the
close path stays the one the titlebar button already uses.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e3ec9d07-b2e4-45bb-8264-5ff048a5656a

📥 Commits

Reviewing files that changed from the base of the PR and between c48afd1 and dd7e491.

📒 Files selected for processing (1)
  • rt-tray/Sources/AppDelegate.swift

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

The main menu now includes a Window menu with Close (⌘W) and Minimize (⌘M) actions. The menu shortcut documentation covers Settings, Close, and Minimize.

Changes

Window Menu Shortcuts

Layer / File(s) Summary
Add Window menu actions
rt-tray/Sources/AppDelegate.swift
installMainMenu() adds Window menu actions for Close and Minimize. The shortcut documentation now covers Settings, Close, and Minimize.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to dd7e4

The new Close and Minimize shortcuts are wired to supported key-window actions without an identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a Window menu that enables Command-W to close the window.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.
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.
✨ 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 window-close-shortcut

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

@m4ttheweric
m4ttheweric merged commit 5093ed1 into main Sep 16, 2026
4 checks passed
m4ttheweric added a commit that referenced this pull request Sep 17, 2026
AppKit routes a key equivalent only when a menu item claims it, and the
app's custom menu bar had no Close item, so cmd-W did nothing in the
mattstack window. Adds Close (cmd-W) and Minimize (cmd-M); both go
through performClose:/performMiniaturize: on the key window, so the
close path stays the one the titlebar button already uses.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@m4ttheweric
m4ttheweric deleted the window-close-shortcut branch September 17, 2026 13:57
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