Skip to content

feat(test-cases): add searchable, filterable catalog with tree view#264

Merged
PhenX merged 3 commits into
mainfrom
claude/test-cases-list-improvements-fkj2kp
Jul 16, 2026
Merged

feat(test-cases): add searchable, filterable catalog with tree view#264
PhenX merged 3 commits into
mainfrom
claude/test-cases-list-improvements-fkj2kp

Conversation

@PhenX

@PhenX PhenX commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

What & why

Replaces the basic test-cases table with a full-featured catalog component (ProjectTestCasesTable) that supports:

  • Server-driven search & filtering: Case-insensitive substring search on title/file path, status filters (passed/failed/flaky/skipped/didnotrun), and age window (last 7/30/90 days or all time)
  • Sorting & pagination: Sort by title, status, runs, pass rate, avg duration, or last run; configurable page size (10–100 items)
  • Tree view toggle: Hierarchical display of test cases grouped by file and describe blocks, with collapse/expand controls
  • Shareable URLs: Query parameters sync to the route so filters/sort/page state survives tab switches and can be shared
  • Responsive design: Table on desktop (md+), card layout on mobile

The backend handler (getProjectTestCases) now accepts a TestCasesQuery with limit, offset, search, status filters, age window, and sort direction. Timed-out runs are folded into failed counts; the derived status field reflects flaky (if any of the last 10 runs is a retry-pass), the latest run's status, or never-run. Pass rate is computed over executed runs only and is null when nothing has run.

Moves the test-cases tab from the project overview page to a dedicated /projects/:id/test-cases route with its own layout, and updates the project overview to show the total count in the tab label.

How was it tested?

  • Added unit tests (project-test-cases.test.ts) covering search, filtering by status/age, sorting, pagination, and edge cases (timed-out runs, flaky classification, never-run cases)
  • Added E2E tests (project-test-cases.spec.ts) for the UI: seeding test cases, listing with title/path, search narrowing, status filtering, tree view toggle, and age filtering
  • Existing tests pass; demo seed updated to include the new test project

Checklist

  • PR title follows Conventional Commits (feat(test-cases): ...)
  • Tests added for behavior changes (unit + E2E)
  • Docs updated (help content, UI overview)

https://claude.ai/code/session_01Co6VcMZLLwZWZ4FiUmR7fY

claude added 3 commits July 16, 2026 21:31
The seed generator wrote created_at as Unix seconds into a timestamp_ms
column, so typed reads yielded 1970 dates and any millisecond-based
comparison against it (e.g. an age-window cutoff) matched nothing in the
demo database. Store the millisecond value directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Co6VcMZLLwZWZ4FiUmR7fY
The project test-cases catalog (page and tab) loaded every case with no
pagination, rendered flat icon counters, and duplicated ~110 lines of table
markup across two call sites. Rework it end to end.

Backend (getProjectTestCases): return a { items, total, limit, offset }
envelope and accept limit/offset/q/status/maxAgeDays/sort/dir. Filtering,
search (case-insensitive over title and file path), the last-run age window
(EXISTS on test_runs_cases), sorting (NULLS LAST) and pagination all run in
SQL. Timed-out runs fold into failedRuns; pass rate is computed over executed
runs only (null when none); a derived status category powers the filter and
badge. Parsing/clamping lives in a shared parseTestCasesQuery reused by the
REST endpoint and the demo router; the MCP get_project_test_catalog tool now
pushes paging into SQL and gains a query filter. Also aliases the flaky
subquery so it is valid on PostgreSQL.

UI: one shared ProjectTestCasesTable (search, status pills, age select,
server-side sortable headers, pagination, flat/tree toggle, a desktop table
plus a mobile card list, and loading/error/empty states) replaces both
copies, with a ProjectTestCasesTree for per-spec grouping and a
PassRateIndicator gauge. Results render as a TestStatusBar, file paths reuse
OpenInIdeLink, and filter state syncs to the URL. formatDuration now rounds
to whole milliseconds (avg durations no longer show long decimals) and
renders zero as "0 seconds".

BREAKING CHANGE: GET /api/projects/:id/test-cases now returns
{ items, total, limit, offset } instead of a bare array and accepts
limit/offset/q/status/maxAgeDays/sort/dir query parameters.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Co6VcMZLLwZWZ4FiUmR7fY
…size

The desktop table had no explicit width, so on wide viewports it sized to
its min-width/content and left dead space instead of filling the card.
Page size was a hardcoded 50 with no way to change it.

Add w-full alongside the existing min-width so the table always fills its
container. Replace the fixed page size with a selectable 10/25/50/100
(default 25, synced to the URL like the other filters).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Co6VcMZLLwZWZ4FiUmR7fY
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Reporter (./reporter)

Status Category Percentage Covered / Total
🔵 Lines 64.01% 1450 / 2265
🔵 Statements 62.39% 1649 / 2643
🔵 Functions 70.43% 243 / 345
🔵 Branches 58.86% 1195 / 2030
File CoverageNo changed files found.
Generated in workflow #907 for commit 668e94a by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Application (./application)

Status Category Percentage Covered / Total
🔵 Lines 24% 1879 / 7829
🔵 Statements 23.89% 2179 / 9119
🔵 Functions 22.96% 330 / 1437
🔵 Branches 20.7% 1499 / 7241
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
application/app/utils/help-content.ts 0% 0% 0% 0% 32-602
application/app/utils/index.ts 66.95% 64.62% 75% 65.12% 12-25, 67, 98, 115-126, 140, 144, 148, 201-233, 264-268, 413, 433, 435, 437, 439, 441-442, 444, 446, 449-454, 482
application/server/utils/mcp/tools.ts 0% 0% 0% 0% 57-1587
application/shared/mcp-tools.ts 0% 100% 100% 0% 28-533
application/shared/test-project-names.ts 0% 100% 100% 0% 15-123
application/shared/handlers/projects.ts 10.12% 12.35% 10.95% 11.39% 22-444, 476, 506, 509-510, 633-893, 907-1158, 1167-1292
Generated in workflow #907 for commit 668e94a by the Vitest Coverage Report Action

@PhenX
PhenX merged commit 3f8e08c into main Jul 16, 2026
7 checks passed
@PhenX
PhenX deleted the claude/test-cases-list-improvements-fkj2kp branch July 16, 2026 23:05
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