Skip to content
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

Respect pinned items priority and icon in features using list (ls, todo, todos...) #341

Open
tkapias opened this issue Oct 9, 2024 · 0 comments

Comments

@tkapias
Copy link

tkapias commented Oct 9, 2024

Issue

Currently the pinned item feature seems to work only if the list is displayed with ls without filtering.

nb ls notebook:folder/

Header
------
[todos/3] 📌 ✔️  [ ] Pinned todo 3
[todos/1] ✔️  [ ] Normal todo 1
[todos/2] ✔️  [ ] Normal todo 2
------
Footer
  • With ls --reverse we keep the prority, but we loose the icon:
nb ls --reverse notebook:folder/

Header
------
[todos/3] ✔️  [ ] Pinned todo 3
[todos/2] ✔️  [ ] Normal todo 2
[todos/1] ✔️  [ ] Normal todo 1
------
Footer
  • With ls --tags=tag we loose the prority and the header/footer, so I suppose that it is passed to list:
nb ls --tags=tag notebook:folder/

[todos/1] ✔️  [ ] Normal todo 1
[todos/3] 📌 ✔️  [ ] Pinned todo 3
[todos/2] ✔️  [ ] Normal todo 2
  • With list, we loose the order and the icon:
nb list notebook:folder/

[todos/1] ✔️  [ ] Normal todo 1
[todos/3] ✔️  [ ] Pinned todo 3
[todos/2] ✔️  [ ] Normal todo 2
  • With list --tags=tag, we loose the priority and get an output like from search:
nb list --tags=tag notebook:folder/

[todos/1] ✔️  [ ] Normal todo 1
-------------------------------
9:#tag

[todos/3] 📌 ✔️  [ ] Pinned todo 3
---------------------------------
9:#tag

[todos/2] ✔️  [ ] Normal todo 2
------------------------------
9:#tag

  • With todos, we get the same result than list.

  • With todos --tags=tag, we get the same result than ls --tags=tag.

Suggestion

I opened the issue because I wanted to filter todos by tags and/or open/closed status, while also keeping the pin priority, even if I use --reverse or --sort.

I think that ls and todos should respect pinned items with any of these options:

nb ls --limit=2000 --no-id --no-indicator --no-header --no-footer --reverse --no-color --tags=tag,tag2 notebook:folder/

nb list --limit=2000 --no-id --no-indicator --reverse --no-color --tags=tag,tag2 notebook:folder/

nb todos --limit=2000 --reverse --no-color notebook:folder/ closed --tags=tag,tag2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant