VladimirMarkelov / ttdl

TTDL - Terminal Todo List Manager
MIT License
202 stars 17 forks source link

Due date of a task appears twice, in subject and under Due column. #75

Closed debajyoti1990 closed 1 year ago

debajyoti1990 commented 1 year ago

Reproducible in Windows 10. Although it is not a major issue, looks somewhat weird. Could not find anything in ttdl.toml file related to this.

debajyoti1990 commented 1 year ago

Below is one sample output in my terminal.

image

VladimirMarkelov commented 1 year ago

It is reproducible on any OS as it was designed this way from the beginning :smile: But I am not saying that it must remain this way forever.

Let me explain why I chose this way. In the very beginning I used a thirdparty library to parse and process tasks in todo.txt format. Its feature was: remove all tags while parsing and add some of them to the end of the task. If I am not mistaken, only standard tags like "rec", "thr", and "due" were hidden. First I noticed that ttdl list did not displays my tasks in the same way I composed them. The I found that tag processing code. And finally I realized that I do not like that way because of 2 main troubles:

Hence, we have to agree on some stuff before starting the implementation. Here are my thoughts:

  1. In any case there must be a way to display subjects as-is. At first sight, it seems that a good solution is to hide some (more about it in the next bullet points) tags and show the entire subject with a command-line option(not sure about its name yet). In addition, it makes sense to introduce a config option like show_subject with possible values at least full(or as-is) and auto (it can be more values depending on many things)
  2. Do not forget that you can hide any column. e.g list --fields=pri. What about due in this case? My idea is to hide only things that are already displayed in another columns. So, when displaying all the fields, due and thr would be removed from the subject when printing. I do not think we need an option for this: auto can be good enough.
  3. There is a way to display any tag in its own column by using custom columns feature. I guess TTDL should hide all custom tags(if columns are displayed) in subject as well.
  4. Let's looks at the issue #77. After it is implemented, another question will arise: do we want to hide project/context in subject column to avoid duplication? First thought: yes, it should. Second thought: what if project/context is a part of meaningful message and removing it ruins the message?

What do you think?

debajyoti1990 commented 1 year ago

Your points are very much valid, I get the idea. Actually the .gif in github homepage was showing due only once, that's why I thought there might be something I am missing or something broke in latest release, although I vaguely remember I saw this in last release also.

I think hiding due column is a good option. I have not tried it yet, will try. I was thinking maybe it was possible to strip all tags like due, context or project from subject and show the remaining.

VladimirMarkelov commented 1 year ago

I see. I suspect that I took the screenshot before I replaced the thirdparty todo.txt library with my own parser 😄

Another case when seeing all tags in the subject is useful: when listing with --human. In this case, column Due displays often approximate value like 2w or 5m, but subject displays the exact due date:

 # D P Created  Due          Subject
-------------------------------------
44     2w ago   in 5m        doctor checkup due:2023-10-11

Though, it may be not frequent case.

Anyway, let's sum everything up. As we agreed at some points, my current roadmap is:

If needed, we can add more values to the list for more fine-grained control. But I doubt we do it any time soon.