vonshednob / pter

Manage your todo.txt in a commandline user interface (TUI)
https://vonshednob.cc/pter/
MIT License
104 stars 6 forks source link

table view #69

Open korbal opened 4 days ago

korbal commented 4 days ago

Hey, I just wanted to thank you for this awesome tool, this is exactly what I needed. So very happy with it and it's been working stable for weeks now. :)

I only have one suggestion: to make it easier to parse a large list, maybe include a config option to use a table layout? (something like what otodo does: https://github.com/onovy/otodo )

Anyway, thank you for the tool! :)

vonshednob commented 3 days ago

Hi there! Thank you for the kind words; I'm really glad to hear that pter is serving you well :)

I had not considered a table-like view before, it's a good idea.

All the better yet, it's actually already possible! Maybe I should provide example configurations to cover these kinds of cases.

In order to get a table-like view, you have to mess with the task-format configuration option in the [General] section of the configuration file (usually expected at $HOME/.config/pter/pter.conf), like this:

[General]
task-format = {selection: >} {nr: >} {done: >} {tracking: >} {due: >} {pri: >} {description}

What this does is, that every field (except description) is right-aligned. In order to do any sort of alignment, pter will have to leave enough room per field, resulting in a table-like view. Instead of the spaces you could also use the vertical bar UTF-8 characters to create columns like this:

[General]
task-format = {selection: >} │ {nr: >} │ {done: >} │ {tracking: >} │ {due: >} │ {pri: >} │ {description}

(note: these are not the pipe symbol, | but box-drawing characters)

image

Have a look at the Task Format section of the help or the pter.config man page for more details on the task-format option and its properties.

Let me know if you think this is enough to cover this idea or whether you feel that the columns should receive headers!

Have fun!

korbal commented 2 days ago

Thanks a lot @vonshednob !!

I've played around with it and got most of the fields sorted but I guess

Currently, the task-format option doesn't seem to allow for separating different components of a task into distinct columns.

What I'd like to achieve:

  1. Display tasks in a table-like format with separate columns for:

    • Task number
    • Priority
    • Description (main task text)
    • Project(s)
    • Context(s)
    • Note
    • Time spent
    • Pomodoros
  2. The ability to customize the width and alignment of each column.

  3. Optionally, the ability to specify which components should be extracted from the description into their own columns.

Current behavior: When trying to separate components using the task-format option, all elements still appear in a single line without clear separation. For example:

task-format = {nr: >2} {pri: <2} {description:50.50} {project:15.15} {context:15.15} {note:20.20} {spent}

This doesn't separate the elements of the description as intended. I tried regexes as well, but that didn't work either.

Desired behavior: A table-like display where each component of the task is in its own column, clearly separated from others. Something like:

image

Is this kind of display possible with the current pter architecture? Again, thank you! :)

vonshednob commented 2 days ago

Sounds good to me! Especially the various different columns. But the description column would still contain all project and context tags; the context and project columns would merely repeat the context(s) and project(s) again. Right?

What's the pomodoros column? How's that reflected in a task?

I think the biggest challenge will be the addition of the column width hints; so that might take a bit longer.

korbal commented 1 day ago

Sounds good to me! Especially the various different columns. But the description column would still contain all project and context tags; the context and project columns would merely repeat the context(s) and project(s) again. Right?

  • That sounds redundant I think. The extra columns would just make it a bit more structured (and adhering to the simplicity credo of todo.txt).

Ah, sorry, I though Pter supported pm: (pomodoros), I've been using pm:1, pm:2 etc anyway :) (like Sleek, pm:1 is recognized as a task needing 1 pomodoro to complete) image

Is there any way I can help? This is awesome. :)

vonshednob commented 1 day ago

I had not heard of tomatos in the context of task estimation, but I guess it makes a lot of sense for people that go with pomodoro.

Other people seem to use estimate: in a similar fashion. My proposal is to support both, pm: and estimate: in tasks as well as columns. There would be a configuration option how long a tomato is (default 25m) and the estimate column would sum up both estimate: tags and pm: tags?

Is there any way I can help?

Usually I develop using my personal gitolite repo, but I don’t mind having a development branch on a public repo, too. I just don’t push my code to github anymore, but you can clone the repo from codeberg without having to login. Testing the code as it’s being written is a huge help! If you want to contribute code or documentation (or maybe a sample configuration file for the table-view configuration) it’s highly appreciate, too! Pull request on codeberg, patches via email, or links to patches on here --- whichever floats your boat :grin:

Thanks a lot for offering to help!

Edit: on codeberg use the dev/tableview branch to preview the current development state!