feat: add wrap_size option to app rules for natural window sizing in tiles#353
Open
qeude wants to merge 1 commit intoacsandmann:mainfrom
Open
feat: add wrap_size option to app rules for natural window sizing in tiles#353qeude wants to merge 1 commit intoacsandmann:mainfrom
qeude wants to merge 1 commit intoacsandmann:mainfrom
Conversation
…tiles When forcing an app to tile (e.g. iPhone Simulator) with floating=false, the column stretches to the default column ratio, causing sizing weirdness. This adds a wrap_size option to app_rules that makes the layout column shrink to the window's actual natural size instead of stretching it. - Add wrap_size field to AppWorkspaceRule config - Propagate wrap_size through AppRuleAssignment and VirtualWorkspaceManager - Store wrap_size in WindowLayoutConstraints and mark as non-resizable - In ScrollingLayoutSystem, use locked width as column width when wrap_size is set, bypassing the normal ratio-based sizing - Update locked dimensions on WindowResized so the column tracks changes - Add unit tests for config parsing, VWM assignment, constraint creation, resize updates, and scrolling layout column sizing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
There is a convenient option to force tiling for some apps using
app_rules:This prevents the Simulator from floating, but it leads to weird sizing behavior because the layout still stretches the window to fill the allocated column size.
Solution
This PR adds a
wrap_sizeoption toapp_rules. Whenwrap_size = trueandfloating = false, the layout column shrinks to wrap the window's actual natural size instead of stretching it to the default column ratio.Usage
How it works
wrap_size: booltoAppWorkspaceRulewrap_sizeis propagated throughAppRuleAssignmentand stored per-window inwindow_rule_wrap_sizeWindowsOnScreenUpdated, windows withwrap_sizegetWindowLayoutConstraintswithwrap_size: trueandis_resizable: false, using their current natural size as locked dimensionscalculate_layout, if a column contains awrap_sizewindow, the column width uses the locked width directly instead of the ratio-based widthWindowResizedupdates the locked dimensions so the column tracks the window's new sizeTesting
Added unit tests covering:
wrap_sizewrap_sizewrap_sizesuppression whenfloating = true