Skip to content

Add resizable panes via leader keys and draggable dividers#274

Open
noomz wants to merge 1 commit into
Maxteabag:mainfrom
noomz:feat/pane-resize
Open

Add resizable panes via leader keys and draggable dividers#274
noomz wants to merge 1 commit into
Maxteabag:mainfrom
noomz:feat/pane-resize

Conversation

@noomz

@noomz noomz commented Jul 15, 2026

Copy link
Copy Markdown

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

  • Leader: space = grows / space - shrinks the focused pane's boundary. Focus a pane first (e/q/r): explorer → sidebar width; query or results → the split.
  • Mouse: thin draggable dividers sit between sidebar↔main and query↔results, with an accent hover highlight.

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:

  • The primary UX is the leader menu (space =/-) + mouse — no chords, no new always-visible toolbar entries.
  • The direct actions (grow_sidebar/shrink_sidebar/grow_split/shrink_split) ship unbound and stay rebindable via the keymap editor. This deliberately avoids OS clashes (macOS reserves ctrl+arrow for Spaces/Mission Control).
  • No new toggle/setting — pane sizes are interface state, the one exception CONTRIBUTING allows.

Tests

New tests/ui/keybindings/test_pane_resize.py (Textual run_test pilot): 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 default Widget.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

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>
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.

1 participant