From ff7ecf2d2a427f030da7b80e6e3307461ea975be Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 3 Jul 2026 14:21:51 +0200 Subject: [PATCH] Bounce STASH model updates onto the UI thread refreshStashEntries now loads the stash entries on the worker and writes Model.StashEntries in an onUIThreadUnlessRepoChanged bounce. Co-Authored-By: Claude Sonnet 5 --- pkg/gui/controllers/helpers/refresh_helper.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/gui/controllers/helpers/refresh_helper.go b/pkg/gui/controllers/helpers/refresh_helper.go index e610fef13..2076e45ee 100644 --- a/pkg/gui/controllers/helpers/refresh_helper.go +++ b/pkg/gui/controllers/helpers/refresh_helper.go @@ -979,9 +979,16 @@ func (self *RefreshHelper) refreshWorktrees() { } func (self *RefreshHelper) refreshStashEntries() { - self.c.Model().StashEntries = self.c.Git().Loaders.StashLoader. + generation := self.c.State().GetRepoGeneration() + + stashEntries := self.c.Git().Loaders.StashLoader. GetStashEntries(self.c.Modes().Filtering.GetPath()) + self.onUIThreadUnlessRepoChanged(generation, func() error { + self.c.Model().StashEntries = stashEntries + return nil + }) + self.refreshView(self.c.Contexts().Stash) }