Skip to content

feat: add an Equalize Splits command to even every split in the tab - #870

Merged
penso merged 2 commits into
penso:mainfrom
senrecep:feat/equalize-splits-command
Oct 28, 2026
Merged

penso merged 2 commits into
penso:mainfrom
senrecep:feat/equalize-splits-command

Conversation

@senrecep

@senrecep senrecep commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Equalize Splits (equalize_splits), which evens every split in the focused tab. Until now the only way was a double-click on a border between panes, so it couldn't be bound to a key or run from the palette.

  • The command builds the same even targets the double-click does (splits::even_targets) and sends them through flush_split, one layout.set_split_ratio at a time. It isn't tied to a pointer (held: false), so the drag retires once the last ratio is answered.
  • Like the double-click, it leaves a zoomed tab alone, and it does nothing while a border is still being dragged or evened.
  • It has no default shortcut, so it takes no key from anyone. It shows in the palette, groups with the other pane commands in the shortcut editor, and can be bound in [keybindings]. The README's keybinding notes mention it next to resize_mode.

Refs #865 (item 3).

Screenshots

Not captured. The only visible change is a new "Equalize Splits" entry in the palette and the shortcut editor.

QA

  • cargo test -p herdr-commands: 18 passed
  • cargo test -p herdr-gpui --bin herdr-gpui -- split_equalize menu::settings keymap palette: passed, including new endpoint::lifecycle_tests::split_equalize::command (4 tests, two of them for a held drag and a second run)
  • Red check: with the command's handler emptied, the_command_evens_every_split_in_the_tab fails; without the split_drag guard, the held-drag and second-run tests fail
  • just ci (Linux x86_64)
  • just lint-linux
  • just lint-windows
  • In a tab with three or more uneven splits, run Equalize Splits from the palette and confirm every pane gets an even share
  • Bind equalize_splits in [keybindings] and confirm the key does the same
  • Zoom a pane, run the command, and confirm the layout is unchanged after unzooming

Evening the splits was only a double-click on a border between panes, so
it could not be bound to a key or run from the palette. Equalize Splits
does the same from a command: it sends one ratio per split through the
double-click's path, and leaves a zoomed tab, or a border still being
dragged or evened, alone. It has no default shortcut; bind
equalize_splits in [keybindings].
@senrecep
senrecep requested a review from penso as a code owner October 28, 2026 09:50
@senrecep

senrecep commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

just ci ran locally and passed on 1f8b307 (Linux x86_64, CachyOS, toolchain 1.96.1). Also ran just lint-linux and just lint-windows, which passed.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge, with no outstanding findings.

Summary

Adds EqualizeSplits to even every split in the focused tab.

  • Equalize Splits evens every split in the focused tab.

Reviews (2) · Last reviewed commit: "test: cover Equalize Splits during a hel..." · Reviewed by Greptile

@penso

penso commented Oct 28, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@penso
penso merged commit b554e2b into penso:main Oct 28, 2026
19 checks passed
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.

2 participants