Skip to content

feat: add direct pane resize keybindings - #2558

Merged
ogulcancelik merged 3 commits into
herdrdev:masterfrom
omacom-io:feature/resize-pane-bindings
Aug 9, 2026
Merged

feat: add direct pane resize keybindings#2558
ogulcancelik merged 3 commits into
herdrdev:masterfrom
omacom-io:feature/resize-pane-bindings

Conversation

@dhh

@dhh dhh commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add optional keys.resize_pane_left, keys.resize_pane_down, keys.resize_pane_up, and keys.resize_pane_right actions that resize the focused pane in one keystroke, without entering resize mode
  • unset by default, so existing configs and the default keymap are unchanged
  • bindable as prefix chords or direct shortcuts, like other optional actions
  • resizing reuses the existing tui.pane.resize runtime path used by resize mode
  • document the keys in the config reference, add a tmux-style example to the configuration guide, and stage a changelog entry under docs/next/

Configuration

For tmux-style direct resizing:

[keys]
resize_pane_left = "ctrl+shift+alt+left"
resize_pane_down = "ctrl+shift+alt+down"
resize_pane_up = "ctrl+shift+alt+up"
resize_pane_right = "ctrl+shift+alt+right"

Testing

  • new unit tests cover direct-chord and prefix-chord dispatch to the resize actions
  • cargo fmt --check, full cargo test suite, scripts/config_reference_check.py, and the maintenance script tests pass locally (the pre-existing generated_workspace_ids_are_short_base32_handles ordering flake under plain cargo test fails identically on clean master)

Add optional keys.resize_pane_left/down/up/right actions so a single
chord can resize the focused pane tmux-style without entering resize
mode. Unset by default; bindable as prefix or direct shortcuts.
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 420cd2de-6cd3-4e37-b33d-bd43fc03fd06

📥 Commits

Reviewing files that changed from the base of the PR and between 3741b01 and ca74d6c.

📒 Files selected for processing (2)
  • src/main.rs
  • src/ui/keybind_help.rs

📝 Walkthrough

Walkthrough

The change adds four optional directional pane-resize keybindings. Configuration supports defaults, overlays, profiles, parsing, and validation. Navigation resolves the bindings, resizes panes through API and state paths, exits navigate mode, and tests cover direct and prefix bindings.

Changes

Pane Resize Bindings

Layer / File(s) Summary
Configure directional resize bindings
src/config/model.rs, src/config/keybinds.rs, src/main.rs, src/ui/keybind_help.rs
Configuration and default settings now include four unset resize bindings. Overlay handling, profile generation, validation, parsing, and help output support the new fields.
Resolve and execute pane resize actions
src/app/input/navigate.rs
NavigateAction includes four resize variants. Configured bindings resolve to these actions. API-backed and state navigation paths resize the pane and exit navigate mode. Tests cover direct and prefix bindings.
Document resize bindings
docs/next/website/src/data/config-reference.json, docs/next/website/src/content/docs/configuration.mdx, docs/next/CHANGELOG.md
The configuration reference, keybinding example, and changelog describe the four optional resize bindings.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Keybinds
  participant NavigateAction
  participant App
  participant PaneAPI
  Keybinds->>NavigateAction: resolve resize keybinding
  NavigateAction->>App: execute directional resize
  App->>PaneAPI: send tui.pane.resize request
  PaneAPI-->>App: resize pane
  App-->>NavigateAction: exit navigate mode
Loading

Possibly related PRs

  • herdrdev/herdr#2265: Both changes modify directional pane navigation in src/app/input/navigate.rs, but this PR adds resize actions.
  • herdrdev/herdr#2271: Both changes add directional keybindings through the configuration, help, and reference systems, but target different actions.
  • herdrdev/herdr#2561: Both changes add navigation actions and configurable keybindings through the same input and configuration systems.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding direct pane resize keybindings.
Description check ✅ Passed The description explains the new keybindings, defaults, configuration, documentation, runtime behavior, and testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 9, 2026
@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds optional direct and prefix-chord keybindings for resizing the focused pane through the existing pane-resize runtime path.

  • Adds four directional resize actions to configuration parsing, defaults, effective keybind construction, and dispatch.
  • Documents the optional bindings in the configuration reference, guide, generated default config, and changelog.
  • Displays configured direct-resize bindings in keybind help and adds dispatch-focused unit coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/app/input/navigate.rs Adds directional resize actions, key resolution, runtime dispatch, mode cleanup, and direct/prefix mapping tests.
src/config/model.rs Adds four optional directional resize fields throughout key configuration deserialization, effective-profile generation, and defaults.
src/config/keybinds.rs Propagates the new optional bindings into runtime keybind construction and layered configuration application.
src/ui/keybind_help.rs Includes configured direct pane-resize actions in the keybinding help display.
src/main.rs Lists the optional direct-resize keys in the generated default configuration.
docs/next/website/src/data/config-reference.json Documents all four new configuration keys as unset by default.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Configured resize_pane direction binding] --> B{Input mode}
  B -->|Terminal direct shortcut| C[Resolve NavigateAction]
  B -->|Prefix chord| C
  C --> D[ResizePane direction]
  D --> E[tui.pane.resize runtime path]
  E --> F[Resize focused pane]
  D --> G[Leave navigate or prefix mode]
Loading

Reviews (2): Last reviewed commit: "fix: list resize keybindings in the defa..." | Re-trigger Greptile

@ogulcancelik

Copy link
Copy Markdown
Collaborator

hey @dhh, i tried pushing a small follow-up to the pr branch, but it looks like maintainer edits are blocked at the org level. would be great to expose the new resize keybindings in both herdr --default-config and the prefix+? keybind menu before we merge.

@dhh

dhh commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Just allowed for maintainer fixes to be pushed. Feel free to make any changes as you see fit!

@dhh

dhh commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer edits are now enabled on this PR and the other open ones (#2560, #2561, #2562, #2570).

@dhh

dhh commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Done in ca74d6c — the four resize keys now appear as commented entries in herdr --default-config next to resize_mode, and in the prefix+? panes group (showing "unset" until bound, like the other optional actions).

@ogulcancelik
ogulcancelik merged commit 4e31084 into herdrdev:master Aug 9, 2026
8 checks passed
@ogulcancelik

Copy link
Copy Markdown
Collaborator

ty!

@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 9, 2026
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.

3 participants