feat(tasks): Add search, filter, sort capabilities and fix N+1 query bug#24
Merged
feat(tasks): Add search, filter, sort capabilities and fix N+1 query bug#24
Conversation
- Fix critical N+1 query issue using SQLAlchemy selectinload (51→2 queries) - Add server-side search with case-insensitive ILIKE (max 200 chars) - Add sort by created_at, due_date, priority, title with custom priority ordering - Add filters: tags (AND logic), has_due_date (boolean) - Implement null handling: nullslast for asc, nullsfirst for desc - Update frontend with useDeferredValue for 300ms debounced search - Add sort dropdowns and remove client-side filtering - Add 15 new tests (74 passed, 3 skipped for PostgreSQL-only features) Closes #14 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update ListTasksInput model with new optional params: - search: case-insensitive title search (max 200 chars) - tags: comma-separated tags filter (AND logic) - has_due_date: boolean filter for due date existence - sort_by: created_at, due_date, priority, title - sort_order: asc, desc - Update api_client.py to pass new params to REST API - Update taskflow_list_tasks tool to use new params - Add tags field to task response output - All params are optional for backward compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed the import of the tailwindcss animate plugin from `require` to ES module import for consistency and improved readability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added new fields for due date and tags in the subtask creation form. - Implemented state management for subtask due date and tags. - Updated API call to include due date and tags when creating a subtask. - Enhanced UI to allow users to input due date and comma-separated tags. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…nd task hierarchy - Add GET /api/tasks/recent endpoint for optimized dashboard (single query across all projects) - Add project settings page with edit form and delete functionality - Add cascade delete for tasks (deleting parent removes all subtasks) - Add task hierarchy indicators on tasks page (↳ for subtasks, 🔀 N for parents) - Add parent_task_id and subtask_count to TaskListItem response - Update test to verify cascade delete behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
selectinload(51 → 2 queries for 50 tasks)useDeferredValuefor 300ms debounced searchKey Changes
Backend (
packages/api/src/taskflow_api/routers/tasks.py)selectinload(Task.assignee)to fix N+1 query issuesearch,tags,has_due_date,sort_by,sort_ordercase()expressionFrontend
web-dashboard/src/types/index.ts- ExtendedTaskFilterParamswith new paramsweb-dashboard/src/lib/api.ts- UpdatedgetProjectTasksto pass new paramsweb-dashboard/src/app/tasks/page.tsx- AddeduseDeferredValue, sort dropdowns, removed client-side filteringTests (
packages/api/src/taskflow_api/tests/test_tasks.py)Test Results
Test Plan
Closes #14
🤖 Generated with Claude Code