From 5166c27ccfc804ad23c49166bc2c2a1711196f1f Mon Sep 17 00:00:00 2001 From: Amolith Date: Sat, 18 Oct 2025 12:22:26 -0600 Subject: [PATCH] feat(web/tree): show path and ref in page title Display 'repo-name/path at ref | Project name' format in tree view titles for better browser tab/history identification. Shows shortened commit hash when viewing specific commits. Implements: bug-45e898a Co-authored-by: Crush --- pkg/web/webui_tree.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/web/webui_tree.go b/pkg/web/webui_tree.go index edccf39439c77a260492c5ccf621d9d444124df4..93297a20e3d6ea990b71851f5891a79a17c53e56 100644 --- a/pkg/web/webui_tree.go +++ b/pkg/web/webui_tree.go @@ -77,12 +77,24 @@ func repoTree(w http.ResponseWriter, r *http.Request) { repoDisplayName = repo.Name() } + title := repo.Name() + if path != "." { + title += "/" + path + } + title += " at " + if isCommitHash && len(ref) > 7 { + title += ref[:7] + } else { + title += ref + } + title += " | " + repoDisplayName + data := TreeData{ RepoBaseData: RepoBaseData{ BaseData: BaseData{ ServerName: cfg.Name, ActiveTab: "tree", - Title: "Files | " + repoDisplayName, + Title: title, }, Repo: repo, DefaultBranch: defaultBranch,