taskwarrior-tui icon indicating copy to clipboard operation
taskwarrior-tui copied to clipboard

Wrong colors with Solarized Dark theme

Open desbma opened this issue 4 years ago • 39 comments

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.blocked and color.blocking seem to be ignored by taskwarrior-tui: background is changed in task not in taskwarrior-tui
  • one of my tasks (ANNOTATED BLOCKING PENDING READY TAGGED UNBLOCKED) appears white on grey in task and red on red in taskwarrior-tui, and thus is unreadable
  • 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

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

desbma avatar Jan 31 '21 13:01 desbma

What terminal color scheme are you using in alacritty?

kdheepak avatar Feb 01 '21 15:02 kdheepak

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

desbma avatar Feb 01 '21 20:02 desbma

Would you be able to share a screenshot of what it looks like in taskwarrior-tui and taskwarrior?

kdheepak avatar Feb 09 '21 03:02 kdheepak

Here you go, with my anonymized task list, side by side: Selection_2021-02-09_21-20-57

As you can see, the colors are quite different.

desbma avatar Feb 09 '21 20:02 desbma

Thanks! I'll look into this now.

kdheepak avatar Feb 09 '21 20:02 kdheepak

I believe this is resolved now.

Screen Shot 2021-02-11 at 12 07 09 AM

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!

kdheepak avatar Feb 11 '21 07:02 kdheepak

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

kdheepak avatar Feb 11 '21 07:02 kdheepak

Thanks, it's much better, but there are still many differences in the color rendering: Selection_2021-02-11_12-54-25

desbma avatar Feb 11 '21 12:02 desbma

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.

kdheepak avatar Feb 11 '21 16:02 kdheepak

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.

desbma avatar Feb 11 '21 16:02 desbma

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.

kdheepak avatar Feb 11 '21 16:02 kdheepak

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.

desbma avatar Feb 11 '21 20:02 desbma

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.

kdheepak avatar Feb 11 '21 20:02 kdheepak

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 : Selection_2021-02-12_01-14-48

desbma avatar Feb 12 '21 00:02 desbma

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.

kdheepak avatar Feb 12 '21 02:02 kdheepak

Using .taskrc from the test repository: Selection_2021-02-12_21-13-05

desbma avatar Feb 12 '21 20:02 desbma

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.

kdheepak avatar Feb 14 '21 07:02 kdheepak

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.

desbma avatar Feb 14 '21 13:02 desbma

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.

kdheepak avatar Feb 14 '21 15:02 kdheepak

You can now use this release: https://github.com/kdheepak/taskwarrior-tui/releases/tag/v0.10.0

kdheepak avatar Feb 14 '21 15:02 kdheepak

Unfortunately, your last commit broke a few colors, some tasks (overdue or soon due with tag and project) are not colored anymore.

desbma avatar Feb 14 '21 16:02 desbma

Oh dear. I really need to get tests up and running for all this. Thanks for letting me know, I'll look into it.

kdheepak avatar Feb 14 '21 16:02 kdheepak

Was it working fine before the most recent PR?

kdheepak avatar Feb 14 '21 16:02 kdheepak

It was working on b0faf77, yes.

desbma avatar Feb 14 '21 20:02 desbma

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...

desbma avatar Feb 14 '21 20:02 desbma

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.

kdheepak avatar Feb 14 '21 21:02 kdheepak

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:

Screen Shot 2021-02-14 at 7 03 26 PM

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.

kdheepak avatar Feb 15 '21 02:02 kdheepak

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 YEAR appear pink in taskwarrior-tui, red in taskwarrior (was working on commit b0faf77)
  • 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.

desbma avatar Feb 15 '21 11:02 desbma

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.

kdheepak avatar Feb 15 '21 18:02 kdheepak

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:

  1. Checkout the latest master
  2. Change this line to point to the task_id in question https://github.com/kdheepak/taskwarrior-tui/blob/4b92e6e9575ce622427876c9acb9e38eb616488d/src/app.rs#L1772
  3. Add dbg!(task.tags().unwrap()); to the next line.
  4. 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.

kdheepak avatar Feb 15 '21 19:02 kdheepak