feat(views): make queue view sort order configurable (#154)
Problem: the queue/priority view sort in `sort_tasks_priority()` uses a hardcoded tiebreak chain (status, priority, due, order, id). Users who care more about due dates than priority have no way to reorder it. Solution: add `view.queue.sort` config field (string[]) that defines an ordered tiebreak chain. `build_queue_comparator()` maps each key to a comparison function and returns a single comparator. Unknown keys emit a `log.warn`. The default matches the previous hardcoded behavior.
This commit is contained in:
parent
b9b12fd2a5
commit
3b3cdc8965
4 changed files with 169 additions and 12 deletions
|
|
@ -87,6 +87,7 @@
|
|||
---@field hide_done_categories? boolean
|
||||
|
||||
---@class pending.QueueViewConfig
|
||||
---@field sort? string[]
|
||||
|
||||
---@class pending.ViewConfig
|
||||
---@field default? 'category'|'priority'
|
||||
|
|
@ -133,7 +134,9 @@ local defaults = {
|
|||
folding = true,
|
||||
hide_done_categories = false,
|
||||
},
|
||||
queue = {},
|
||||
queue = {
|
||||
sort = { 'status', 'priority', 'due', 'order', 'id' },
|
||||
},
|
||||
},
|
||||
keymaps = {
|
||||
close = 'q',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue