Skip to content

feat: add filter options to tasks#2471

Open
janburzinski wants to merge 3 commits into
mainfrom
emdash/add-sorting-task-view-hlhdj
Open

feat: add filter options to tasks#2471
janburzinski wants to merge 3 commits into
mainfrom
emdash/add-sorting-task-view-hlhdj

Conversation

@janburzinski

Copy link
Copy Markdown
Collaborator

Description

  • adds sorting to the task list: newest,oldest,recently updated, name
  • task filter for agent status, pr status, workspace changes
  • extract sortselect and filtermenubutton compoentns

Screenshot/Recording (if applicable)

https://streamable.com/xr7ja2

Checklist
  • I kept this PR small and focused
  • I ran a self-review before opening this PR
  • I ran the relevant local checks or explained why not
  • I updated docs when behavior or setup changed
  • I added or updated tests when behavior changed, or explained why not
  • I only added comments where the logic is not obvious
  • I used Conventional Commits for commit
    messages and, when possible, the PR title

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds sorting and multi-dimension filtering (agent status, PR status, workspace changes) to the task list view, and extracts the FilterMenuButton and SortSelect components that are now shared between task and PR views.

  • task-filters.ts introduces pure filter/sort functions (taskMatchesFilters, sortTasks) and the associated option constants; null agent status (no conversation manager) correctly excludes a task from all agent-status filters rather than silently coercing to 'idle'.
  • TaskViewStore is extended with observable MobX sets for each filter dimension plus a sortBy field; clearFilters reassigns all three sets which MobX 6 correctly handles as observable property replacements.
  • task-list.tsx composes filters/sort in the observer render and adds a contextual "No matching tasks" empty state with a single-click clear action.

Confidence Score: 5/5

Safe 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.

Important Files Changed

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]
Loading

Reviews (2): Last reviewed commit: "fix(tasks): clarify empty filtered lists" | Re-trigger Greptile

@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant