feat(test-cases): add searchable, filterable catalog with tree view#264
Merged
Conversation
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
Contributor
Coverage Report for Reporter (./reporter)
File CoverageNo changed files found. |
Contributor
Coverage Report for Application (./application)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
What & why
Replaces the basic test-cases table with a full-featured catalog component (
ProjectTestCasesTable) that supports:The backend handler (
getProjectTestCases) now accepts aTestCasesQuerywith limit, offset, search, status filters, age window, and sort direction. Timed-out runs are folded into failed counts; the derivedstatusfield 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-casesroute with its own layout, and updates the project overview to show the total count in the tab label.How was it tested?
project-test-cases.test.ts) covering search, filtering by status/age, sorting, pagination, and edge cases (timed-out runs, flaky classification, never-run cases)project-test-cases.spec.ts) for the UI: seeding test cases, listing with title/path, search narrowing, status filtering, tree view toggle, and age filteringChecklist
feat(test-cases): ...)https://claude.ai/code/session_01Co6VcMZLLwZWZ4FiUmR7fY