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

Sort todo list #1434

Open
1 task done
sadtab opened this issue May 23, 2024 · 3 comments
Open
1 task done

Sort todo list #1434

sadtab opened this issue May 23, 2024 · 3 comments
Labels
feature Issues related to feature proposals. Please attach a module.

Comments

@sadtab
Copy link

sadtab commented May 23, 2024

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

The title says it all, a feature that sorts the todo list, the most common sorting is to do bring "undone"s top and "done"s to the bottom and others somewhere in between

Help

No

Implementation help

Shame on me, I don't know lua very well

@sadtab sadtab added the feature Issues related to feature proposals. Please attach a module. label May 23, 2024
@Anrock
Copy link

Anrock commented May 23, 2024

It's kinda already there?

- ( ) test
- (x) test
- (-) test
- (x) test
- ( ) test
- (_) test
- (=) test

:sort turns it into

- ( ) test
- ( ) test
- (-) test
- (=) test
- (_) test
- (x) test
- (x) test

Order is: not started, started, on pause, cancelled, done.

@sadtab
Copy link
Author

sadtab commented May 23, 2024

@Anrock, not exactly, it works fine for homo-intended tasks, but it will completely mess with the subtasks, a proper sorting requires to implement the logic to to take this into account

- ( ) task1
-- (x) sub1
-- (-) sub2
-- ( ) sub3
- (x) task2
- ( ) task3
- (_) task4
- (=) task5
- (x) task6
-- (x) sub7
-- (x) sub8

to

- ( ) task1
-- ( ) sub3
-- (-) sub2
-- (x) sub1
- ( ) task3
- (_) task4
- (=) task5
- (x) task2
- (x) task6
-- (x) sub7
-- (x) sub8

The first impression is :

  • if it has subtasks and any of them is undone, just sort the subtask
  • if it has subtasks and all are done, move the whole task and its subtasks down
  • no subtask -> regular sorting

The main idea is too keep undone tasks on top

@Anrock
Copy link

Anrock commented May 23, 2024

Ah, indeed. I totally forgot about subitems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issues related to feature proposals. Please attach a module.
Projects
None yet
Development

No branches or pull requests

2 participants