feat(tasks): filter task lists by exact labels
Merged
KI
2mo ago+90+90+01234567890123456789-0-0-0123456789
Refs #8454 (the exact label filter part; hierarchy and sidebar are not in this PR).
Problem
There is no way to list tasks with a given label. --search acme also matches titles and descriptions. The query layer already had an exact label filter (TaskListFilters.labels), but taskListFilterSchema had no labels field, so zod dropped it.
Change
task.list/task.listPage: optionallabels: string[](max 20), passed tobuildTaskListConditions. A task must have every label; names are trimmed and lowercased. Optional field, so released clients are unaffected.- CLI:
superset tasks list --labels acme,client-one. Rejected for--tracker linear. - MCP
tasks_list:labelsinput, rejected for Linear. - SDK
TaskListParams.labels, CLI and SDK docs.
The desktop Tasks view still filters on the client; moving it to the server filter is a follow-up.
Tests
list.test.tscallstask.listandtask.listPageand checks that each label reaches the query (trimmed, lowercased), and that a label of only spaces is rejected. Both tests fail without the change.- End to end against a local API on a worktree Neon branch, with the built CLI, the
/mcpendpoint and the SDK:--labels acmereturns only tasks with that label; a task that only mentions "acme" in its title is not returned (--search acmereturns it).--labels acme,client-onerequires both." ACME , Client-One "matches the same. An unknown label returns nothing.- Combines with
--assignee-me.--labels ","applies no filter. task.listPage(desktop path) and MCPtasks_listfilter the same way. SDKtasks.list({ labels })works.--tracker linear --labelsand MCPtracker: "linear"with labels are rejected.- 21 labels and
""are rejected. A call withoutlabelsreturns the same rows as before.
bun testinpackages/trpcpasses. Typecheck shows no errors in changed files.
Summary by CodeRabbit
- New Features
- Filter Superset tasks by labels when listing them through the CLI, SDK, and task tools. Provide one or more labels; tasks must match all specified labels.
- Label matching is exact and ignores capitalization in the task tools. The CLI accepts comma-separated labels and ignores extra whitespace.
- Limitations
- Label filtering is not supported for Linear task listings.