git: Touch up amend UX (#35114)

Follow-up to #26114

- Ensure that the previous commit message is filled in when toggling on
amend mode from the context menu
- Fix keybinding flicker in context menu

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-07-28 12:21:07 -04:00 committed by GitHub
parent fd68265efd
commit 3dc36dc7c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 26 deletions

View file

@ -295,11 +295,13 @@ impl CommitModal {
IconPosition::Start,
Some(Box::new(Amend)),
{
let git_panel = git_panel_entity.clone();
move |window, cx| {
git_panel.update(cx, |git_panel, cx| {
git_panel.toggle_amend_pending(&Amend, window, cx);
})
let git_panel = git_panel_entity.downgrade();
move |_, cx| {
git_panel
.update(cx, |git_panel, cx| {
git_panel.toggle_amend_pending(cx);
})
.ok();
}
},
)