Git Product home page Git Product logo

Comments (13)

jloow avatar jloow commented on June 7, 2024

I also tested this on Linux, and it seems to be an issue there as well.

from sleek.

ransome1 avatar ransome1 commented on June 7, 2024

@jloow can you please share an example todo list, the exact search string you're applying and the expected result?

from sleek.

jloow avatar jloow commented on June 7, 2024

Sure!

Example todo.txt:

2023-12-13 Test 1 +project_a
2023-12-13 Test 2 +project_b
2023-12-14 Test 3 @context_a
2023-12-14 Test 4 @context_b
2023-12-15 Test 5 +project_a @context_a
2023-12-15 Test 6

Search string: +

Expectation:

2023-12-13 Test 1 +project_a
2023-12-13 Test 2 +project_b
2023-12-15 Test 5 +project_a @context_a

Result:

2023-12-13 Test 1 +project_a
2023-12-13 Test 2 +project_b
2023-12-14 Test 3 @context_a
2023-12-14 Test 4 @context_b
2023-12-15 Test 5 +project_a @context_a
2023-12-15 Test 6

Search string: @

Expectation:

2023-12-14 Test 3 @context_a
2023-12-14 Test 4 @context_b
2023-12-15 Test 5 +project_a @context_a

Result:

2023-12-13 Test 1 +project_a
2023-12-13 Test 2 +project_b
2023-12-14 Test 3 @context_a
2023-12-14 Test 4 @context_b
2023-12-15 Test 5 +project_a @context_a
2023-12-15 Test 6

Search string: !+ or not +

Expectation:

2023-12-14 Test 3 @context_a
2023-12-14 Test 4 @context_b
2023-12-15 Test 6

Results: None.


Search string: !@ or not @

Expectation:

2023-12-13 Test 1 +project_a
2023-12-13 Test 2 +project_b
2023-12-15 Test 6

Result: None.

from sleek.

ransome1 avatar ransome1 commented on June 7, 2024

@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.

from sleek.

ransome1 avatar ransome1 commented on June 7, 2024

@zerodat are you around these days? @jloow report is valid. The Wiki says @ or + should narrow down the list to contexts or projects.

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.

from sleek.

zerodat avatar zerodat commented on June 7, 2024

@ransome1, I'm still out here. 😄 I'll try to take a look at this issue.

from sleek.

zerodat avatar zerodat commented on June 7, 2024

@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 todoObject.contexts (line 127 of FilterQuery.js) or todoObject.projects (line 113). That all looks like it ought to work unless the todoObject is much different now in version 2 of sleek. I'll try to do some debugging later to see where it is going wrong.

from sleek.

zerodat avatar zerodat commented on June 7, 2024

@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.

from sleek.

ransome1 avatar ransome1 commented on June 7, 2024

@jloow I can confirm that @zerodat PR fixed this. I will include it into the next release.

from sleek.

jloow avatar jloow commented on June 7, 2024

Great! I've been a bit busy but I'll be sure to check out the next release.

from sleek.

ransome1 avatar ransome1 commented on June 7, 2024

@jloow @zerodat this has been released with 2.0.7: https://github.com/ransome1/sleek/releases/tag/v2.0.7

from sleek.

jloow avatar jloow commented on June 7, 2024

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?

from sleek.

ransome1 avatar ransome1 commented on June 7, 2024

How does this work - do I close the issue?

Yes please :)

from sleek.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.