Skip to content

Commit

Permalink
fix: new layout - hide base if hidden (#456)
Browse files Browse the repository at this point in the history
* fix: new layout - hide base if hidden

* fix: invert if branch
  • Loading branch information
dlvhdr authored Sep 25, 2024
1 parent 93bd7bc commit 8708484
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ui/components/pr/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,13 @@ func (pr *PullRequest) renderExtendedTitle(isSelected bool) string {
baseStyle = baseStyle.Foreground(pr.Ctx.Theme.SecondaryText).Background(pr.Ctx.Theme.SelectedBackground)
}

repoName := baseStyle.Render(lipgloss.JoinHorizontal(lipgloss.Top, pr.Data.Repository.NameWithOwner, fmt.Sprintf(" #%d", pr.Data.Number)))
author := baseStyle.Render(fmt.Sprintf("@%s", pr.Data.Author.Login))
branch := baseStyle.Render(pr.Data.HeadRefName)
top := lipgloss.JoinHorizontal(lipgloss.Top, repoName, baseStyle.Render(" · "), branch, baseStyle.Render(" · "), author)
top := lipgloss.JoinHorizontal(lipgloss.Top, pr.Data.Repository.NameWithOwner, fmt.Sprintf(" #%d by %s", pr.Data.Number, author))
branchHidden := pr.Ctx.Config.Defaults.Layout.Prs.Base.Hidden
if branchHidden == nil || !*branchHidden {
branch := baseStyle.Render(pr.Data.HeadRefName)
top = lipgloss.JoinHorizontal(lipgloss.Top, top, baseStyle.Render(" · "), branch)
}
title := pr.Data.Title
var titleColumn table.Column
for _, column := range pr.Columns {
Expand Down

0 comments on commit 8708484

Please sign in to comment.