vonshednob / pter

Manage your todo.txt in a commandline user interface (TUI)

Home Page:https://vonshednob.cc/pter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search for only hidden and/or postponed tasks?

andrei-a-papou opened this issue · comments

I am playing around with the search feature/saved searches and generally speaking I love it!

However, I've read the docs and there doesn't seem to be a way to show only hidden tasks or only ticklers. Or perhaps I haven't thought of a way? Would appreciate a pointer then :)

Like others, I use hidden tasks to store projects/contexts and some other tech info. I can show hidden tasks via h:yes, but this also shows all other tasks. Since I have ~150 todos, finding the hidden ones is a challenge. Same goes for ticklers: sometimes I need to quickly look at all the postponed tasks and them only. Is it possible?

commented

Hm, interesting. I agree this is a case that I had not considered and that’s currently not at all supported.

Right now the search treats searches for h: and t: as logically "or" connected (almost all other search terms are "and" connected).

Short of requiring the user to actually provide the ands and ors manually (this would be terrible! it comes with ( grouping )), there has to be a new search term that expresses the "and" connection to the rest of the search for t: and h: fields.

Two minutes of thinking yielded only crappy solutions, like having a T: and H: search term that is the same as t: and h:, but are "stronger" in the sense that a task must have these. Any better idea is really appreciated!

I thought about H: and T: myself but frankly I wouldn't go there. I think it fosters further inconsistencies: special search keywords like due: are case-insensitive and introducing a case-sensitive one feels confusing.

How about this: make h: and t: searches consistently use AND between terms, like everywhere else. Then you could search for hidden:yes to only show the hidden tasks. Additionally, introduce the any value, so searching for hidden:any or h:any shows all tasks, including hidden ones.

Docs would need to be updated to reflect the change and I'll be happy to help with that. There are some typos and possible improvements in the docs that I could fix, I'll send a patch for you to consider, hopefully this weekend.

commented

That's a really good idea, I like it! Especially because it'll make things more consistent. I'll put it in the next bigger release.

I'll be happy to test it!

commented

The hidden:any search is already implemented (see here), t: is coming soon™.

Just tested, seems to work great, thank you! I can finally hunt down my hidden tasks :)

commented

Alright, these are in now with this commit

Hmm... t: and t:any work the same way. t:yes and t:no also function correctly. h:yes and h:no work fine too. But h: functions as h:yes, not as h:any.

commented

And that was documented and tested accordingly. Still inconsistent though 😅, so I fixed it in db298aa0

Thank you! Seems to work like a charm.