Repository navigation
get-todos can select tasks by the kind of page their block stands on #118
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
A caller can list only the tasks whose block stands on a Journal Page, or only those that stand on any other page, in the two cases that no existing option covers.
What happens today
One case already works: get-todos --to D --no-follow-refs follows no ((block-ref)), so a task counts in the range only by the day of the page its block stands on, and tasks on ordinary pages drop out. "Journal tasks older than a year" is therefore one call, but the option's name says nothing about it, and it also turns off the references information.
Two cases have no option:
- A selection without a range. "All open tasks that stand on Journal Pages" (or only on other pages). Without
--from/--to,--no-follow-refsfilters nothing. The workaround isjqonjournal_day, which is present when the task's block stands on a Journal Page and absent otherwise. It has two gaps (both read from the code, not measured on a graph):countin the JSON still reports the number before the second filter ran, and plain-text output does not showjournal_day, so there is nothing to filter on. - Carried tasks inside a range. With
--from/--to, a task counts in the range when its own page, or any page it was carried to by a((block-ref)), is in the range. There is no way to ask for only the tasks from ordinary pages that were carried into the range.
What changes for a caller
get-todos takes --page-type journal|page (case does not matter):
logseq-cli get-todos --page-type journal --state open
logseq-cli get-todos --page-type page --from 2026-03-01 --to 2026-03-31
logseq-cli get-todos --page-type journal --no-follow-refs --to 2025-10-06
journalkeeps tasks whose block stands on a Journal Page.pagekeeps the rest.- The block counts, not the pages it was carried to. A task on
Project Alphathat a journal only references is apagetask. - The option only narrows the result and combines with the other filters (
--page,--state,--from/--to, …) like they do with each other. It does not change how a range is read:--page-type journal --from 2026-03-05still returns a journal task written earlier if a((block-ref))carries it into a day on or after that date, because that is where the task stands in that range. - To measure the range by the day of the block's own page, add
--no-follow-refs, as in the third example. The help says so. referencesandreferences_withheldare untouched;countis the filtered count. An empty result is not an error.- Without the option, output does not change.
The option keeps its name when get-todos is renamed as part of #92.
How to tell it is done
--page-type journaland--page-type pagereturn disjoint, non-empty sets whose union is what the call returns without the option, with and without--from/--to.- A task whose block stands on an ordinary page and that appears in a journal only through a
((block-ref))is returned by--page-type pageand not byjournal, also when the range includes that journal. --page-type journal --no-follow-refs --to Dreturns exactly the tasks on Journal Pages up toD, and--page-type page --no-follow-refs --to Dreturns none.- With
--page, both filters apply. - A value other than
journalorpageis refused and the message names both. --helpand the command reference describe the option, including that the block counts, that the range rule is unchanged, whatpagemeans ("any page that is not a Journal Page"), and the--no-follow-refsrecipe.
Not part of this issue
- Other commands (
find-block,smart-query,analyze-*). - Measuring a range by the block's own day as an effect of this option.
--no-follow-refsdoes that already, and the option stays a plain filter like--pageand--tag.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
muellerei commentedon Oct 6, 2026
Implemented in #119:
get-todos --page-type journal|page, an option that only narrows. With--no-follow-refsit gives the "journal tasks older than a date" recipe by the block's own day.