taskwarrior-tui
                                
                                 taskwarrior-tui copied to clipboard
                                
                                    taskwarrior-tui copied to clipboard
                            
                            
                            
                        Wrong colors with Solarized Dark theme
I am using the Solarized Dark theme included with taskwarrior (include /usr/share/doc/task/rc/solarized-dark-256.theme in my .taskrc).
There are several differences in the color output between task and taskwarrior-tui:
- color.blockedand- color.blockingseem to be ignored by- taskwarrior-tui: background is changed in- tasknot in- taskwarrior-tui
- one of my tasks (ANNOTATED BLOCKING PENDING READY TAGGED UNBLOCKED) appears white on grey intaskand red on red intaskwarrior-tui, and thus is unreadable
- all tasks below priority 8 (I'm not sure that is the differentiating factor) appear red/orange in taskwarrior-tuiand grey/blue intask
If you can provide a dummy task list for testing, I'd be happy to post screenshots or help reproduce, but obviously I don't want to publish my task list.
Environment:
- Operating System: Arch Linux
- Installation: https://aur.archlinux.org/packages/taskwarrior-tui/
- taskwarrior-tui version: 0.9.6
- terminal : alacritty 0.7.1
What terminal color scheme are you using in alacritty?
Here is my full config file: alacritty.txt
The part about colors:
colors:
  # Default colors
  primary:
    background: '0x002b36' # base03
    foreground: '0x839496' # base0
  # Cursor colors
  cursor:
    text:   '0x002b36' # base03
    cursor: '0x839496' # base0
  # Normal colors
  normal:
    black:   '0x073642' # base02
    red:     '0xdc322f' # red
    green:   '0x859900' # green
    yellow:  '0xb58900' # yellow
    blue:    '0x268bd2' # blue
    magenta: '0xd33682' # magenta
    cyan:    '0x2aa198' # cyan
    white:   '0xeee8d5' # base2
  # Bright colors
  bright:
    black:   '0x002b36' # base03
    red:     '0xcb4b16' # orange
    green:   '0x586e75' # base01
    yellow:  '0x657b83' # base00
    blue:    '0x839496' # base0
    magenta: '0x6c71c4' # violet
    cyan:    '0x93a1a1' # base1
    white:   '0xfdf6e3' # base3
Would you be able to share a screenshot of what it looks like in taskwarrior-tui and taskwarrior?
Here you go, with my anonymized task list, side by side:

As you can see, the colors are quite different.
Thanks! I'll look into this now.
I believe this is resolved now.
 
all tasks below priority 8 (I'm not sure that is the differentiating factor) appear red/orange in taskwarrior-tui and grey/blue in task
What do you mean by priority 8? Do you mean urgency 8? I think this is also resolved. If you can test it that would be great!
Thanks for opening this issue! I'm surprised I never ran into this, maybe something else is broken in my configuration 😅. This bug fix is available in this release: https://github.com/kdheepak/taskwarrior-tui/releases/tag/v0.9.15
Thanks, it's much better, but there are still many differences in the color rendering:

Can you tell me why those tasks are colored blue? Or if you can export your fake task list and share here and if I'm able to replicate it on my computer I'll be able to resolve this.
The blue tasks are the recurring ones (the parents, not the periodically generated instances) : https://github.com/GothenburgBitFactory/taskwarrior/blob/9017cd6e530e4dbb0aaabd66dd11f6e7e0b56aa4/doc/rc/solarized-dark-256.theme#L60
Sorry I can't export my task list, the screens above have been generated with my real task list, anonymized with a script to change tasks/projects/tags names, but an export includes the whole history.
I think however that generating a fake task list, with tasks in each possible state, and adding in in the repository could be of value for testing.
No worries, I understand about not exporting your task list.
I have a fake task list here: https://github.com/kdheepak/taskwarrior-testdata. If you'd like to submit a PR there that'd be great! Or feel free to share an version here, I can update it over there. I'll update the README.md to highlight it as well, so people can use that to submit a bug issue.
Recurring tasks now appear in blue, but I still have many tasks for example with virtual tags PENDING READY TAGGED UNBLOCKED YEAR that appear red in taskwarrior-tui and grey in task.
Yup, sorry, I meant to reopen this. I know the previous PR fixed just recurring colors.
If you can send me a fake task list that'll be ideal, and if I can replicate it I can make more progress on this. Right now I don't know what I'm missing and working through the taskwarrior codebase has not been fruitful.
Unfortunately, I think taskwarrior itself is not doing what it says it should be doing. See https://github.com/GothenburgBitFactory/taskwarrior/issues/2334. So there might be some cases where the colors differ.
Using test data from https://github.com/kdheepak/taskwarrior-testdata I managed to produce different colors by adding a due date for task 9, and making it depend on task 14 :

Hmm. Are you using the .taskrc that is in that repository? If not, can you share your .taskrc? I'm not getting that behavior with the .taskrc and .task folder in that repository.
Using .taskrc from the test repository:

Can you try the latest master again? I think I fixed this issue, but I have a feeling there's more corner cases with respect to the colors matching that of taskwarrior. I'll leave this issue open for now.
The colors are now similar to taskwarrior for almost every task in my list. :+1:
The only difference I see is a task (PENDING PRIORITY READY UDA UNBLOCKED with priority L) that appears green in the taskwarrior list, but I think this is a bug of taskwarrior because other tasks in the same state do not.
This should be resolved now, in a nice round number PR no less :) I'll make a new release. Feel free to open a new issue if any color issues occur again, I'm sure there is stuff I've missed.
You can now use this release: https://github.com/kdheepak/taskwarrior-tui/releases/tag/v0.10.0
Unfortunately, your last commit broke a few colors, some tasks (overdue or soon due with tag and project) are not colored anymore.
Oh dear. I really need to get tests up and running for all this. Thanks for letting me know, I'll look into it.
Was it working fine before the most recent PR?
It was working on b0faf77, yes.
I really need to get tests up and running for all this.
The best thing to do would be to add in the test repo a task in every possible combination of: tagged or not, has project or not, overdue or not, has due date or not, has wait date or not, blocked or not, blocking or not, recurring or not + every priority, and then have the tests checking the output for each task. But yeah that is is tedious work...
Yeah, I've started putting together tests. But it is good to know that it worked before the most recent PR. I might be able to reproduce it faster.
I put together a shorter list of tests:
uda.priority.values=U,H,M,L
urgency.uda.priority.U.coefficient=15.0
color.uda.priority.U=red
color.uda.priority.L=blue
color.uda.priority.M=yellow
color.uda.priority.H=green
color.project.wth=green on black
color.tagged=red on blue
I named a project wth and tagged other tasks. I'm fairly confident about this working as intended now. This is the screenshot of what taskwarrior-tui looks like and what taskwarrior looks like:

There might still be a couple of corner cases with due tasks though. Those will not be with the coloring but with figuring out the correct internal tags for the tasks that taskwarrior uses, which in turn may affect the coloring. I'll have to iron those out later.
Thanks for your work and patience. :+1:
Still some color differences :
- two tasks with DUE DUETODAY MONTH OVERDUE PENDING QUARTER READY TAGGED TODAY UNBLOCKED WEEK YEARappear pink intaskwarrior-tui, red intaskwarrior(was working on commitb0faf77)
- one pending task (PENDING PRIORITY READY UDA UNBLOCKED) appears blue intaskwarrior-tui, grey in taskwarrior. I have no idea why though. It may be a taskwarrior bug.
I think the reason OVERDUE DUETODAY tasks are being displayed incorrectly is that in taskwarrior the logic is not implemented the way I expect it to be implemented. I've opened an issue related to this and posted a comment for clarification.
https://github.com/GothenburgBitFactory/taskwarrior/issues/2334#issuecomment-779389283
If they suggest that it is to be implemented the way it is done in taskwarrior, I'll be able to special case that to conform to the taskwarrior spec. If it is a bug and they agree with my assessment, I'll submit a PR to taskwarrior, and leave this as is.
one pending task (PENDING PRIORITY READY UDA UNBLOCKED) appears blue in taskwarrior-tui, grey in taskwarrior. I have no idea why though. It may be a taskwarrior bug.
I'm not able to replicate this though.
If you are able to compile from source, can you try the following:
- Checkout the latest master
- Change this line to point to the task_idin question https://github.com/kdheepak/taskwarrior-tui/blob/4b92e6e9575ce622427876c9acb9e38eb616488d/src/app.rs#L1772
- Add dbg!(task.tags().unwrap());to the next line.
- Run the following and share the output here.
cargo test --package taskwarrior-tui --bin taskwarrior-tui -- app::tests::test_task_style --exact --nocapture
I mainly want to see the output of task.tags() so that I can figure out if there's a bug with the generation of the internal tags. You have some taskwarrior tags here it'll show up, feel free to anonymize those before sharing.