Fix usage records visibility and test case run links#42
Merged
joyzoursky merged 6 commits intomainfrom Mar 10, 2026
Merged
Conversation
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
Changes
Usage recording and retrieval
src/lib/runtime/usage.ts: stabilized usage write behavior and test-run linkage.src/lib/runtime/local-browser-runner.ts,src/lib/runners/event-service.ts: ensured usage events are persisted correctly.src/app/api/teams/[id]/usage/route.ts: fixed usage list mapping/linking for table rendering.prisma/schema.prisma: added@uniqueonUsageRecord.testRunIdfor idempotency.UI navigation fixes
src/components/features/team-usage/ui/TeamUsage.tsx: made the ID column link to test run history.src/app/test-cases/[id]/history/[runId]/page.tsx: breadcrumb test-case link now points to Run Test page (/run?testCaseId=...) instead of history list.Required Test Case ID enforcement
src/components/features/test-form/ui/TestForm.tsx: Test Case ID required in form behavior (run + save draft guardrails).src/app/run/page.tsx: save/create paths now validate non-empty trimmeddisplayId.src/app/api/projects/[id]/test-cases/route.tsandsrc/app/api/test-cases/[id]/route.ts: reject missing/blank Test Case ID with400.src/i18n/messages.ts: added localizedrun.error.testCaseIdRequired.Regression tests
src/app/api/teams/[id]/usage/route.test.tssrc/lib/runners/__tests__/event-service.test.tssrc/lib/runtime/__tests__/local-browser-runner.usage.test.tsValidation
npm run verifypassed (lint + typecheck + audit)./test-cases/{testCaseId}/history/{runId}./run?testCaseId={id}(with project context when available).Breaking Changes
POST /api/projects/:id/test-casesnow requires non-emptydisplayId(Test Case ID).PUT /api/test-cases/:idnow requires non-emptydisplayId(Test Case ID).UsageRecord.testRunIdis now unique at schema level.Risks
UsageRecord.testRunIdvalues, schema deployment may fail until duplicates are resolved.displayIdon test-case create/update will now receive400.Follow-ups
UsageRecord.testRunIdbefore applying schema changes.