Bounce TAGS model updates onto the UI thread

refreshTags now captures the repo generation, loads the tags on the
worker, and writes Model.Tags in an onUIThreadUnlessRepoChanged bounce
rather than directly from the worker goroutine.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Stefan Haller 2026-07-03 14:21:31 +02:00
parent b203ec57ac
commit 21f1dc3366

View file

@ -666,12 +666,17 @@ func (self *RefreshHelper) refreshRebaseCommits() error {
}
func (self *RefreshHelper) refreshTags() error {
generation := self.c.State().GetRepoGeneration()
tags, err := self.c.Git().Loaders.TagLoader.GetTags()
if err != nil {
return err
}
self.c.Model().Tags = tags
self.onUIThreadUnlessRepoChanged(generation, func() error {
self.c.Model().Tags = tags
return nil
})
self.refreshView(self.c.Contexts().Tags)
return nil