fix: auto-close rebase continue popup when rebase completes externally#5252
Open
aofei wants to merge 1 commit intojesseduffield:masterfrom
Open
fix: auto-close rebase continue popup when rebase completes externally#5252aofei wants to merge 1 commit intojesseduffield:masterfrom
aofei wants to merge 1 commit intojesseduffield:masterfrom
Conversation
When a rebase has conflicts and the user resolves them and runs `git rebase --continue` in an external terminal, the "Continue rebase?" confirmation popup now automatically dismisses instead of staying visible. The implementation introduces `PopupAutoCloseCondition` to tag popups that should auto-close under specific conditions. During status refresh, if the working tree state becomes none (no rebase/merge in progress) and the current popup has matching auto-close condition, the popup is closed. To allow refresh while the auto-closable popup is showing, the refresh keybinding now uses `refreshAllowPopupAutoClose` which permits refresh only for popups with an auto-close condition set. Fixes jesseduffield#5197 Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
There was a problem hiding this comment.
Pull request overview
Adds infrastructure to automatically dismiss certain popups when their triggering condition is no longer true, fixing the “Continue rebase?” confirmation popup persisting after a rebase completes externally (Fixes #5197).
Changes:
- Introduces
PopupAutoCloseConditionand plumbs it through popup option structs and popup creation. - Adds refresh-time logic to auto-close popups when the working tree returns to a “no operation in progress” state.
- Updates the global refresh keybinding to allow refresh while an auto-closable popup is showing, and adds an integration test covering the external
git rebase --continueflow.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/integration/tests/test_list.go | Registers the new integration test in the test suite. |
| pkg/integration/tests/branch/rebase_conflicts_resolved_externally.go | Adds an integration test reproducing the external rebase-continue scenario and asserting the popup dismisses. |
| pkg/gui/types/common.go | Introduces PopupAutoCloseCondition and extends popup option structs to carry it. |
| pkg/gui/popup/popup_handler.go | Passes AutoCloseCondition from ConfirmOpts into CreatePopupPanelOpts; simplifies ConfirmIf to reuse Confirm. |
| pkg/gui/controllers/helpers/refresh_helper.go | Adds auto-close logic during status refresh and a mutex-protected check for current popup opts. |
| pkg/gui/controllers/helpers/merge_and_rebase_helper.go | Marks the “continue rebase” confirmation popups as auto-closable when the working tree state becomes none. |
| pkg/gui/controllers/global_controller.go | Adjusts refresh keybinding to allow refresh when an auto-closable popup is focused. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
PR Description
When a rebase has conflicts and the user resolves them and runs
git rebase --continuein an external terminal, the "Continue rebase?" confirmation popup now automatically dismisses instead of staying visible.The implementation introduces
PopupAutoCloseConditionto tag popups that should auto-close under specific conditions. During status refresh, if the working tree state becomes none (no rebase/merge in progress) and the current popup has matching auto-close condition, the popup is closed.To allow refresh while the auto-closable popup is showing, the refresh keybinding now uses
refreshAllowPopupAutoClosewhich permits refresh only for popups with an auto-close condition set.Fixes #5197
Please check if the PR fulfills these requirements
go generate ./...)Manual Test
Steps
Expected
The "Continue rebase?" popup automatically dismisses after step 4.
Cleanup