From e5c39d5401055d01453a6220f3e62720dd41d2cb Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 11 Jul 2025 15:39:27 +0200 Subject: [PATCH] Fix visual regression when exiting filtering mode When exiting filtering mode while the focus is not in the local commits panel, the call to HandleFocus would render the selection in the commits panel as if the panel had the focus. The call to HandleFocus was introduced recently in 4981419ba95d in an attempt to rerender the main view correctly, but it should only have been called when local commits is the focused context. But instead, we can use PostRefreshUpdate, which handles this distinction. --- pkg/gui/controllers/helpers/mode_helper.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/gui/controllers/helpers/mode_helper.go b/pkg/gui/controllers/helpers/mode_helper.go index f90519e4d..a5960697a 100644 --- a/pkg/gui/controllers/helpers/mode_helper.go +++ b/pkg/gui/controllers/helpers/mode_helper.go @@ -178,7 +178,8 @@ func (self *ModeHelper) ClearFiltering() error { // before we entered filtering self.c.Contexts().LocalCommits.SelectCommitByHash(self.c.Modes().Filtering.GetSelectedCommitHash()) } - self.c.Contexts().LocalCommits.HandleFocus(types.OnFocusOpts{}) + + self.c.PostRefreshUpdate(self.c.Contexts().LocalCommits) }, }) return nil