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

Sorts strings naturally #393

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nkakouros
Copy link
Contributor

A natural thing to do when sorting task list is to sort by urgency. If two tasks have same urgency, then I am not sure how the order is calculated. But, imagine you have the following tasks and viewport:

Read the new book | project:book $V
* [ ] Read chapter 1
* [ ] Read chapter 2

where $V is urgency-,description+. Suppose the two tasks have the same urgency. Imagine now that there are more chapters. In this case the listing would look like:

Read the new book | project:book $V
* [ ] Read chapter 1
* [ ] Read chapter 10
* [ ] Read chapter 11
* [ ] Read chapter 2
* [ ] Read chapter 3
* [ ] Read chapter 4
* [ ] Read chapter 5
* [ ] Read chapter 6
* [ ] Read chapter 7
* [ ] Read chapter 8
* [ ] Read chapter 9

This is obviously not the way it should be. The topmost tasks should be the ones that should be done first and chapter 10 should come after chapter 9. This is at least the assumption this PR makes. That in "series of tasks", i.e. multiple tasks sharing the same description except an ordinal number at the end, the sorting should be natural.

I am not sure this PR breaks anything. The test suite seems broken currently. Once fixed, I will add tests and address any edge cases.

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

Successfully merging this pull request may close these issues.

1 participant