feat(tui): insert commits above or below existing commits#12925
Merged
davidpdrsn merged 1 commit intomasterfrom Mar 19, 2026
Merged
feat(tui): insert commits above or below existing commits#12925davidpdrsn merged 1 commit intomasterfrom
davidpdrsn merged 1 commit intomasterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
4b810a5 to
6147c67
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the legacy but TUI commit workflow to allow inserting a newly created commit above or below an existing commit, instead of only at the top of a branch. It also tightens commit-mode target scoping to the current stack and updates TUI snapshot tests accordingly.
Changes:
- Add commit-mode support for selecting commit rows as insertion targets, with an insert-side toggle (above/below).
- Render a synthetic “insert commit above/below” row around the selected commit to visualize insertion position.
- Propagate stack IDs into commit rows to enforce commit-mode scoping, and add/refresh snapshot test coverage.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/but/src/command/legacy/status/tui/mod.rs | Implements commit-to-commit insertion targeting, insert-side state, and synthetic row rendering in commit mode. |
| crates/but/src/command/legacy/status/tui/key_bind.rs | Adds commit-mode keybinds to toggle insert side (a/b). |
| crates/but/src/command/legacy/status/tui/graph_extension.rs | New helper to extend graph connector glyphs for the synthetic insertion row. |
| crates/but/src/command/legacy/status/tui/cursor/tests.rs | Updates/extends cursor selectability tests for commit-mode stack scoping. |
| crates/but/src/command/legacy/status/output.rs | Extends commit row metadata to carry stack_id for commit-mode scoping. |
| crates/but/src/command/legacy/status/mod.rs | Plumbs stack IDs into commit rows when printing status output. |
| crates/but/src/command/legacy/status/tui/tests/commit_tests.rs | Adds commit-mode tests + snapshot assertions for above/below insertion behavior and scoping. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_confirm_on_source_is_noop_final.txt | New snapshot for commit confirm no-op behavior. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_from_unstaged_changes_creates_commit_visible_in_tui_final.txt | New snapshot verifying commit creation from unstaged changes is visible. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_mode_can_toggle_commit_target_insert_side_final.txt | New snapshot verifying toggling above/below indicator in commit mode. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_mode_enter_and_escape_final.txt | New snapshot for entering/exiting commit mode. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_mode_from_staged_changes_stays_within_current_stack_final.txt | New snapshot verifying commit-mode target scoping from staged-to-stack sources. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_mode_not_entered_from_non_commitable_rows_final.txt | New snapshot verifying commit mode doesn’t start from non-committable rows. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_mode_shows_commit_above_on_commit_rows_final.txt | New snapshot showing the synthetic “insert commit above” row. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_to_commit_above_creates_commit_visible_in_tui_final.txt | New snapshot verifying insertion above a commit creates a visible commit. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/commit_to_commit_below_creates_commit_visible_in_tui_final.txt | New snapshot verifying insertion below a commit creates a visible commit. |
| crates/but/src/command/legacy/status/tui/tests/snapshots/staged_source_commit_cannot_be_forced_to_other_stack_target_final.txt | New snapshot ensuring scoped commit sources can’t target other stacks. |
You can also share your feedback on Copilot code review. Take the survey.
Previously it was only possible to insert new commits at the top of a branch, but with this change it's now also possible to insert new commits above or below existing commits.
6147c67 to
2566ed1
Compare
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.
Previously it was only possible to insert new commits at the top of a
branch, but with this change it's now also possible to insert new
commits above or below existing commits.
Note
This pull request is part of a stack: