feat: add BSP normalization#2135
Open
OliverGuy wants to merge 2 commits into
Open
Conversation
Cf. nikitabobko#260 What: a new `enable-normalization-binary-tree` config option. When enabled, every tiling container is normalized to at most two children, with each level's orientation derived from its rectangle's aspect ratio, producing an i3/bspwm-style binary space partition. Why: users coming from BSP-style window managers expect new splits to follow the longer edge automatically instead of piling siblings into a single container. How: normalizeBinaryTree() recursively wraps surplus children into a nested container (forceBinaryTree), then sets each level's orientation and split position from its computed rect. Gated behind the new flag in normalizeContainers(); setOrientation is exposed on TilingContainer for it.
What: with enable-normalization-binary-tree, `move <dir>` on a window at the workspace's edge in that direction now applies the boundary action (e.g. crosses to the adjacent monitor with --boundaries all-monitors-outer-frame) instead of being popped out one container level. Why: binary-tree normalization re-nests a window as soon as `move` bubbles it out of its container, so it could never reach the workspace-root edge that triggers a monitor crossing — it just oscillated inside its container and never left the monitor. How: in MoveCommand's move-out branch, when the window has no target in the direction anywhere up the tree (closestParent(hasChildrenInDirection:) == nil, i.e. it is at the workspace edge) and enableNormalizationBinaryTree is set, route to hitWorkspaceBoundaries instead of moveOut. Non-binary-tree configs keep the existing i3-style move-out behaviour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
OliverGuy
force-pushed
the
feat/binary-tree-normalization
branch
from
July 8, 2026 19:56
c85f9ed to
3204d8d
Compare
whoislikemiha
added a commit
to whoislikemiha/AeroSpace
that referenced
this pull request
Jul 11, 2026
…hrows annotations and the unnecessary try from non-throwing async MoveCommand tests.\n\nWhy: Swift 6.3 reports the unnecessary try as a warning, and AeroSpace compiles tests with warnings as errors. This caused BSP PR nikitabobko#2135 to fail the repository's full test gate.\n\nHow: use plain await for the non-throwing command and let SwiftFormat remove the redundant throws declarations.
whoislikemiha
added a commit
to whoislikemiha/AeroSpace
that referenced
this pull request
Jul 11, 2026
What: remove redundant throws annotations and the unnecessary try from non-throwing async MoveCommand tests. Why: Swift 6.3 reports the unnecessary try as a warning, and AeroSpace compiles tests with warnings as errors. This caused BSP PR nikitabobko#2135 to fail the repository's full test gate. How: use plain await for the non-throwing command and let SwiftFormat remove the redundant throws declarations.
|
The full I ran the complete gate after applying the SwiftFormat-compatible fix; build, tests, lint, Periphery, and generated-file checks all pass. Cherry-pickable commit: whoislikemiha/AeroSpace@bf5c86a |
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.
Cf. #260.
What
A new
enable-normalization-binary-treeconfig option. When enabled, every tiling container is normalized to at most two children, with each level's orientation derived from its rectangle's aspect ratio, producing an i3/bspwm-style binary space partition.Why
Users coming from BSP-style window managers expect new splits to follow the longer edge automatically instead of piling siblings into a single container.
How
NormalizeBinaryTree()recursively wraps surplus children into a nested container (forceBinaryTree), then sets each level's orientation and split position from its computed rect. Gated behind the new flag innormalizeContainers();setOrientationis exposed onTilingContainerfor it.PR checklist
./test.shexits with non-zero exit code.