From 00cef799ce36268cd198f0ae8ed22e6922fb4203 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 21 Jul 2026 13:07:03 +0200 Subject: [PATCH] Show the inline status again when checking out a newly created remote branch Checking out a remote branch that has no local counterpart creates the local branch, refreshes, and then checks it out. The refresh exists so that CheckoutRef finds the new branch in the model and attaches an inline status to the branch item instead of showing a global waiting status. But since UI-thread refreshes stopped blocking, the checkout started before the refreshed branches had landed in the model, so the lookup failed and we always got the waiting status. Run the checkout from the refresh's Then, which is queued behind the model update. Co-Authored-By: Claude Fable 5 --- pkg/gui/controllers/helpers/refs_helper.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/gui/controllers/helpers/refs_helper.go b/pkg/gui/controllers/helpers/refs_helper.go index 675c332a0..0fcbeace3 100644 --- a/pkg/gui/controllers/helpers/refs_helper.go +++ b/pkg/gui/controllers/helpers/refs_helper.go @@ -157,12 +157,17 @@ func (self *RefsHelper) CheckoutRemoteBranch(fullBranchName string, localBranchN if err := self.c.Git().Branch.CreateWithUpstream(localBranchName, fullBranchName); err != nil { return err } - // Do a sync refresh to make sure the new branch is visible, - // so that we see an inline status when checking it out + // Refresh the branches and check out from Then, so that the + // new branch is already in the model when CheckoutRef looks + // it up; that's what makes it show an inline status on the + // branch rather than a global waiting status. self.c.Refresh(types.RefreshOptions{ Scope: []types.RefreshableView{types.BRANCHES}, + Then: func() error { + return checkout(localBranchName, true) + }, }) - return checkout(localBranchName, true) + return nil }, }, {