From 9ea2ff8f412551be84e7b5bf5b3bc8fd4ba2d262 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 26 Jan 2025 15:16:12 +0100 Subject: [PATCH 1/2] Remove call to Render() As far as I can tell, this is not needed. The call to Refresh at the end of backgroundFetch takes care of redrawing after refreshing. The call was added in 2fc1498517, that's a long time ago, and we had multiple big refactorings since then. Maybe it was needed back then but no longer is today. --- pkg/gui/background.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/gui/background.go b/pkg/gui/background.go index c9f0e3d40f9..5da6d697a5d 100644 --- a/pkg/gui/background.go +++ b/pkg/gui/background.go @@ -76,9 +76,7 @@ func (self *BackgroundRoutineMgr) startBackgroundFetch() { self.gui.waitForIntro.Wait() fetch := func() error { - err := self.backgroundFetch() - self.gui.c.Render() - return err + return self.backgroundFetch() } // We want an immediate fetch at startup, and since goEvery starts by From 542478546d712b6582b31bd5c23495801bcd0017 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 26 Jan 2025 14:00:20 +0100 Subject: [PATCH 2/2] Show background fetch status in bottom line This shows a status as if the user had typed 'f' manually in the files panel. I want this particularly for the first fetch after startup. There are often situations where I need to wait for this first background fetch to be done before I can do what I want (e.g. rebase my branch onto its base branch, or check out a branch that my coworker has told me they just pushed), but currently it's hard to tell when that is. For every subsequent background fetch after the first one it is less important, but it hopefully doesn't hurt, and it might be nice to have some visual indication that background activity is happening. --- pkg/gui/background.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/gui/background.go b/pkg/gui/background.go index 5da6d697a5d..1be8d2e21e7 100644 --- a/pkg/gui/background.go +++ b/pkg/gui/background.go @@ -76,7 +76,9 @@ func (self *BackgroundRoutineMgr) startBackgroundFetch() { self.gui.waitForIntro.Wait() fetch := func() error { - return self.backgroundFetch() + return self.gui.PopupHandler.WithWaitingStatusSync(self.gui.Tr.FetchingStatus, func() error { + return self.backgroundFetch() + }) } // We want an immediate fetch at startup, and since goEvery starts by