fix: sort completed main tasks to bottom of list (#15) #18

Merged
maximus merged 1 commit from fix/simpl-liste-15-sort-completed-tasks into master 2026-03-08 15:26:02 +00:00
Collaborator

Summary

  • Add asc(tasks.completed) as the primary sort key in getOrderClauses() so completed main tasks always sink to the bottom, regardless of the active sort mode (position, priority, dueDate, title, createdAt)
  • Apply the same asc(tasks.completed), asc(tasks.position) ordering to getSubtasks() in tasks.ts
  • Apply the same ordering to widgetSync.ts for the no-date tasks query and subtasks query

Files changed

  • src/db/repository/tasks.tsgetOrderClauses() and getSubtasks()
  • src/services/widgetSync.ts — noDateTasks query (line 92) and subtasks query (line 120)

Fixes #15

## Summary - Add `asc(tasks.completed)` as the primary sort key in `getOrderClauses()` so completed main tasks always sink to the bottom, regardless of the active sort mode (position, priority, dueDate, title, createdAt) - Apply the same `asc(tasks.completed), asc(tasks.position)` ordering to `getSubtasks()` in `tasks.ts` - Apply the same ordering to `widgetSync.ts` for the no-date tasks query and subtasks query ## Files changed - `src/db/repository/tasks.ts` — `getOrderClauses()` and `getSubtasks()` - `src/services/widgetSync.ts` — noDateTasks query (line 92) and subtasks query (line 120) Fixes #15
medic-bot added 1 commit 2026-03-08 15:04:43 +00:00
Add asc(tasks.completed) as the primary sort key in getOrderClauses()
so completed tasks always appear after active ones regardless of the
chosen sort mode (position, priority, dueDate, title, createdAt).

Also apply the same completed-first ordering to:
- getSubtasks() in tasks.ts
- noDateTasks query in widgetSync.ts
- subtasks query in widgetSync.ts

Ref: simpl-liste#15

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
maximus merged commit 0462b5a50b into master 2026-03-08 15:26:02 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: maximus/simpl-liste#18
No description provided.