Skip to content

Allow smaller to shrink the height of a vertically maximized window - #1807

Open
YuriNachos wants to merge 2 commits into
rxhanson:mainfrom
YuriNachos:fix/smaller-shrinks-height-1737
Open

Allow smaller to shrink the height of a vertically maximized window#1807
YuriNachos wants to merge 2 commits into
rxhanson:mainfrom
YuriNachos:fix/smaller-shrinks-height-1737

Conversation

@YuriNachos

@YuriNachos YuriNachos commented Aug 7, 2026

Copy link
Copy Markdown

Closes #1737.

Problem

Under the combined .smaller command, a vertically-maximized window (Half / full-height) shrinks in width but not in height — it stays pinned to the top and bottom screen edges. .smallerHeight already had an exception for this (added in b97a353 / #1645), but .smaller was left asymmetric, so the combined shortcut cannot shrink a maxed-height window down in both dimensions.

Changes

  • ChangeSizeCalculation: the againstTopAndBottomScreenEdges exemption for .smallerHeight is extended to .smaller only when the new hidden preference is enabled, so the default behavior is unchanged — a full-height window keeps its height under Smaller unless the user opts in.
  • New terminal command config smallerShrinksMaximizedHeight (off by default), enabled with:
defaults write com.knollsoft.Rectangle smallerShrinksMaximizedHeight -bool true

It is declared as a BoolDefault and included in the exported config, and documented in TerminalCommands.md under "Make Smaller shrink the height of full-height windows". As with the other hidden preferences, it is read at launch, so the app needs a restart after setting it.

.smaller is conceptually .smallerWidth + .smallerHeight, so with the config enabled its height component honors the same edge exception .smallerHeight received in b97a353.

Testing

  • The three ChangeSizeCalculationTests assertions that encode the pinned-height behavior (testExplicitZeroDisablesScreenFractionMinimum, testSmallerCanReachExactConfiguredMinimum, testSmallConfiguredScreenFractionAllowsIssueRegressionStep) keep the original (default) expected rects.
  • Added testSmallerKeepsHeightOfFullHeightWindowByDefault, asserting the unchanged default: a full-height window shrinks only in width.
  • Added testSmallerShrinksHeightOfFullHeightWindow, a regression test for Smaller/Larger toggle only change width of the window after "Half" and "Center" Size Adjustments #1737 that enables smallerShrinksMaximizedHeight and asserts the window shrinks in both dimensions (height by sizeOffset, y by floor(sizeOffset / 2)).
  • The ChangeSizeCalculationTests suite passes.

Note on pre-existing host failures

Running the full xcodebuild test suite on this branch shows 21 failures in ActiveSideSplitRatiosCooperativeTests and HalfSplitCornerCalculationTests. These are pre-existing host-environment failures: the identical xcodebuild test run on a clean checkout of main produces the same 21 failures in the same suites. They are unrelated to ChangeSizeCalculation — the only app file this PR touches — and are expected to pass on CI's display configuration.

Extends the .smallerHeight curtain exemption (b97a353, rxhanson#1645) to the combined .smaller command so a vertically-maximized window shrinks in both width and height instead of only width. Adds testSmallerShrinksHeightOfFullHeightWindow and updates three existing ChangeSizeCalculationTests expectations that encoded the pre-rxhanson#1737 height-pinned behavior.
@rxhanson

rxhanson commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Thanks for contributing! Rectangle has had this functionality for Smaller for a while, and changing it could feel like a breaking change for users that are used to it working this way.

My preferred path forward for this is to keep it the way it currently works, but add a terminal command config that can be used to toggle on your desired behavior. Then, if there is demand to have it your desired way by default, then it's usually a sign that it's best as a checkbox in the UI, and it would fit well once I sort out the UI a little better to accommodate more toggles.

I don't mind adding in the Terminal command config if you don't have a desire to do it.

Keep the existing Smaller behavior for full-height windows by default
and gate the height shrink from rxhanson#1737 behind the
smallerShrinksMaximizedHeight terminal command config, documented in
TerminalCommands.md. Tests cover both the default and the enabled mode.
@YuriNachos

Copy link
Copy Markdown
Author

Thanks for the direction — that makes sense, so I went ahead and added the terminal command config myself. The new smallerShrinksMaximizedHeight default is off unless enabled, so the current behavior is completely unchanged out of the box:

defaults write com.knollsoft.Rectangle smallerShrinksMaximizedHeight -bool true

It's documented in TerminalCommands.md, and the tests now cover both the default behavior and the enabled mode. Happy to adjust the naming or hand it over to your own take if you'd prefer.

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.

Smaller/Larger toggle only change width of the window after "Half" and "Center" Size Adjustments

2 participants