Skip to content

Commit

Permalink
fix(ui): repo URL width calculation. (#637)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dominicdoty authored Jan 22, 2025
1 parent b207cba commit eb15371
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ui/pages/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit eb15371

Please sign in to comment.