From 544f3b834b10632962a9d325a61e15a6290af069 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 6 Aug 2026 21:24:57 +0200 Subject: [PATCH] Apply the panel updates after stash operations in a single frame Stashing and popping change both the stash list and the files list. With each scope updating the UI as soon as its own refresh is done, the two panels visibly change at different times; with gui.shrinkSidePanelsToContent that also means their sizes change at different times than their contents. Co-Authored-By: Claude Opus 5 (1M context) --- pkg/gui/controllers/files_controller.go | 5 ++++- pkg/gui/controllers/stash_controller.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/gui/controllers/files_controller.go b/pkg/gui/controllers/files_controller.go index 567b0b6e5..62751eb35 100644 --- a/pkg/gui/controllers/files_controller.go +++ b/pkg/gui/controllers/files_controller.go @@ -1513,7 +1513,10 @@ func (self *FilesController) handleStashSave(stashFunc func(message string) erro if err := stashFunc(stashComment); err != nil { return err } - self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH, types.FILES}}) + self.c.Refresh(types.RefreshOptions{ + BatchUIUpdates: true, + Scope: []types.RefreshableView{types.STASH, types.FILES}, + }) return nil }, AllowEmptyInput: true, diff --git a/pkg/gui/controllers/stash_controller.go b/pkg/gui/controllers/stash_controller.go index d01fc8dbf..949068460 100644 --- a/pkg/gui/controllers/stash_controller.go +++ b/pkg/gui/controllers/stash_controller.go @@ -199,7 +199,10 @@ func (self *StashController) postStashRefresh() { // the remaining stash entries, and acting on the next entry in quick // succession (confirming the popup and pressing the key again right away) // must see the refreshed list, or it would target the wrong stash. - self.c.RefreshBlockingInput(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH, types.FILES}}) + self.c.RefreshBlockingInput(types.RefreshOptions{ + BatchUIUpdates: true, + Scope: []types.RefreshableView{types.STASH, types.FILES}, + }) } func (self *StashController) handleNewBranchOffStashEntry(stashEntry *models.StashEntry) error {