Skip to content

Add twelfths (3x4) and sixteenths (4x4) grid positions#1720

Open
MyronKoch wants to merge 8 commits intorxhanson:mainfrom
MyronKoch:feature/twelfths-sixteenths
Open

Add twelfths (3x4) and sixteenths (4x4) grid positions#1720
MyronKoch wants to merge 8 commits intorxhanson:mainfrom
MyronKoch:feature/twelfths-sixteenths

Conversation

@MyronKoch
Copy link

Summary

  • Adds 12 twelfths (3 columns x 4 rows) and 16 sixteenths (4 columns x 4 rows) window positions
  • Each position includes a calculation class with OrientationAware support and bidirectional cycling via TwelfthsRepeated/SixteenthsRepeated protocols
  • Includes pixel-accurate 30x20px template image assets matching the existing icon style
  • Adds .twelfths and .sixteenths categories to WindowActionCategory

Motivation

These finer grid positions are especially useful for users with large or ultra-high-resolution displays - 50" 4K TVs used as monitors, ultrawide displays, or multi-monitor arrays - where halves, thirds, and quarters leave too much unused screen real estate. A 4x4 grid on a 50" 4K display gives each tile roughly the usable area of a 720p laptop screen, which is ideal for tiling many windows simultaneously.

Changes

  • WindowAction.swift - 28 new enum cases (raw values 80-119), with name, displayName, image, category, gapsApplicable, alternateDefault, SubWindowAction, and gapSharedEdge entries
  • WindowActionCategory.swift - .twelfths and .sixteenths cases
  • WindowCalculation.swift - 28 factory instances and calculationsByAction entries
  • 28 new *Calculation.swift files (one per position)
  • TwelfthsRepeated.swift and SixteenthsRepeated.swift - cycling protocols
  • 28 image assets in Assets.xcassets/WindowPositions/
  • PrefsViewController.swift - shortcut views for twelfths and sixteenths categories
  • project.pbxproj - build file references for all new files

Test plan

  • Build succeeds with no warnings in the new files
  • Each twelfth position tiles correctly on a standard display
  • Each sixteenth position tiles correctly on a standard display
  • Cycling through twelfths and sixteenths works in both directions
  • Gap settings apply correctly to all new positions (shared edges respected)
  • OrientationAware behavior swaps correctly in portrait mode
  • Menu items appear under new Twelfths and Sixteenths submenus
  • Template images render correctly in light and dark mode

🤖 Generated with Claude Code

MyronKoch and others added 4 commits March 13, 2026 14:32
Move thirds (First Third through Last Two Thirds) and size actions
(Almost Maximize, Maximize Height, Larger, Smaller) into their own
submenus in the menu bar dropdown, matching the existing pattern used
by fourths, sixths, eighths, and move actions.

Also removes the conditional hiding of the eighths submenu, making it
always visible like all other grid categories.

