Skip to content

Commit

Permalink
style: add more colors for issue type
Browse files Browse the repository at this point in the history
  • Loading branch information
dhth committed Jun 4, 2024
1 parent 1bdd193 commit 160c4eb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/ui/initial.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 19 additions & 3 deletions internal/ui/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
)

const (
defaultBackgroundColor = "#282828"
trackingColor = "#fabd2f"
activeIssueKeyColor = "#d3869b"
activeIssueSummaryColor = "#8ec07c"
Expand All @@ -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).
Expand Down Expand Up @@ -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()
Expand All @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 160c4eb

Please sign in to comment.