From 7ea4a6e5da48617cf5f671159518db548a86f122 Mon Sep 17 00:00:00 2001 From: Dolev Hadar Date: Sat, 3 Aug 2024 22:07:30 +0300 Subject: [PATCH] rename to compact --- config/parser.go | 4 ++-- ui/components/pr/pr.go | 4 ++-- ui/components/prssection/prssection.go | 2 +- ui/components/table/table.go | 4 ++-- ui/components/utils.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/parser.go b/config/parser.go index 3e1d1fac..2828c401 100644 --- a/config/parser.go +++ b/config/parser.go @@ -163,7 +163,7 @@ type ColorThemeConfig struct { type TableUIThemeConfig struct { ShowSeparator bool `yaml:"showSeparator" default:"true"` - Multiline bool `yaml:"multiline" default:"true"` + Compact bool `yaml:"compact" default:"false"` } type UIThemeConfig struct { @@ -285,7 +285,7 @@ func (parser ConfigParser) getDefaultConfig() Config { SectionsShowCount: true, Table: TableUIThemeConfig{ ShowSeparator: true, - Multiline: true, + Compact: false, }, }, }, diff --git a/ui/components/pr/pr.go b/ui/components/pr/pr.go index 6f901fa6..f2a3a0e9 100644 --- a/ui/components/pr/pr.go +++ b/ui/components/pr/pr.go @@ -198,7 +198,7 @@ func (pr *PullRequest) renderAssignees() string { func (pr *PullRequest) renderRepoName() string { repoName := "" - if pr.Ctx.Config.Theme.Ui.Table.Multiline { + if !pr.Ctx.Config.Theme.Ui.Table.Compact { repoName = pr.Data.Repository.NameWithOwner } else { repoName = pr.Data.HeadRepository.Name @@ -241,7 +241,7 @@ func (pr *PullRequest) RenderState() string { } func (pr *PullRequest) ToTableRow(isSelected bool) table.Row { - if pr.Ctx.Config.Theme.Ui.Table.Multiline { + if !pr.Ctx.Config.Theme.Ui.Table.Compact { return table.Row{ pr.renderState(), pr.renderExtendedTitle(isSelected), diff --git a/ui/components/prssection/prssection.go b/ui/components/prssection/prssection.go index 8c43e313..ebf6c9ac 100644 --- a/ui/components/prssection/prssection.go +++ b/ui/components/prssection/prssection.go @@ -211,7 +211,7 @@ func GetSectionColumns( ciLayout := config.MergeColumnConfigs(dLayout.Ci, sLayout.Ci) linesLayout := config.MergeColumnConfigs(dLayout.Lines, sLayout.Lines) - if ctx.Config.Theme.Ui.Table.Multiline { + if !ctx.Config.Theme.Ui.Table.Compact { return []table.Column{ { Title: "", diff --git a/ui/components/table/table.go b/ui/components/table/table.go index 60bf50c3..079296ee 100644 --- a/ui/components/table/table.go +++ b/ui/components/table/table.go @@ -47,7 +47,7 @@ func NewModel( isLoading bool, ) Model { itemHeight := 1 - if ctx.Config.Theme.Ui.Table.Multiline { + if !ctx.Config.Theme.Ui.Table.Compact { itemHeight += 1 } if ctx.Config.Theme.Ui.Table.ShowSeparator { @@ -278,7 +278,7 @@ func (m *Model) renderRow(rowId int, headerColumns []string) string { colWidth := lipgloss.Width(headerColumns[headerColId]) colHeight := 1 - if m.ctx.Config.Theme.Ui.Table.Multiline { + if !m.ctx.Config.Theme.Ui.Table.Compact { colHeight = 2 } col := m.Rows[rowId][i] diff --git a/ui/components/utils.go b/ui/components/utils.go index 3ab3af45..16b0bd50 100644 --- a/ui/components/utils.go +++ b/ui/components/utils.go @@ -36,7 +36,7 @@ func RenderIssueTitle( number int, ) string { prNumber := "" - if !ctx.Config.Theme.Ui.Table.Multiline { + if ctx.Config.Theme.Ui.Table.Compact { prNumber = fmt.Sprintf("#%d ", number) var prNumberFg lipgloss.AdaptiveColor if state != "OPEN" {