fix(ui): repo URL width calculation. (#637)
dominicdoty
created 9 months ago
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.
Change summary
pkg/ui/pages/repo/repo.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Detailed changes
@@ -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),