This reduces menu clutter for users with many grid sizes enabled,
particularly on large displays and multi-monitor setups.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 28 new window positions for fine-grained window management on large
displays. Users with 4K TVs (50"+), ultrawide monitors, or multi-monitor
arrays need more granular positioning than halves, thirds, fourths,
sixths, and eighths provide.

Twelfths divide the screen into a 3-row by 4-column grid (12 positions).
Sixteenths divide the screen into a 4-row by 4-column grid (16 positions).

Each grid size includes:
- Window calculations with orientation-aware layout
- Cycling through positions on repeated shortcut presses
- Drag-to-snap support
- Gap-aware edge positioning
- Template images for menu and settings display
- Settings panel with shortcut configuration for all positions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add largerWidth, smallerWidth, largerHeight, smallerHeight to the
  .size category so all size-related actions appear in the Size submenu
- Remove dead eighthsMenuItem property from AppDelegate (no longer
  assigned after removing the conditional hiding logic)
- Remove dead reference in SettingsViewController toggle handler

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Portrait mode for twelfths transposes the 4x3 landscape grid to a 3x4
portrait grid using row-major index remapping. The previous code naively
mapped landscape column positions to portrait columns, causing 3 pairs
of overlapping positions and one empty row. Fixed 8 of 12 portraitRect
methods with correct row/column assignments.

Also standardize 4 abbreviated sixteenth display names to use the full
form consistent with all other positions.

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

Thanks for looking to contribute to Rectangle.

Rectangle's Shortcuts tab is a bit limited by design, as the intent is to keep the app more approachable. More recently I've designated the "overflow" area for new sizes/positions to the popover shown by the ellipsis button on at the bottom of the General tab. That provides a middle ground where the simple aesthetic is preserved but the community has the ability to add more to the app as desired.

I'm good with merging in more sizes/positions, but when added to the UI it has to still be done in a way that is visually acceptable in the popover. In this case, some options would be adding in more columns or converting the existing settings in that popover into a table view that can scroll.

If that's not desirable, another option is to leave all of the additions out of the UI and keep them as Terminal command configurations only at this time.

Let me know if you have any questions.

@MyronKoch
Copy link
Author

MyronKoch commented Mar 15, 2026

Thanks for the guidance on the popover pattern! I've moved the twelfths and sixteenths shortcuts into the ellipsis popover on the General tab using a cycling approach: one shortcut per grid size that cycles through all positions on repeated presses (using the existing *Repeated protocols). This adds just 3 compact rows instead of 28 individual ones.

Here's how it looks in the popover - note the "Grid Positions" section at the bottom with the cycling hint:

Screenshot 2026-03-15 at 1 06 38 AM

I'll update the PR branch to reflect this. The ninths (3x3) are also included as a cycling shortcut since they were already fully implemented but only individually configurable.

Let me know if this direction works for the popover UI.

MyronKoch and others added 2 commits March 15, 2026 01:17
Per maintainer feedback, move twelfths/sixteenths shortcuts from the
Shortcuts tab into the ellipsis popover on the General tab. Instead of
28 individual rows, use one cycling shortcut per grid size that cycles
through all positions on repeated presses via the existing *Repeated
protocols. Restore PrefsViewController to upstream state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add useCyclingShortcuts BoolDefault (default false) to Defaults.swift
- Add 12 individual twelfths rows and 16 individual sixteenths rows to
  the General tab extra settings popover, following the exact eighths pattern
- Add "Use cycling shortcuts" checkbox at top of Grid Positions section
- When cycling mode is on, hide individual rows and show one cycling
  shortcut per category (Eighths, Twelfths, Sixteenths); cycling hint
  text visible only in cycling mode
- When cycling mode is off (default), show all individual position rows
  and hide cycling rows
- Use objc associated objects to wire checkbox to row visibility toggle
@rxhanson
Copy link
Owner

Thanks for the update. I pulled your changes, and now looking at this cohesively as this one pull request I have clarity on criteria for getting this into a mergeable state:

  • We can remove the "use cycling shortcuts" checkbox and simply leave the Ninths, Twelfths, and Sixteenths as the single Shortcut recorder. For these it is less likely that individual shortcut recorders would be beneficial enough to justify adding them in, and then we don't have to worry about showing/hiding in the popover and readjusting it's size accordingly.
  • Instead of the "Show Eighths in Menu" Checkbox, let's have a single checkbox that adds all of the additional menus with submenus (8ths, 12ths, 16ths, and 9ths if desired), and converts the Thirds & Size menu items into submenus as proposed in the other PR.

I think this gives us the benefit of the additional sizes with a reasonable menu, without adding too much complexity to the popover, and it preserves the existing simplicity for users that don't have large screens.

Let me know if anything's unclear here.

MyronKoch and others added 2 commits March 16, 2026 10:41
…dback

- Replace "Show Eighths in Menu" with "Show additional sizes in menu"
  checkbox that shows 8ths, 9ths, 12ths, 16ths submenus and converts
  Thirds & Size into submenus when enabled
- Remove "Use cycling shortcuts" checkbox and individual twelfths/
  sixteenths rows (-454 lines); keep only cycling shortcut recorders
  for Ninths (3x3), Twelfths (4x3), Sixteenths (4x4)
- Add ninths category to WindowActionCategory for menu grouping
- Remove useCyclingShortcuts preference (no longer needed)

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

Thanks for the clear guidance - this is much cleaner.

Changes made:

Popover (General tab > ellipsis):

  • Removed the "Use cycling shortcuts" checkbox and all 28 individual twelfths/sixteenths rows
  • Now shows just 3 cycling shortcut recorders: Ninths (3x3), Twelfths (4x3), Sixteenths (4x4)
  • Kept the cycling hint text explaining "press repeatedly to cycle"

Menu checkbox:

  • Replaced "Show Eighths in Menu" with "Show additional sizes in menu"
  • When enabled: shows Eighths, Ninths, Twelfths, and Sixteenths submenus, and converts Thirds & Size into submenus
  • When disabled (default): hides those submenus, preserving the existing simple menu

Cleanup:

If this looks right I can close #1721 since its changes are incorporated here.

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