Skip to content

Add option for alternating row background colors#352

Open
oscarkcau wants to merge 2 commits intoachannarasappa:masterfrom
oscarkcau:master
Open

Add option for alternating row background colors#352
oscarkcau wants to merge 2 commits intoachannarasappa:masterfrom
oscarkcau:master

Conversation

@oscarkcau
Copy link
Copy Markdown

This pull request introduces a new feature to display alternating row background colors in the watchlist UI, improving visual clarity. It adds a new CLI/config option, updates configuration structs, and implements the logic to apply background colors to alternate rows. Supporting utility functions are also included for color resolution and terminal rendering.
Screenshot from 2026-04-16 07-18-35

Feature: Alternating Row Backgrounds

  • Added a new CLI flag --show-row-background and corresponding config option ShowAlternateRowBackground to enable alternating row backgrounds in the watchlist UI. [1] [2] [3] [4]
  • Extended the color scheme configuration to support a background-row color, and added logic to resolve and apply this color for alternate rows. [1] [2]

UI Implementation

  • Updated the watchlist and row components to pass and handle the alternate row background color, applying it to every other row when enabled. [1] [2] [3] [4] [5]

Utilities

  • Added utility functions in style.go to resolve the alternate row background color and apply background color codes to terminal strings, ensuring consistent background coloring even across styled text segments. [1] [2]

Copilot AI and others added 2 commits April 15, 2026 22:14
Agent-Logs-Url: https://github.com/oscarkcau/ticker/sessions/6488913d-c2dd-464a-a82f-a497f35a3077

Co-authored-by: oscarkcau <1132514+oscarkcau@users.noreply.github.com>
…r-feature

feat: add alternating row background color option
Comment thread internal/ui/util/style.go
// ApplyBackground applies a background color to a rendered terminal string,
// including re-applying after any terminal reset sequences so that fill spaces
// between styled chunks also receive the background color.
func ApplyBackground(text string, bgHex string) string {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be replaced with lipgloss? Something like this: lipgloss.NewStyle().Background(lipgloss.Color(bgHex)).Render(rowContent)

Comment thread internal/ui/util/style.go

// GetRowAlternateBackground returns the resolved background color hex for alternate rows
func GetRowAlternateBackground(colorScheme c.ConfigColorScheme) string {
return getColorOrDefault(colorScheme.BackgroundRow, "#303030")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be changed to #1c1c1c so that there is still contrast with the tag color?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants