Skip to content

feat: add move tab keybind actions - #2561

Merged
ogulcancelik merged 2 commits into
herdrdev:masterfrom
omacom-io:feature/move-tab-keybinds
Aug 9, 2026
Merged

feat: add move tab keybind actions#2561
ogulcancelik merged 2 commits into
herdrdev:masterfrom
omacom-io:feature/move-tab-keybinds

Conversation

@dhh

@dhh dhh commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add optional keys.move_tab_previous and keys.move_tab_next actions that move the active tab one position toward the front or back, wrapping at either end — tmux's swap-window -t -1/+1
  • unset by default; bindable as prefix chords or direct shortcuts like other optional actions
  • reuses the existing tab.move runtime path (same one mouse drag reordering drives), so session save, tab.moved events, tab bar refresh, and active-tab identity all behave exactly like a drag — no new API surface or protocol change
  • shown in the keybind help under workspaces / tabs, documented in the config reference and sample config, changelog staged under docs/next/

Configuration

[keys]
move_tab_previous = "alt+shift+left"
move_tab_next = "alt+shift+right"

Testing

  • new unit tests: direct-chord dispatch mapping, reorder + wrap-around behavior at both ends (with workspace invariants asserted), and single-tab no-op
  • cargo fmt --check, full cargo test suite, and scripts/config_reference_check.py pass locally

@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: 5cb82cd2-2640-44f8-9710-9c5ebf44aa09

📥 Commits

Reviewing files that changed from the base of the PR and between 0ebd484 and b4b9126.

📒 Files selected for processing (5)
  • docs/next/CHANGELOG.md
  • docs/next/website/src/data/config-reference.json
  • src/app/input/navigate.rs
  • src/config/model.rs
  • src/main.rs
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/main.rs
  • docs/next/website/src/data/config-reference.json
  • src/config/model.rs
  • docs/next/CHANGELOG.md
  • src/app/input/navigate.rs

📝 Walkthrough

Walkthrough

This change adds optional keybindings for moving the active tab backward or forward. Movement wraps at either end, preserves the active tab, and does nothing for empty or single-tab workspaces.

Changes

Active tab movement

Layer / File(s) Summary
Keybinding configuration and defaults
src/config/model.rs, src/config/keybinds.rs, src/main.rs, docs/next/website/src/data/config-reference.json, src/ui/keybind_help.rs, docs/next/CHANGELOG.md
Adds move_tab_previous and move_tab_next bindings. Both are unset by default and use the existing parsing, profile-generation, help, and documentation paths.
Tab movement execution and validation
src/app/input/navigate.rs
Adds navigation actions, keybind dispatch, wrapped tab reordering, no-op handling, active-tab tracking, navigate-mode exit, and tests.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Keybinds
  participant NavigateAction
  participant WorkspaceTabs
  User->>Keybinds: Press configured tab-movement binding
  Keybinds->>NavigateAction: Resolve navigation action
  NavigateAction->>WorkspaceTabs: Move active tab with wraparound
  WorkspaceTabs-->>NavigateAction: Update tab order and active tab
  NavigateAction-->>User: Exit navigate mode
Loading

Possibly related PRs

  • herdrdev/herdr#2271: Extends the same keybinding configuration, parsing, defaults, and help infrastructure.
  • herdrdev/herdr#2558: Adds another optional navigation keybinding through NavigateAction, Keybinds, and KeysConfig.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: adding keybind actions to move tabs.
Description check ✅ Passed The description directly explains the new tab movement actions, configuration, implementation, documentation, and tests.
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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 687c6594-d1bb-4a95-b549-63b6ce66dd26

📥 Commits

Reviewing files that changed from the base of the PR and between e7c38ab and 74f1d04.

📒 Files selected for processing (7)
  • docs/next/CHANGELOG.md
  • docs/next/website/src/data/config-reference.json
  • src/app/input/navigate.rs
  • src/config/keybinds.rs
  • src/config/model.rs
  • src/main.rs
  • src/ui/keybind_help.rs

Comment thread src/app/input/navigate.rs
@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds optional keybindings for moving the active tab one position in either direction, including wrap-around behavior.

  • Routes both actions through the existing tab-move API path.
  • Propagates the bindings through configuration parsing, defaults, validation, reload, help, sample configuration, and reference documentation.
  • Adds dispatch and tab-ordering tests for direct bindings, wrapping, and single-tab workspaces.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up scope.

No blocking failure remains.

Important Files Changed

Filename Overview
src/app/input/navigate.rs Adds move-tab dispatch, wrapped insertion-index calculation, API routing, and focused unit tests; no eligible follow-up defect was established.
src/config/keybinds.rs Adds both actions to runtime keybinding storage, defaults, parsing, and validation.
src/config/model.rs Propagates both optional bindings through configuration deserialization, overlays, defaults, and effective-profile generation.
src/main.rs Documents the new unset-by-default bindings in the generated sample configuration.
src/ui/keybind_help.rs Exposes both configured move-tab actions in keybinding help.
docs/next/website/src/data/config-reference.json Adds matching user-facing configuration-reference entries.
docs/next/CHANGELOG.md Records the optional tab-reordering bindings in the unreleased changelog.

Sequence Diagram

sequenceDiagram
  participant User
  participant Input as Key dispatch
  participant Move as Tab move action
  participant API as Existing tab.move path
  participant Workspace
  User->>Input: move_tab_previous / move_tab_next
  Input->>Move: Resolve NavigateAction
  Move->>Move: Calculate wrapped insertion index
  Move->>API: Move active tab
  API->>Workspace: move_tab(source, insert)
  Workspace-->>User: Reordered tabs with active identity retained
Loading

Reviews (3): Last reviewed commit: "fix: exit navigate mode on single-tab mo..." | Re-trigger Greptile

@ogulcancelik

Copy link
Copy Markdown
Collaborator

@dhh i still can’t push. it looks like allow edits from maintainers doesn’t grant push access when the fork is organization-owned. you’d need to give ogulcancelik write access to omacom-io/herdr. if you’d rather not, you can also rebase and resolve the conflicts on your side

@dhh

dhh commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Oh, that's annoying. I've just given you access to that omacom-io/herdr repo 👌

dhh added 2 commits August 10, 2026 01:23
Add optional keys.move_tab_previous/move_tab_next actions that reorder
the active tab one position, wrapping at either end. Reuses the
existing tab.move runtime path that mouse drag reordering already
drives.
@ogulcancelik
ogulcancelik force-pushed the feature/move-tab-keybinds branch from 0ebd484 to b4b9126 Compare August 9, 2026 22:26
@ogulcancelik
ogulcancelik merged commit f5067ed into herdrdev:master Aug 9, 2026
8 checks passed
@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