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

fix: 'sort by function' now sorts 'true' before 'false' #2597

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

claremacrae
Copy link
Collaborator

This makes the results easier to reason about, and easier to document.

Description

Change sort by function for boolean expressions so that tasks are now sorted in the order:

  1. tasks giving expression value true come first
  2. then all the tasks giving expression value false are listed.

Previously I opted to sort the opposite way round, but this turned out to be confusing in use.

Sorting recurring tasks first, Before:

One had to know to use either of these:

sort by function ! task.isRecurring
sort by function reverse task.isRecurring

Sorting recurring tasks first, Now:

Now this works:

sort by function task.isRecurring

It feels logical to me that the tasks that match the boolean expression are the ones that are shown first.

Motivation and Context

This is another part of fixing #1479 - and trying to get the work I did in #2577 ready for release.

It will also make the docs for sort by function easier to write.

How has this been tested?

  • Updating tests
  • Exploratory testing

Screenshots (if appropriate)

Types of changes

Changes visible to users:

  • Bug fix (prefix: fix - non-breaking change which fixes an issue)
    • ... of an unreleased feature
  • Documentation (prefix: docs - improvements to any documentation content for users)

Internal changes:

  • Tests (prefix: test - additions and improvements to unit tests and the smoke tests)

Checklist

Terms

This makes the results easier to reason about, and easier to document.
@claremacrae claremacrae added scope: sorting Changes to the sorting capabilities scope: scripting Issues to do with custom filters, custom sorting and similar labels Jan 18, 2024
@claremacrae claremacrae merged commit 2bed495 into main Jan 18, 2024
2 checks passed
@claremacrae claremacrae deleted the sort-true-before-false branch January 18, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: scripting Issues to do with custom filters, custom sorting and similar scope: sorting Changes to the sorting capabilities
Projects
Status: 🎉 Released
Development

Successfully merging this pull request may close these issues.

1 participant