From 4c9fdc42213eb4a7953c3e24c07140ec70c9e05f Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 3 Jul 2026 15:21:20 +0200 Subject: [PATCH] Bounce STATUS view update onto the UI thread refreshStatus computes the status line on the calling goroutine (as before) but now writes it to the status view in an onUIThreadUnlessRepoChanged bounce rather than calling SetViewContent directly from the worker. RefreshingStatusMutex is left in place for now; it only guards the compute phase between concurrent callers and comes out in the mutex cleanup. Co-Authored-By: Claude Sonnet 5 --- pkg/gui/controllers/helpers/refresh_helper.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/gui/controllers/helpers/refresh_helper.go b/pkg/gui/controllers/helpers/refresh_helper.go index fc405c6bf..083907881 100644 --- a/pkg/gui/controllers/helpers/refresh_helper.go +++ b/pkg/gui/controllers/helpers/refresh_helper.go @@ -1048,6 +1048,8 @@ func (self *RefreshHelper) refreshStatus() { self.c.Mutexes().RefreshingStatusMutex.Lock() defer self.c.Mutexes().RefreshingStatusMutex.Unlock() + generation := self.c.State().GetRepoGeneration() + currentBranch := self.refsHelper.GetCheckedOutRef() if currentBranch == nil { // need to wait for branches to refresh @@ -1061,7 +1063,10 @@ func (self *RefreshHelper) refreshStatus() { status := presentation.FormatStatus(repoName, currentBranch, types.ItemOperationNone, linkedWorktreeName, workingTreeState, self.c.Tr, self.c.UserConfig()) - self.c.SetViewContent(self.c.Views().Status, status) + self.onUIThreadUnlessRepoChanged(generation, func() error { + self.c.SetViewContent(self.c.Views().Status, status) + return nil + }) } func (self *RefreshHelper) refForLog() string {