-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot match all projects or contexts using + or @ #616
Comments
I also tested this on Linux, and it seems to be an issue there as well. |
@jloow can you please share an example todo list, the exact search string you're applying and the expected result? |
Sure! Example todo.txt:
Search string: Expectation:
Result:
Search string: Expectation:
Result:
Search string: Expectation:
Results: None. Search string: Expectation:
Result: None. |
@jloow this does not solve the issue at hand – which I have to admin, I have not looked into yet – but since you are using the advanced search, you might be interested in a proof of concept, that has been implemented based off this feature request: #179 Feel free to test it out and share your feedback. |
@zerodat are you around these days? @jloow report is valid. The Wiki says But doing so has no effect. I also looked into the implementation but could not figure out exactly how it works. The easiest would probably be, if you could take a look at it. At some point, we should add some test cases, since this is easy to test. |
@ransome1, I'm still out here. 😄 I'll try to take a look at this issue. |
@ransome1 still taking a preliminary look and I will be busy for the next 8 or 10 hours, but later I will look deeper. The code for the query engine seems basically the same as it was back in the 1.2.9 version. I confirmed that it works properly in that version. What should be happening is that in the case of a query like "@" or "+" it will check the state of |
@ransome1, I confirmed that this worked in 1.2.9 and no longer works in 2.0.6. The problem seems to be that I tested for the list of projects or contexts to be empty by just testing todoObject.contexts (or projects) as a boolean value. That works if the contexts is null or undefined when there are none. However, in Javascript an empty list tests as "true" (which is the opposite of the behavior in Python, my usual language). It seems like the 2.0.6 version is setting contexts or projects to an empty list rather than undefined in the case where there are no contexts or projects. Maybe that's a change in behavior of the upstream todo parser. In any case, we need to change the code in FilterQuery.js to test the length of the list explicitly. I'm submitting a pull request that fixes the issue. |
projects/contexts list length, addresses #616
Great! I've been a bit busy but I'll be sure to check out the next release. |
@jloow @zerodat this has been released with 2.0.7: https://github.com/ransome1/sleek/releases/tag/v2.0.7 |
I've done some quick testing and this seems to have been fixed. The other updates work really well as well. How does this work - do I close the issue? |
Yes please :) |
Bug Report
App Version: 2.0.3
Platform: macOS
Installation Method: Direct Download
Bug Description:
Using advanced search, I cannot filter my todo for + or @ (which is supposed to match any todo with a project or context). It is possible to match other projects or context using +test or @test. Specifically I would like to filter for any todos without a project (i.e. "!+" or "not +") or without a context (i.e. "!@" or "not @")
Steps to Reproduce:
Expected Behavior:
To find todos that don't have any project or that don't have any context.
Actual Behavior:
When using NOT operators, no todos are displayed. Otherwise, all todos are displayed.
Additional Information:
The same bug is present in 2.0.2 installed through homebrew.
The text was updated successfully, but these errors were encountered: