Allow smaller to shrink the height of a vertically maximized window - #1807
Allow smaller to shrink the height of a vertically maximized window#1807YuriNachos wants to merge 2 commits into
Conversation
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.
|
Thanks for contributing! Rectangle has had this functionality for 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.
|
Thanks for the direction — that makes sense, so I went ahead and added the terminal command config myself. The new defaults write com.knollsoft.Rectangle smallerShrinksMaximizedHeight -bool trueIt'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. |
Closes #1737.
Problem
Under the combined
.smallercommand, a vertically-maximized window (Half / full-height) shrinks in width but not in height — it stays pinned to the top and bottom screen edges..smallerHeightalready had an exception for this (added in b97a353 / #1645), but.smallerwas left asymmetric, so the combined shortcut cannot shrink a maxed-height window down in both dimensions.Changes
ChangeSizeCalculation: theagainstTopAndBottomScreenEdgesexemption for.smallerHeightis extended to.smalleronly 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.smallerShrinksMaximizedHeight(off by default), enabled with:defaults write com.knollsoft.Rectangle smallerShrinksMaximizedHeight -bool trueIt is declared as a
BoolDefaultand included in the exported config, and documented inTerminalCommands.mdunder "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..smalleris conceptually.smallerWidth+.smallerHeight, so with the config enabled its height component honors the same edge exception.smallerHeightreceived in b97a353.Testing
ChangeSizeCalculationTestsassertions that encode the pinned-height behavior (testExplicitZeroDisablesScreenFractionMinimum,testSmallerCanReachExactConfiguredMinimum,testSmallConfiguredScreenFractionAllowsIssueRegressionStep) keep the original (default) expected rects.testSmallerKeepsHeightOfFullHeightWindowByDefault, asserting the unchanged default: a full-height window shrinks only in width.testSmallerShrinksHeightOfFullHeightWindow, a regression test for Smaller/Larger toggle only change width of the window after "Half" and "Center" Size Adjustments #1737 that enablessmallerShrinksMaximizedHeightand asserts the window shrinks in both dimensions (height bysizeOffset,ybyfloor(sizeOffset / 2)).ChangeSizeCalculationTestssuite passes.Note on pre-existing host failures
Running the full
xcodebuild testsuite on this branch shows 21 failures inActiveSideSplitRatiosCooperativeTestsandHalfSplitCornerCalculationTests. These are pre-existing host-environment failures: the identicalxcodebuild testrun on a clean checkout ofmainproduces the same 21 failures in the same suites. They are unrelated toChangeSizeCalculation— the only app file this PR touches — and are expected to pass on CI's display configuration.