Repository navigation
feat(layout): add layout-toggle-split action for dwindle - #444
Conversation
There was a problem hiding this comment.
Talia preliminary review
| Check | Result |
|---|---|
| Merge score | 🟢 4/5 — No issues found; likely ready after CI and human review |
| Findings | None found |
| Review depth | 3/5 — how thoroughly the changed code could be checked by reading it |
| Coverage | 11 of 11 changed files reviewed |
What Talia checked: Verified the new toggleSplit orientation test matches arrangeNode's HSplit/VSplit/AutoSplit resolution, that the preserve_split guard reads the same resolved workspace config DwindleLayout uses (setConfig(&m_layoutConfig)), and that enum/handler/spec/doc/cheatsheet tables stay index- and group-aligned; no runtime arrange path was executed.
Run details
- Commit reviewed: b684b91
- Source lookups: 30 file reads, 22 searches
- Prompt version: 859b7490ca3d
Preliminary automated review: Talia read the changed code and related source; nothing was built, run or tested, and AI can make mistakes. It is not a scope acceptance or a promise to merge; a human reviewer makes the final call. See our ethos.
|
Thanks, the toggle itself works well. One change, though: I don't think it should require preserve_split. Splits already have a locked flag. Directional drops set it, and arrangeNode never reorients a locked split, whatever preserve_split is set to. If toggleSplit set parent->locked = true, the flipped direction would stick without preserve_split, and the extra guard and refusal path could go. preserve_split is a global choice about whether automatic splits follow geometry. A split the user flipped by hand should stay put either way, just like a directional drop. Could you:
|
b684b91 to
7a21540
Compare
|
I've amended the commit and force-pushed:
The unit tests pass (114/114). The full harness run has 3 failures ( |
|
thx! |
Summary
Adds a
layout-toggle-splitaction that flips the split holding the focused tile in the dwindle layout between side by side and stacked, keeping its ratio. This is the equivalent of Hyprland'stogglesplit. It is refused outside the dwindle layout and whenlayout.dwindle.preserve_splitis disabled.docs/user/actions.mdanddocs/user/layout.mdare updated.Motivation
Dwindle picks each split's direction from the tile's longer edge, and
preserve_splitfreezes that choice. There was no way to change a split's direction afterwards, short of closing and re-opening windows. This lets a user change a split's orientation with a keybind. It requirespreserve_splitbecause, without it, the next arrange would flip the split back to the longer-edge direction.Type of Change
Testing
layout.mode = "dwindle"andlayout.dwindle.preserve_split = true, boundlayout-toggle-split, and opened three windows. Toggling on a stacked pair flips it to side by side and back.preserve_split = false, the action is refused with an error naming the setting. After switching the workspace to the scrolling layout, it is refused with "requires the dwindle layout".Manual Coverage
Checklist
SCOPE.md, or its scope was agreed in an issue or on Discord first.CONTRIBUTING.md.just format, or this PR has no C++ changes.docs/andexamples/config.toml, or this PR does not change user-facing configuration or behavior.Additional Notes
The flip does not set the split's
lockedflag, becausepreserve_splitalready keeps splits fixed during arrange.