Skip to content

Simplify shortcuts panel with one-per-category cycling#1722

Closed
MyronKoch wants to merge 2 commits intorxhanson:mainfrom
MyronKoch:feature/cycling-shortcuts-ui
Closed

Simplify shortcuts panel with one-per-category cycling#1722
MyronKoch wants to merge 2 commits intorxhanson:mainfrom
MyronKoch:feature/cycling-shortcuts-ui

Conversation

@MyronKoch
Copy link
Contributor

Summary

  • Replaces individual shortcut fields for each grid position with one shortcut per category that cycles through all positions on repeated presses
  • Reduces the "Additional Shortcuts" section from ~55 rows to ~10 category rows
  • Leverages Rectangle's existing `subsequentExecutionMode` and `*Repeated` protocols for the cycling behavior

Motivation

The current preferences panel lists every individual grid position (sixths, eighths, ninths, etc.) with its own shortcut field, which is overwhelming - especially as more grid sizes are added. Most users want a single shortcut per category that cycles through positions on repeated presses (e.g., press Ctrl+Opt+3 to get first third, press again for center third, again for last third). This is how the left/right half shortcuts already work. This PR extends that pattern to all grid categories and simplifies the UI accordingly.

This is especially valuable for users with large or high-resolution displays (50" 4K TVs, ultrawides) who use many grid categories but don't want to memorize dozens of shortcuts.

How it works

Each category row binds to the first action in that category (e.g., .firstThird for Thirds). When the user presses the shortcut repeatedly, Rectangle's existing `*Repeated` protocol cycles through all positions in the category. The UI shows a single `MASShortcutView` labeled with the category name (e.g., "Thirds", "Fourths", "Sixths").

Changes

  • PrefsViewController.swift - Programmatically builds category rows in the additional shortcuts section instead of one-per-position IBOutlet rows. Original IBOutlets retained for storyboard compatibility. Left column: Thirds, Fourths, Sixths. Right column: Eighths, Twelfths, Sixteenths. Plus a Move to Edge section.

Test plan

  • Preferences panel shows one shortcut per category in the Additional section
  • Setting a shortcut for "Thirds" and pressing it cycles through all third positions
  • Setting a shortcut for "Fourths" cycles through all fourth positions
  • All category shortcuts cycle correctly in both directions (if supported)
  • Main section shortcuts (halves, corners, maximize, etc.) still work independently
  • Move to Edge shortcuts work correctly
  • Panel layout looks correct with proper alignment and spacing

🤖 Generated with Claude Code

MyronKoch and others added 2 commits March 13, 2026 14:33
Replace individual shortcut fields for each grid position with a single
shortcut per category. Rectangle already cycles through all positions
when the same shortcut is pressed repeatedly (via subsequentExecutionMode
and *Repeated protocols), so individual position shortcuts are redundant.

Before: ~30 shortcut fields in the additional section
After: ~8 clean rows (Thirds, Fourths, Sixths, Eighths + 4 Move)

Each category shortcut binds to the first action in its category and
cycles through every position on repeated presses. For example, the
Thirds shortcut cycles: First Third -> Center Third -> Last Third ->
First Two Thirds -> Center Two Thirds -> Last Two Thirds.

This dramatically improves the settings panel usability, particularly
for users with many grid sizes enabled on large displays or
multi-monitor arrays where fine-grained window positioning is essential.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add [weak self] to notification subscription closure to prevent
  PrefsViewController from being retained for the app lifetime
- Set translatesAutoresizingMaskIntoConstraints = false on labelStack
  and row views to avoid autoresizing mask conflicts with stack view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rxhanson
Copy link
Owner

With the premise that additional shortcuts are added in the ellipsis button popover in the General tab, it's still logical and acceptable to me to keep all of the existing shortcuts in the Shortcuts tab.

However, for the General tab popover, if the 12ths/16ths shortcuts are added in, then that would indeed start getting out of hand. My preferred path forward for adding something like this in is again to make it configurable, though. A checkbox at the top of the popover that hides all non-first shortcut recorders in the popover would likely make it a lot more manageable.

@MyronKoch
Copy link
Contributor Author

Thanks for the feedback, Ryan. That makes sense - keeping all existing shortcuts in the Shortcuts tab preserves the familiar layout.

I've incorporated the popover-based approach into PR #1720 instead: cycling shortcut recorders for Ninths, Twelfths, and Sixteenths live in the General tab's ellipsis popover, with a "Show additional sizes in menu" checkbox controlling the menu submenus. That keeps things manageable without cluttering the Shortcuts tab.

Closing this one in favor of the consolidated approach in #1720.

@MyronKoch MyronKoch closed this Mar 17, 2026
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