From 160c4eb297d0c245531e3b8582905998e43393a3 Mon Sep 17 00:00:00 2001 From: Dhruv Thakur Date: Tue, 4 Jun 2024 22:07:18 +0200 Subject: [PATCH] style: add more colors for issue type --- internal/ui/initial.go | 2 +- internal/ui/styles.go | 22 +++++++++++++++++++--- internal/ui/types.go | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/internal/ui/initial.go b/internal/ui/initial.go index 046bf71..28e315f 100644 --- a/internal/ui/initial.go +++ b/internal/ui/initial.go @@ -48,7 +48,7 @@ func InitialModel(db *sql.DB, jiraClient *jira.Client, jql string, jiraTimeDelta showHelpIndicator: true, trackingInputs: trackingInputs, } - m.issueList.Title = "Issues (fetching ...)" + m.issueList.Title = "Issues (fetching...)" m.issueList.SetStatusBarItemName("issue", "issues") m.issueList.DisableQuitKeybindings() m.issueList.SetShowHelp(false) diff --git a/internal/ui/styles.go b/internal/ui/styles.go index 727611f..6b9c426 100644 --- a/internal/ui/styles.go +++ b/internal/ui/styles.go @@ -6,6 +6,7 @@ import ( ) const ( + defaultBackgroundColor = "#282828" trackingColor = "#fabd2f" activeIssueKeyColor = "#d3869b" activeIssueSummaryColor = "#8ec07c" @@ -21,7 +22,7 @@ var ( baseStyle = lipgloss.NewStyle(). PaddingLeft(1). PaddingRight(1). - Foreground(lipgloss.Color("#282828")) + Foreground(lipgloss.Color(defaultBackgroundColor)) helpMsgStyle = lipgloss.NewStyle(). PaddingLeft(1). @@ -75,7 +76,22 @@ var ( PaddingLeft(1). Foreground(lipgloss.Color(activeIssueSummaryColor)) - issueTypeColors = []string{"#928374", "#d3869b", "#fabd2f", "#8ec07c", "#83a598", "#b8bb26", "#fe8019"} + issueTypeColors = []string{ + "#d3869b", + "#b5e48c", + "#90e0ef", + "#ca7df9", + "#ada7ff", + "#bbd0ff", + "#48cae4", + "#8187dc", + "#ffb4a2", + "#b8bb26", + "#ffc6ff", + "#4895ef", + "#83a598", + "#fabd2f", + } getIssueTypeStyle = func(issueType string) lipgloss.Style { h := fnv.New32() @@ -85,7 +101,7 @@ var ( color := issueTypeColors[int(hash)%len(issueTypeColors)] return lipgloss.NewStyle(). PaddingLeft(1). - Foreground(lipgloss.Color("#282828")).Copy(). + Foreground(lipgloss.Color(defaultBackgroundColor)).Copy(). Bold(true). Align(lipgloss.Center). Width(18). diff --git a/internal/ui/types.go b/internal/ui/types.go index 2d6dd7b..5941f58 100644 --- a/internal/ui/types.go +++ b/internal/ui/types.go @@ -20,7 +20,7 @@ func (issue Issue) Title() string { if issue.trackingActive { trackingIndicator = "⏲ " } - return RightPadTrim(trackingIndicator+issue.summary, int(float64(listWidth)*0.8)) + return trackingIndicator + RightPadTrim(issue.summary, int(float64(listWidth)*0.8)) } func (issue Issue) Description() string { // TODO: The padding here is a bit of a mess; make it more readable