From eb15371689b00514b16f952c6eb3a5da8d36acbb Mon Sep 17 00:00:00 2001 From: dominicdoty Date: Wed, 22 Jan 2025 06:22:20 -0700 Subject: [PATCH] fix(ui): repo URL width calculation. (#637) Previous code only used description width to calculate remaining space. At that point the desc has already been merged into the header so the header can be used to calculate remaining width correctly. --- pkg/ui/pages/repo/repo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/ui/pages/repo/repo.go b/pkg/ui/pages/repo/repo.go index 1f3263287..adeaeed35 100644 --- a/pkg/ui/pages/repo/repo.go +++ b/pkg/ui/pages/repo/repo.go @@ -340,13 +340,13 @@ func (r *Repo) headerView() string { ) } urlStyle := r.common.Styles.URLStyle. - Width(r.common.Width - lipgloss.Width(desc) - 1). + Width(r.common.Width - lipgloss.Width(header) - 1). Align(lipgloss.Right) var url string if cfg := r.common.Config(); cfg != nil { url = r.common.CloneCmd(cfg.SSH.PublicURL, r.selectedRepo.Name()) } - url = common.TruncateString(url, r.common.Width-lipgloss.Width(desc)-1) + url = common.TruncateString(url, r.common.Width-lipgloss.Width(header)-1) url = r.common.Zone.Mark( fmt.Sprintf("%s-url", r.selectedRepo.Name()), urlStyle.Render(url),