Skip to content

Add ninths, twelfths, and sixteenths grid layouts with cycling#1729

Open
shahar-dagan wants to merge 7 commits intorxhanson:mainfrom
shahar-dagan:main
Open

Add ninths, twelfths, and sixteenths grid layouts with cycling#1729
shahar-dagan wants to merge 7 commits intorxhanson:mainfrom
shahar-dagan:main

Conversation

@shahar-dagan
Copy link
Copy Markdown

Summary

Adds dense grid layouts for workflows that tile many windows simultaneously:

  • Ninths (3×3): 9 positions for monitoring dashboards and multi-pane layouts
  • Twelfths (3×4): 12 positions with default keyboard shortcuts (Ctrl+Option+1–0/=/-)
  • Sixteenths (4×4): 16 positions for maximum density on large displays

All positions support cycling mode (repeatedly executing the same action cycles through positions in reading order), consistent with existing thirds cycling behavior.

Motivation

Developers running AI coding agents (Claude Code, Codex, Cursor, etc.) often have 8–16 terminal sessions open simultaneously. The existing grid options (halves, thirds, quarters) don't provide enough granularity for these workflows. Twelfths and sixteenths let you tile a full set of agents across a large display with predictable, scriptable positioning.

What's included

  • 37 new WindowAction cases (9 ninths + 12 twelfths + 16 sixteenths)
  • Individual WindowCalculation classes for each position
  • Cycling calculators: QuartersRepeated, TwelfthsRepeated, SixteenthsRepeated
  • Menu bar icons for all new positions
  • Default keyboard shortcuts for twelfths
  • Settings UI rows for twelfths in Extra Shortcuts
  • Full URL scheme support (rectangle://execute-action?name=top-left-twelfth, etc.)
  • Unit tests for all new calculations

URL scheme examples

open -g "rectangle://execute-action?name=top-left-twelfth"
open -g "rectangle://execute-action?name=bottom-right-sixteenth"

Test plan

  • Unit tests pass for all ninth, twelfth, and sixteenth calculations
  • Manual test: assign shortcuts to twelfths positions, verify windows snap correctly
  • Manual test: cycling mode advances through positions in reading order
  • Manual test: URL scheme commands work for all new positions
  • Manual test: Settings UI shows all twelfths shortcut rows in Extra Shortcuts
  • Verify no regressions in existing halves/thirds/quarters behavior

🤖 Generated with Claude Code

shahar-dagan and others added 7 commits March 23, 2026 19:36
ctrl+opt+1..9,0,Q,W map to the 4×3 twelfths grid in reading order
(top-left to bottom-right). Gated on installVersion > 94 to avoid
overriding bindings on existing installs — same pattern as centerTwoThirds.

Also simplifies the centerTwoThirds gate to use the shared `gated` Bool
(no behavior change), and adds 5 XCTest unit tests covering the gate,
key mappings, no-conflict guarantee, and regression against existing shortcuts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ettings UI

All 12 twelfths shortcuts (ctrl+opt+1..W) were functional since the previous
commit, but 11/12 were invisible in Settings > Extra > Grid Positions. Only
topLeftTwelfth appeared (as the "Twelfths (4×3)" cycling row). Users had no way
to see, edit, or clear the other 11 shortcuts.

This commit adds:
- 11 individual MASShortcutView rows below the cycling row, one per direct-jump
  twelfths position (Top Center Left through Bottom Right)
- Labels use action.displayName ("Top Center Left Twelfth" etc.) not camelCase
- NSLayoutConstraint chain extended through all 11 new labels (width + leading)
- NSScrollView wrapping the popover content so it stays usable on 13" MacBooks
  with the additional rows

Follows the same pattern as the 8 existing eighths rows. No storyboard changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ibility

feat: add individual shortcut rows for all 11 twelfths positions in Settings UI
Add README section explaining ninths/twelfths/sixteenths grids with
use cases for terminal-heavy AI coding workflows. Update URL action
list with all twelfth and sixteenth position names. Expand TODOS.md
with phases 3-5 roadmap.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Windows now remember their positions per display configuration. When
displays change (e.g. connecting/disconnecting an external monitor),
Rectangle saves current window positions and restores them for the
new display configuration. Uses stable window fingerprinting
(bundleID + window index + title hash) to match windows across
sessions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New WindowAction cases: pinToPosition and unpinFromPosition. Pinning
saves the last Rectangle action for a window so it automatically
returns to that position on display change or app relaunch. Pins are
persisted via UserDefaults and enforced by DisplayLayoutManager.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add dense grid layouts, per-display layout memory, and window pinning
@rxhanson
Copy link
Copy Markdown
Owner

Thanks for looking to contribute!

Ninths, twelfths, and sixteenths were added in #1720 (pending a release).

Your pull request adds a DisplayLayoutManager.swift, which isn't mentioned in the summary here. There's also a TODOS.md, so I'm thinking that your work here is still in progress?

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