vonshednob / pter

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

Add ability to group display #19

Closed gal064 closed 1 year ago

gal064 commented 1 year ago

Hi,

Love this tool!

I use the terminal version and it would be great to tasks for easier visualization. For example, grouping tasks by priority will be modify the display:

Priority A:
=================
(A) this is a test +today t:2022-10-22
(A) this is a test2

Priority B:
=================
(B) this is a test +today t:2022-10-22
(B) this is a test2

Would also be nice to group to columns to create some kind of a kanban.

vonshednob commented 1 year ago

Hi there! Glad you like pter so far!

Grouping is already something that you can accomplish by using the sort: directive in the search bar; in your case it would be sort:priority (and maybe sort:priority,due_in if the secondary sorting should take the due date into consideration).

The full search bar content can then, as usual, be saved as a named search, so it can be very easily loaded; even right from the start of pter with pter -l "tasks by priority" todo.txt (if you named your search "tasks by priority").

Check out the documentation (on github or actually up to date here) for more details.

Now, given this functionality, do you still want to have group headers per priority?

I like the idea of having a kanban-like view on a (or multiple) todo.txt files; but I'm afraid it's a bit out of scope for pter. Maybe a new tool for that type of display of the same content? What do you think?

Edit: whoops forgot to give direct links to named search and sorting.

gal064 commented 1 year ago

Hi, First, I love pter and I think it's a really great tool!

For grouping, sorting is nice but I think visual separation and clear headlines for each group can really help skim the info.

With that said I found a way to achieve this. I simply created a terminal session split to three panes, and on each I ran pter with different filters

On a separate note, I'm planning to fork pter and add some minor functionality to satisfy my day-to-day use. For example:

I will not add everything at once. I'll use pter as-is, and modify as I go if needed. I suspect that a lot I can achieve with a shell script modifying the todo.txt directly upon file save.

But if I do make changes to pter itself, I'll make sure to create a PR and leave the choice to you if you'd like to merge it, or prefer to keep the functionality scoped.

It might be an interesting idea to create a minimal plugin API. For example, it can give you an option to specify a function to be run on certain events (e.g. on file save). This function will receive the list of tasks and selected task, modify and return the tasks back.

gal064 commented 1 year ago

@vonshednob Also another question: What are the rules for when pter re-reads the todo.txt file? As I said, I'd like to extend the functionality with shell scripts that read the todo.txt and modify it.

Can this clash with pter? or does pter reads the file on every change?

vonshednob commented 1 year ago

Pter will reload the content if the file has changed on disk (and re-apply filters; the latter will also happen at the local midnight).

Conflict resolution (which is a bit of a euphemism in this context) happens at each individual line of the todo.txt file in question; conflicts will only occur if you edit a task(!) that is being modified outside of pter at the same time.

So in general you can happily modify the todo.txt file that pter is working with outside of pter. There should be no conflict (and I'm happy to fix problems if you find and report any!) :)

vonshednob commented 1 year ago

Completely missed to respond to your earlier message, sorry: by all means, you are most welcome to fork a more feature-rich version!

If/when I find the time I'll try to refactor it a bit more and/or add information about the structure of pter's code. It's really not great at the moment, I'm afraid. It grew over a long time, was writte by a single developer and it shows :grimacing:

Please feel free to contact me for any questions about the code and purpose of some of the parts!

Of course, PRs are welcome, too though :grin:

gal064 commented 1 year ago

Great! I get your point about code but in general I think it was well structured and straight forward.

I'll close this ticket. One last request is that I believe the GitHub repository is behind the latest version (3.2.0 vs 3.3.1). I can take the code from pip so no problem but you might want to push the new version

vonshednob commented 1 year ago

Very kind of you to pretend the code is well structured :sweat_smile:

Unfortunately I started with this project on github and it's really hard to leave a fenced garden; right now I'm trying to slowly pull out of github and the first step was to no longer push updated to this project here.

I'm contemplating using codeberg as the publicly available repository and bug tracker, but haven't uploaded there yet.

vonshednob commented 1 year ago

@gal064 alright, the current version 3.3.1 is on codeberg