vit-project / vit

VIT is a lightweight, fast, curses-based front end to Taskwarrior
MIT License
484 stars 51 forks source link

`tags` Filter Doesn't Behave as Expected #353

Closed ReedClanton closed 5 months ago

ReedClanton commented 5 months ago

Describe the bug There are 2 tasks. Both have the tag zz. One also has another tag aa. When f is pressed and tags:zz is entered, the resulting screen only shows the task with one tag and not the task with two tags.

To Reproduce

Expected behavior My expected behavior would be for any task with the selected tag, say epic, to be displayed, even when the task contains other tags.

Test case Download and run this test case that replicates this bug. Once the test case is run, launch vit and do the following:

VIT Version 2.2.0 installed via Home Manager with home.packages = [ pkgs.vit ]; on the system shown bellow: Screenshot from 2024-04-17 12-37-34

ReedClanton commented 5 months ago

After further testing, I've found that the behavior described above is dependent on what order the tags show up in the task. For example, the tag NixOS_Disko will show up before the tag epic, so filtering by epic won't work, but filtering by NixOS_Disko will. If you remove NixOS_Disko tag add add zzzzz as a tag, then now you will be able to filter by epic because zzzzz shows up after epic in the task text. zzzzz won't work for filtering.

To clarify, when I say a tag shows up before another, I'm referring how the task shows up when editing with the default text editor (via the e key). Specifically line 25 bellow: Screenshot from 2024-04-17 12-57-10

In the above example, filtering with tags:epic would cause the task to show up, but it wouldn't show up when tags:zzzzz was used as the filter.

thehunmonkgroup commented 5 months ago

Please generate a test case that reproduces the issue: https://github.com/vit-project/vit/blob/2.x/TEST-CASE.md

ReedClanton commented 5 months ago

Test case Download and run this test case that replicates this bug. Once the test case is run, launch vit and do the following:

* Verify that there are two tasks, and that they both have the `zz` tag.

* Press `f` to enter the filter prompt.

* Enter the bellow, then press `<enter>`:

  * `tags:zz`

* Verify that only the task with one tag, `zz`, is listed.

Created a test case and added it to the issue. It's quoted above.

thehunmonkgroup commented 5 months ago

This is a bug or limitation with Taskwarrior:

task next tags:zz
TASKRC override: /tmp/tmp.OVSKlXl5LP.vit/taskrc

ID Age  Tag Description Urg
 2 7min zz  b            0.8

Please file the issue with that project.

It's also possible you're applying an incorrect filter for your goals, you'll have to research the Taskwarrior docs for that.