From a2c4fad410dbdaa53b94b60c6c41be3a0211bd84 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 26 Aug 2024 08:21:17 +0200 Subject: [PATCH] Bugfix: properly set title of subcommits panel when refreshing This fixes two problems: - Set the title ref to the commit description (like SwitchToDiffFilesController.enter does), rather than just the hash - SetTitleRef only sets the title of the DynamicTitleBuilder, but doesn't set it on the view; this only happens in ContextMgr.Activate, so you'd have to switch to a different side panel and then back to see the new title. --- pkg/gui/controllers/helpers/refresh_helper.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/gui/controllers/helpers/refresh_helper.go b/pkg/gui/controllers/helpers/refresh_helper.go index c43c3ddab..c1caf4207 100644 --- a/pkg/gui/controllers/helpers/refresh_helper.go +++ b/pkg/gui/controllers/helpers/refresh_helper.go @@ -286,7 +286,8 @@ func (self *RefreshHelper) refreshCommitsAndCommitFiles() { commit := self.c.Contexts().LocalCommits.GetSelected() if commit != nil && commit.RefName() != "" { self.c.Contexts().CommitFiles.SetRef(commit) - self.c.Contexts().CommitFiles.SetTitleRef(commit.RefName()) + self.c.Contexts().CommitFiles.SetTitleRef(commit.Description()) + self.c.Contexts().CommitFiles.GetView().Title = self.c.Contexts().CommitFiles.Title() _ = self.refreshCommitFilesContext() } }