Functionality change report (not exactly a bug)
See original GitHub issueWhat happened?
This seems to be a regression/functionality loss introduced with the “Tasks update”, I’m assuming. I’m marking it as “Mobile” since I’m writing this in a mobile device, but don’t expect it to work either on a computer.
See correction at the end.
On updating from 0.4.26 to 0.5.26, the default behaviour of task queries in DQL has removed “group by file”, and adding group by file prevents sorting by task fields. I.e. before, the following would order tasks, per file, according to whether they were completed or not, with uncompleted tasks would be at the end (I had additional sort and select rules, this is just a minimal example):
TASK from "/projectA" WHERE
type = "project"
SORT completed ASC
This would render something like:
ProjectA
[ ] Undone task
[ ] Another undone task
[x] Done task
Marking the first task done, would re-render it as
ProjectA
[ ] Another undone task
[x] Done task
[x] Undone task
With the improvements from 0.4.26 to 0.5.26 (which are plenty!), automated grouping by file is gone, and then we need to introduce manually the grouping:
TASK from "/projectA" WHERE
type = "project"
GROUP BY file.name
but in this situation sorting no longer works (since either GROUP BY takes precedence if sorting before grouping, or the fields are non-existant if sorting afterwards), GROUP BY
sorts by what is essentially group.name, alphabetically.
This doesn’t seem fixable in dataviewjs
without replicating a lot of internal Dataview logic, since the behaviour of dv.taskList(query, true)
seems to be exactly the same of the DQL queries.
Correction
Sorting by done/undone (and likely internal tags of each task) still does work, but what is lost is sorting by any file related field.
DQL
No response
JS
No response
Dataview Version
0.5.26
Obsidian Version
1.2.2 (53)
Device
iPad Pro 2021
OS
iOS 15.5
Issue Analytics
- State:
- Created a year ago
- Comments:11 (1 by maintainers)
Top GitHub Comments
@awinecki, @rberenguel issue is different: is related with the sort in task level after grouping. In your case you want to sort in page level, something you can because you’re grouping by a page level field. The question is: after grouping you need to add the prefix
rows.
before the field. For example, if you want to sort your groups (by name) byfile.ctime
, then you need to use something like:@mnvwvnm you’re absolutely right! Seems I’ve misunderstood 😅 . Anyway, your suggestion does exactly what I want, thank you! 😃. Perhaps it’ll help anyone bumping into this, too.
✌️