Add resizable panes via leader keys and draggable dividers#274
Open
noomz wants to merge 1 commit into
Open
Conversation
Panes were fixed-size (sidebar 35 cols, query/results 50/50). Add the ability to resize both boundaries: - Leader: space = grows, space - shrinks the focused pane's boundary (explorer -> sidebar width; query/results -> the split). - Mouse: thin draggable dividers between sidebar<->main and query<->results, with a hover highlight. Chosen sizes persist across restarts (interface state, per the keybindings/aesthetics exception). Sizes are clamped and re-clamped to the terminal, and the dividers hide when a pane is maximized or the explorer is hidden. Fullscreen restores the saved sizes on exit. Per the project's keybinding philosophy we avoid ctrl+ chords: the direct resize actions (grow_sidebar/shrink_sidebar/grow_split/shrink_split) ship unbound and remain rebindable via the keymap editor, so there is no clash with the OS (e.g. macOS reserves ctrl+arrow for Spaces/Mission Control). Adds tests/ui/keybindings/test_pane_resize.py covering keyboard resize, leader-key end-to-end, mouse drag, clamps, persistence, fullscreen-hide, and blank splitter rendering. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Panes were fixed-size (sidebar 35 cols, query/results split 50/50). This adds the ability to resize both boundaries — the sidebar↔main-panel width and the query↔results height.
How to use
space =grows /space -shrinks the focused pane's boundary. Focus a pane first (e/q/r): explorer → sidebar width; query or results → the split.Chosen sizes persist across restarts (interface state, per the keybindings/aesthetics exception in CONTRIBUTING). Sizes are clamped and re-clamped to the terminal; dividers hide when a pane is maximized (
space f) or the explorer is hidden, and the saved sizes are restored on exit.Design notes (per project philosophy)
CONTRIBUTING states sqlit "shies away from
^+commands" and favours vim/leader bindings, exposing non-essential actions behind the<space>command menu. So:space =/-) + mouse — no chords, no new always-visible toolbar entries.grow_sidebar/shrink_sidebar/grow_split/shrink_split) ship unbound and stay rebindable via the keymap editor. This deliberately avoids OS clashes (macOS reservesctrl+arrowfor Spaces/Mission Control).Tests
New
tests/ui/keybindings/test_pane_resize.py(Textualrun_testpilot): keyboard resize, leader-key end-to-end, mouse drag, min/max clamps, count-prefix, persistence round-trip + startup re-clamp, fullscreen-hide, and a regression test that the splitter renders blank (Textual's defaultWidget.render()leaks the CSS identifier as placeholder text).All new tests pass; the full
tests/ui/suite is green (one unrelated flaky telescope test passes in isolation).🤖 Generated with Claude Code