Comments (13)
I also tested this on Linux, and it seems to be an issue there as well.
from sleek.
@jloow can you please share an example todo list, the exact search string you're applying and the expected result?
from sleek.
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.
@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.
@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.
@ransome1, I'm still out here. 😄 I'll try to take a look at this issue.
from sleek.
@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.
@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.
@jloow I can confirm that @zerodat PR fixed this. I will include it into the next release.
from sleek.
Great! I've been a bit busy but I'll be sure to check out the next release.
from sleek.
@jloow @zerodat this has been released with 2.0.7: https://github.com/ransome1/sleek/releases/tag/v2.0.7
from sleek.
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.
How does this work - do I close the issue?
Yes please :)
from sleek.
Related Issues (20)
- Improve sorting, add missing sorting, sort order for "no", show "no" HOT 2
- Windows setting to show Sleek application icon in taskbar does not persist
- 2.0.12-rc.4 - can't open file on Windows HOT 3
- 'Error: ENOENT: no such file or directory' on starting sleek HOT 5
- Failure in parsing Context tags HOT 2
- Message 'No todos in this file' after a task has been completed HOT 13
- Only show the first line of multi-line tasks in the task list
- Since last update (2.0.12), completing a task causes ToDo.txt file to be "lost" HOT 5
- Custom Theme Support
- layout problem, todo item editor date text doesn't fit with zoom set below 90%
- TypeError: Cannot read properties of undefined (reading 'includes') HOT 3
- "Add a new todo" shortcut not working on 1st start HOT 3
- When todo.txt File Is Synched From Other Device, It Desapears From Sleek
- Human readable date missing for "in a couple of months" HOT 1
- Add setting "Position for new recurring tasks in todo.txt" HOT 1
- What is Pomodoro index? HOT 2
- In the edit popup, entering a priority by pressing a key doesn't work
- Sleek blanks out when task contains markdown link with empty label
- Error: ENOENT: no such file or directory, open ...\done.txt in Windows 11 22H2
- not installing required packages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sleek.