feat: add move tab keybind actions - #2561
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThis 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. ChangesActive tab movement
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (7)
docs/next/CHANGELOG.mddocs/next/website/src/data/config-reference.jsonsrc/app/input/navigate.rssrc/config/keybinds.rssrc/config/model.rssrc/main.rssrc/ui/keybind_help.rs
Greptile SummaryThe PR adds optional keybindings for moving the active tab one position in either direction, including wrap-around behavior.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains within the eligible follow-up scope. No blocking failure remains.
|
| 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
Reviews (3): Last reviewed commit: "fix: exit navigate mode on single-tab mo..." | Re-trigger Greptile
|
@dhh i still can’t push. it looks like |
|
Oh, that's annoying. I've just given you access to that omacom-io/herdr repo 👌 |
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.
0ebd484 to
b4b9126
Compare
Summary
keys.move_tab_previousandkeys.move_tab_nextactions that move the active tab one position toward the front or back, wrapping at either end — tmux'sswap-window -t -1/+1tab.moveruntime path (same one mouse drag reordering drives), so session save,tab.movedevents, tab bar refresh, and active-tab identity all behave exactly like a drag — no new API surface or protocol changedocs/next/Configuration
Testing
cargo fmt --check, fullcargo testsuite, andscripts/config_reference_check.pypass locally