Skip to content

feat: implement alternating line colors a la taskwarrior#702

Open
jakebox wants to merge 1 commit intokdheepak:mainfrom
jakebox:jb/alternating-colors
Open

feat: implement alternating line colors a la taskwarrior#702
jakebox wants to merge 1 commit intokdheepak:mainfrom
jakebox:jb/alternating-colors

Conversation

@jakebox
Copy link
Copy Markdown
Contributor

@jakebox jakebox commented Mar 28, 2026

This tweak applies color.alternate on alternating lines like taskwarrior does.

I do wonder if there was a reason this was not implemented previously. Should this be separately configurable from taskwarrior? I figure if users want to configure it they can, however it will apply to both the TUI and regular.

Applies `color.alternate` on alternating lines like taskwarrior does.
@jakebox jakebox force-pushed the jb/alternating-colors branch from 5195d45 to 06b2658 Compare March 28, 2026 18:12
let style = self.style_for_task(&self.tasks[i]);
// Apply alternating row color as base style for odd rows
let base_style = if i % 2 == 1 {
self.config.color.get("color.alternate").copied().unwrap_or_default()
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.

Can we get the self.config.color.get("color.alternate") outside of the for loop?

@kdheepak
Copy link
Copy Markdown
Owner

Thank you for the PR!

I think early on I didn't do this because mixing colors for tagged lines or selected line with alternate colors didn't look good. But I think now, it would be nice to have the feature gated behind a taskwarrior-tui option to disable it (so enabled by default).

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.

2 participants