diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-03-17 17:57:16 +0100 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-03-17 18:07:22 +0100 |
commit | 34ceb0a73613751be5cfe8728b85caa2d96bedaf (patch) | |
tree | e9887042a25939ad6627b450c64464c8eb8bce5f | |
parent | de5e41f9c290fec59caaded634e1cec2b58aab4a (diff) |
Fix inline status removal when recording demosupdate-interactive-rebase-demo
-rw-r--r-- | pkg/gui/controllers/helpers/inline_status_helper.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/pkg/gui/controllers/helpers/inline_status_helper.go b/pkg/gui/controllers/helpers/inline_status_helper.go index 2476a57cf..7bc8cb456 100644 --- a/pkg/gui/controllers/helpers/inline_status_helper.go +++ b/pkg/gui/controllers/helpers/inline_status_helper.go @@ -131,12 +131,28 @@ func (self *InlineStatusHelper) stop(opts InlineStatusOpts) { info.stop <- struct{}{} delete(self.contextsWithInlineStatus, opts.ContextKey) } - } self.mutex.Unlock() self.c.State().ClearItemOperation(opts.Item) + + // When recording a demo we need to re-render the context again here to + // remove the inline status. In normal usage we don't want to do this + // because in the case of pushing a branch this would first reveal the ↑3↓7 + // status from before the push for a brief moment, to be replaced by a green + // checkmark a moment later when the async refresh is done. This looks + // jarring, so normally we rely on the async refresh to redraw with the + // status removed. (In some rare cases, where there's no refresh at all, we + // need to redraw manually in the controller; see TagsController.push() for + // an example.) + // + // In demos, however, we turn all async refreshes into sync ones, because + // this looks better in demos. In this case the refresh happens while the + // status is still set, so we need to render again after removing it. + if self.c.InDemo() { + self.renderContext(opts.ContextKey) + } } func (self *InlineStatusHelper) renderContext(contextKey types.ContextKey) { |