Skip to content

feat: Add task filtering by status and priority to GET /tasks#5

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/generate-api-filtering-checklist
Draft

feat: Add task filtering by status and priority to GET /tasks#5
Copilot wants to merge 3 commits intomainfrom
copilot/generate-api-filtering-checklist

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 1, 2026

GET /tasks had no filtering capability — it always returned all tasks. This adds optional status and priority query params to the API and wires filter controls into the React UI.

Backend

  • server.ts: GET /tasks now accepts ?status=pending|completed and ?priority=Low|Medium|High; returns 400 with a descriptive message for invalid values; no params = all tasks (backward compatible)
  • src/services/taskService.ts: Added getFilteredTasks({ status?, priority? }) — chains .filter() on the in-memory store; undefined dimensions are unrestricted

Frontend

  • taskApiService.ts: fetchTasks(filters?) appends non-empty filter values as query-string params
  • useTasks.ts: Holds filters state; re-fetches on filter change; exposes setFilters to callers
  • TasksPage.tsx: Two <select> dropdowns (Status / Priority) drive setFilters; selecting blank resets that dimension
  • tasks.css: Flex filter bar with .tasks-page__filters / .filter-select

Example

GET /tasks                          → all 100 tasks
GET /tasks?status=pending           → 75 tasks
GET /tasks?priority=High            → 33 tasks
GET /tasks?status=pending&priority=High → 25 tasks
GET /tasks?status=invalid           → 400 { "error": "status must be one of: pending, completed." }
Original prompt

"Generate a development checklist to implement API filtering for GitHub issue #4

[Chronological Review] 1. Initial Request: User asked to summarize GitHub issue #4 from the current repository 2. Exploration: Agent ran `git remote -v` to identify the repository owner and name 3. Tool Execution: Agent called the GitHub MCP server to fetch issue #4 4. Completion: Agent presented a formatted summary of the issue to the user

[Intent Mapping]

[Technical Inventory]

  • Repository: CanarysPlayground/TaskManagementApplication (GitHub)
  • Tools used: powershell (git remote), github-mcp-server-issue_read
  • API endpoint under discussion: GET /tasks with query params status and priority

[Code Archaeology]

  • No files were modified; this was a read-only inquiry
  • Issue references GET /tasks endpoint in the TaskManagementApplication project

[Progress Assessment]

[Context Validation]

[Recent Commands Analysis]

1. Conversation Overview

  • Primary Objective: "summarize the github issue issue Add Task Filtering by Status and Priority #4" — the user requested a plain-language summary of GitHub Issue Add Task Filtering by Status and Priority #4 from the active local repository.
  • Session Context: Very short, single-turn session. The agent identified the repository from git remotes, fetched the issue via the GitHub MCP tool, and returned a formatted summary.
  • User Intent Evolution: No evolution — single, self-contained request with no follow-up.

2. Technical Foundation

  • Repository: CanarysPlayground/TaskManagementApplication hosted on GitHub
  • Git Remote URL: https://github.com/CanarysPlayground/TaskManagementApplication.git
  • GitHub MCP Tool: github-mcp-server-issue_read — used to fetch issue metadata, body, state, and author
  • Application Under Development: A Task Management API (REST-based), with a GET /tasks endpoint being extended for filtering

3. Codebase Status

  • No files were modified or inspected during this session.
  • The issue references a GET /tasks API endpoint that needs to be extended, but no code was read or changed.

4. Problem Resolution

  • No bugs or errors encountered. This was a read-only, informational session.
  • The git remote -v command was used to resolve the repository owner/name before calling the GitHub API — a straightforward two-step lookup pattern.

5. Progress Tracking

  • Completed: Identified the GitHub repository from git remotes
  • Completed: Fetched GitHub Issue Add Task Filtering by Status and Priority #4 via github-mcp-server-issue_read
  • Completed: Presented a structured, human-readable summary of the issue to the user

6. Active Work State

  • Current Focus: The task was fully completed — no work was in progress when summarization was triggered.
  • Recent Context: The agent returned a formatted summary of Issue Add Task Filtering by Status and Priority #4 including its goal, scope, and acceptance criteria.
  • Issue Summary (key content):
    • Title: "Add Task Filtering by Status and Priority"
    • State: Open
    • Author: kavyashri-as (MEMBER)
    • Created: 2026-04-01T18:57:38Z
    • Scope: Extend GET /tasks to accept optional query params:
      • status: pending | completed
      • priority: Low | Medium | High
    • Filters usable independently or combined; backward compatible (no filters = all tasks)
    • Acceptance Criteria:
      • GET /tasks?status=pending → only pending tasks
      • GET /tasks?priority=High → only high-priority tasks
      • GET /tasks → all tasks

7. Recent Operations

  • Last Agent Commands (in order):
    1. report_intent — logged intent as "Fetching GitHub issue"
    2. powershell — ran git --no-pager remote -v
      • Result: origin https://github.com/CanarysPlayground/TaskManagementApplication.git (fetch/push)
    3. github-mcp-server-issue_read — called with owner: CanarysPlayground, repo: TaskManagementApplication, issue_number: 4, method: get
      • Result: Full issue JSON returned: number=4, title="Add Task Filtering by Status and Priority", state="open", body with scope and acceptance criteria, author=kavyashri-as, created_at=2026-04-01T18:57:38Z
  • Pre-Summary State: Agent had just finished presenting the issue summary to the user; no further actions were pending.
  • Operation Context: The two-step lookup (git remote → GitHub API) was necessary beca...

Created from Copilot CLI via the copilot delegate command.

Copilot AI changed the title [WIP] Add development checklist for API filtering implementation feat: Add task filtering by status and priority to GET /tasks Apr 1, 2026
Copilot AI requested a review from kavyashri-as April 1, 2026 19:10
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.

2 participants