Skip to content

Move thirds and fourths to the adjacent display on repeat - #1937

Merged
rxhanson merged 4 commits into
rxhanson:mainfrom
tlq5l:fix/thirds-fourths-across-display
Nov 3, 2026
Merged

rxhanson merged 4 commits into
rxhanson:mainfrom
tlq5l:fix/thirds-fourths-across-display

Conversation

@tlq5l

@tlq5l tlq5l commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1317

With "Move to adjacent display on left or right" selected, repeating Left Third, Right Third, First Fourth or Last Fourth cycles through positions on the same display. Only the half actions move to the other display. The cycling in FirstThirdCalculation, LastThirdCalculation, FirstFourthCalculation and LastFourthCalculation only checks for "do nothing", so this mode falls through to it.

As requested in review, the new behaviour is behind a hidden Terminal setting, off by default:

defaults write com.knollsoft.Rectangle thirdsAndFourthsAcrossDisplays -bool true

With it on, a repeated first-edge action moves to the opposite edge of the previous display, and a repeated last-edge action to the first edge of the next display, mirroring Left/Right Half. The shared logic is calculateAcrossDisplays in OrientationAware.swift. It only moves when the adjacent screen is a different display, so with one display (including with "traverse single screen" on) these actions keep cycling. With the setting off, behaviour is unchanged. The setting is documented in TerminalCommands.md.

Two-thirds, three-fourths and smaller-fraction actions are unchanged. The Repeated commands redesign can be a separate PR.

Callers checked: Rectangle/WindowCalculation/, Rectangle/Snapping/, Rectangle/ and RectangleTests/, through the test suite.

Ran live: agent-run xcodebuild test -scheme Rectangle on macOS, on 165ee3e (run on cfdbff5, which has the same files). A Stage Manager check was stubbed in the test build only. Not checked on two physical displays.

AI disclosure: written and checked with Claude Code (tests and live run agent-run); I take responsibility for it.

@rxhanson

Copy link
Copy Markdown
Owner

Thanks! This would be a departure from how Rectangle has behaved for quite some time, and could break the way that many people have been using the app. I think the most correct path forward is to change from a single selection for Repeated commands into a few more granular options, and make this a new setting that could be enabled there. However, I think the simplest path (and best path for this pull request) is to simply put your changes behind a Defaults Terminal command flag. This way a redesign of the Repeated commands settings, can be done in another pull request.

tlq5l added 3 commits October 28, 2026 04:21
# Conflicts:
#	RectangleTests/RectangleTests.swift
Repeating Left or Right Third, or First or Last Fourth, with "Move to
adjacent display" as the repeated command moves the window to the
adjacent display only when the thirdsAndFourthsAcrossDisplays default is
set. Without it, repeats keep cycling on the same display, as before.

Agent: claude
With traverseSingleScreen on, a lone display is its own adjacent screen.
With thirdsAndFourthsAcrossDisplays on, repeating Left Third or First
Fourth then jumped straight to the opposite action on that same display,
skipping the cycle. Only move across displays when the adjacent screen is
a different display, and cycle otherwise.

Agent: claude
@tlq5l

tlq5l commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review, and sorry for the surprise. The change is now behind a Terminal setting, thirdsAndFourthsAcrossDisplays, which is off by default and documented in TerminalCommands.md. The Repeated commands redesign can be a separate PR.

@rxhanson
rxhanson merged commit d614978 into rxhanson:main Nov 3, 2026
1 check passed
AkiyamaKunka added a commit to AkiyamaKunka/Rectangle that referenced this pull request Nov 3, 2026
Keeps both sets of tests appended at the end of RectangleTests.swift: the
adjacent-display tests from rxhanson#1937 and this branch's Todo reflow tests.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
AkiyamaKunka added a commit to AkiyamaKunka/Rectangle that referenced this pull request Nov 3, 2026
Keeps both sets of tests appended at the end of RectangleTests.swift: the
adjacent-display tests from rxhanson#1937 and this branch's fullscreen gate tests.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
rxhanson pushed a commit that referenced this pull request Nov 3, 2026
Merging main into the new-window-action branch for #1945 dropped the
closing braces of testAStaleFailureDoesNotDropAReplacedObservation and
NewWindowActionManagerTests, so EdgeActionsAcrossDisplaysTests from #1937
ended up nested inside the test method and the RectangleTests target no
longer compiles. The app target still builds, which is why CI passes.

Puts the two braces back; the test block now matches #1945's original
commit exactly.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Cycling direction inverted for thirds & fourths

2 participants