feat(tui): patch hunk picking#13165
Merged
davidpdrsn merged 15 commits intomasterfrom Apr 2, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds “patch hunk picking” support in the legacy status TUI by enabling operations that move individual diff hunks from the details/diff viewer into commits, stacks/branches, or unassigned, with updated navigation/keybindings and refreshed TUI snapshots.
Changes:
- Introduces committed-hunk routing/execution logic to move a selected hunk to a commit/stack/unassigned and integrates it into Rub flow.
- Adds/extends TUI modes & keybindings (notably a dedicated Details mode) and cursor helpers to keep selections visible during navigation.
- Updates tests and SVG snapshots to reflect the new UI behavior/rendering and selection/scrolling behavior.
Reviewed changes
Copilot reviewed 15 out of 103 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/but/src/command/legacy/status/tui/tests/utils.rs | Snapshot rendering normalization updates (incl. detecting long hashes) and cursor color deref adjustment. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/inline_reword_renders_on_visible_row_when_scrolled_001.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/inline_reword_004.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/inline_reword_003.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/focus_reload_in_branch_mode_preserves_merge_base_selection_final.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/focus_reload_in_branch_mode_preserves_branch_selection_final.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/entering_branch_mode_closes_global_file_list_final.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_message_wraps_in_details_view_003.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_message_wraps_in_details_view_002.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_message_wraps_in_details_view_001.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/command_mode_success_002.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/command_mode_success_001.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/branch_mode_from_unassigned_jumps_to_first_branch_final.svg | Updated snapshot output reflecting new UI rendering/hotbar details. |
| crates/but/src/command/legacy/status/tui/tests/rub_tests.rs | Updates Rub tests for new operation display/behavior. |
| crates/but/src/command/legacy/status/tui/tests/mod.rs | Adds a regression test for branch-mode scrolling visibility and adjusts a TUI height in an existing test. |
| crates/but/src/command/legacy/status/tui/rub_from_detail_view.rs | New routing/execution logic for moving committed hunks from the details view to other targets. |
| crates/but/src/command/legacy/status/tui/rub_api.rs | Tightens handling of “new_commit” results (now errors when missing) for certain operations. |
| crates/but/src/command/legacy/status/tui/mode.rs | Adds Details mode styling helpers and introduces RubSource::CommittedHunk / CommittedHunk types. |
| crates/but/src/command/legacy/status/tui/message_on_drop.rs | Adds an RAII guard to emit cleanup/unlock messages on drop. |
| crates/but/src/command/legacy/status/tui/key_bind.rs | Refactors global binds registration, adds Details-mode binds, and updates mode-specific binds. |
| crates/but/src/command/legacy/status/tui/fps.rs | Adds an FPS counter utility. |
| crates/but/src/command/legacy/status/tui/event_polling.rs | Adds an event polling abstraction (real vs noop) to support non-interactive runs/testing. |
| crates/but/src/command/legacy/status/tui/details/details_cursor.rs | Adds a cursor/selection helper for details sections. |
| crates/but/src/command/legacy/status/tui/cursor/tests.rs | Updates cursor tests for the new RubSource/RubMode shape. |
| crates/but/src/command/legacy/status/tui/cursor/mod.rs | Adds select_stack helper and extends selection logic to account for Details mode and RubSource comparisons. |
| crates/but/Cargo.toml | Adds uuid to dependencies (used by details view code). |
| Cargo.lock | Lockfile update for the added dependency. |
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.
Adds support for moving hunks from the diff viewer to commits, branches, etc.
Diff is big because all the snapshots have changed.