feat: add filter options to tasks#2471
Conversation
Greptile SummaryThis PR adds sorting and multi-dimension filtering (agent status, PR status, workspace changes) to the task list view, and extracts the
Confidence Score: 5/5Safe to merge — the filter and sort logic is well-isolated in pure functions, the MobX store changes are correct, and the UI components are clean extractions with no functional regressions. The filter functions are pure and covered by clear type constraints. MobX observable set mutations and reassignments in TaskViewStore are handled correctly under makeAutoObservable. The null-agentStatus path is properly guarded. The shared components (FilterMenuButton, SortSelect) are accurate refactors of the inline code they replace, confirmed by reading both the new components and the original pr-view usage. No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/emdash-desktop/src/renderer/features/projects/components/task-view/task-filters.ts | New file: pure filter/sort utilities with correct null-agentStatus handling and stable pinned-first sort. |
| apps/emdash-desktop/src/renderer/features/projects/stores/project-view.ts | Extends TaskViewStore with MobX-observable filter sets and sortBy field; clearFilters correctly reassigns sets and MobX reacts to the property change. |
| apps/emdash-desktop/src/renderer/features/projects/components/task-view/task-list.tsx | Adds filter/sort row and contextual empty state; filter construction inside observer component correctly tracks all observable set reads. |
| apps/emdash-desktop/src/renderer/lib/components/filter-menu-button.tsx | Clean extraction of the popover-backed filter trigger; adds optional badge and contentClassName props that the PR view didn't need. |
| apps/emdash-desktop/src/renderer/lib/components/sort-select.tsx | Generic sort dropdown using Base UI's SelectPrimitive; render-prop children on SelectValue are valid for Base UI's Select.Value API. |
| apps/emdash-desktop/src/renderer/features/projects/components/pr-view/pr-view.tsx | Refactored to use shared FilterMenuButton and SortSelect components; local FilterButton and Select block removed with no functional change. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[TaskList render] --> B[displayTasks: active or archived]
B --> C[filter: name search + taskMatchesFilters]
C --> D{agent filter active?}
D -- yes --> E[taskAgentStatus]
E --> F{null or not in set?}
F -- yes --> G[exclude task]
F -- no --> H{pr filter active?}
D -- no --> H
H -- yes --> I[taskPrFilterValue]
I --> J{not in set?}
J -- yes --> G
J -- no --> K{changes filter active?}
H -- no --> K
K -- yes --> L[taskChangesFilterValue]
L --> M{not in set?}
M -- yes --> G
M -- no --> N[include task]
K -- no --> N
N --> O[sortTasks: pinned-first then field]
O --> P{results empty?}
P -- no --> Q[TaskVirtualList]
P -- yes, has search or filters --> R[EmptyState: Clear search and filters]
P -- yes, no search or filters --> S[TaskListEmptyState: onboarding]
Reviews (2): Last reviewed commit: "fix(tasks): clarify empty filtered lists" | Re-trigger Greptile
Description
Screenshot/Recording (if applicable)
https://streamable.com/xr7ja2
Checklist
messages and, when possible, the PR title