cht-core icon indicating copy to clipboard operation
cht-core copied to clipboard

Implement task sorting in ascending or descending order

Open andrablaj opened this issue 8 months ago • 3 comments

Is your feature request related to a problem? Please describe.

Currently tasks are sorted only by due date, so users have to manually identify tasks that are most urgent. The update takes into account both a priority score and due date to prioritize tasks.

Describe the solution you'd like

Extend the sorting logic to sort tasks as follows:

  1. Priority values are positive numbers
  2. Higher priorities sort first
  3. Equal priorities sort by due date
  4. Invalid/missing values sort last while adhering to the above

Describe alternatives you've considered

  1. Store an array of priorities per task for e.g. [not due, due, overdue], then let the WebApp pick the correct one. This turned out to be rigid and complex to maintain.
  2. Sort entirely by due date and then priority. This does not fully capture the intended urgency based on individual conditions.
  3. Sort overdue tasks by due date, and all other tasks by priority. This sounded great, but less consistent for borderline-due tasks.

andrablaj avatar May 09 '25 11:05 andrablaj

I can help update the description. Please assign it to me.

kalamakitsao avatar May 29 '25 08:05 kalamakitsao

Some description was added to the pull request instead. Will work with @sookwalinga to get this out.

kalamakitsao avatar Jun 03 '25 04:06 kalamakitsao

Some minor updates/rephrasing:

Is your feature request related to a problem? Please describe.

Currently tasks are sorted only by due date, so users have to manually identify tasks that are most urgent. The update takes into account both a priority score and due date to prioritize tasks.

Describe the solution you'd like

Extend the sorting logic to sort tasks as follows:

  1. Priority values are positive numbers
  2. Higher priorities sort first
  3. Equal priorities sort by due date
  4. Invalid/missing values sort last while adhering to the above

Describe alternatives you've considered

  1. Store an array of priorities per task for e.g. [not due, due, overdue], then let the WebApp pick the correct one. This turned out to be rigid and complex to maintain.
  2. Sort entirely by due date and then priority. This does not fully capture the intended urgency based on individual conditions.
  3. Sort overdue tasks by due date, and all other tasks by priority. This sounded great, but less consistent for borderline-due tasks.

kalamakitsao avatar Jun 05 '25 12:06 kalamakitsao