Allow removing lines from patch directly#5277
Conversation
9775c4e to
590719d
Compare
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
590719d to
15e3017
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for using the universal remove keybinding (typically d) in the patch building view to remove selected lines directly from a commit (mirroring staging view muscle memory), backed by new i18n strings, docs updates, and an integration test.
Changes:
- Add
d/Universal.Remove keybinding in patch building view to remove selected lines from the commit via interactive rebase. - Introduce new i18n strings for the new action (labels, tooltips, prompts, disabled reasons).
- Add an integration test and update generated keybindings docs accordingly.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/gui/controllers/patch_building_controller.go | Adds Universal.Remove binding, disabled-reason logic, confirmation flow, and rebase-backed removal implementation. |
| pkg/i18n/english.go | Adds translation keys/strings for the new remove-lines-from-commit action and related errors/tooltips. |
| pkg/integration/tests/patch_building/remove_lines_from_commit.go | New integration test covering d in patch building view to remove a selected line from a commit. |
| pkg/integration/tests/test_list.go | Registers the new integration test. |
| docs-master/keybindings/Keybindings_*.md | Updates generated keybindings docs to include the new d action in patch building view across languages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
I always press 'd' in the patch building view, expecting that I can do exactly what I can do in the staging view, to find out I need to go space -> ctrl+p -> d and I think it's time to honour the muscle memory and support this convenience keybinding.
15e3017 to
81c96ef
Compare
|
Great, you beat me to it. I have had this on my todo list for quite a while. It might take me a while to review it, I'm busy right now with work and private stuff, but I'll get to it eventually (and the other two PRs). Looking forward to using it. |
I always press 'd' in the patch building view, expecting that I can do exactly what I can do in the staging view, to find out I need to go space -> ctrl+p -> d and I think it's time to honour the muscle memory and support this convenience keybinding. I recall we may have had a debate about this in the past and if so I'm renewing my stance.
PR Description
Please check if the PR fulfills these requirements
go generate ./...)