feat(filter): sort tasks the way the Todoist apps do - #479
Open
craigcarlyle wants to merge 2 commits into
Open
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
craigcarlyle
force-pushed
the
craigcarlyle/fix-issue-473
branch
from
August 17, 2026 18:10
712c7b8 to
f2ed126
Compare
4 tasks
`td filter view` printed tasks in whatever order the API returned, because the CLI never read the sorting saved on the view and never applied Todoist's default ordering. Wires `task-sort` and the view options reader into the command behind `--sort` and `--sort-order`. Each section of a multi-query filter sorts on its own, and `--json` / `--ndjson` come back in the same order as the pretty output. Closes #473 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`sortNeedsProjects` now covers every field except `none`, so `--json --sort name` fetches projects like the pretty path does and the two orders agree. Splits the old assertion in two: one for a named sort, one for `--sort none`, which is the only path that still skips the fetch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
craigcarlyle
force-pushed
the
craigcarlyle/fix-issue-473
branch
from
August 17, 2026 18:30
f2ed126 to
627fe70
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
td filter viewnow orders tasks the way the Todoist apps order them, instead of printing whatever order the API returned--sort default|priority|date|deadline|date-added|name|project|assignee|workspace|noneand--sort-order asc|desc, with precedence running flag, saved view, Todoist default--sort nonegives back the raw API order--json/--ndjsonin the same order as the pretty outputQuery:andURL:Why the order was wrong
GET /tasks/filterreturns storage order, roughly date added ascending, which is why the reporter found that setting their filter to "date added asc" made the app match the CLIsorted_byon the view and then by a documented defaultNot addressed
grouped_byis still ignored, so a filter grouped by date or label renders flat. That overlaps with feat: expose view options (board/list, group by, sort) — SDK supports view_options_set but the CLI never calls it #462Test plan
sorted_by: PRIORITYrenders p1 first--sort nonereproduces the pre-fix order--sort assigneeacross a workspace filter with 13 assignees sorts A-Z with unassigned last, and--sort-order descreverses to Z-A with unassigned firstCloses #473