fix(activity): tolerate unknown activity kinds in ActivityFeed
The live-tail stream (now reachable through the new Vite /api proxy) started delivering activity rows with kind="manual_match", a kind the ActivityFeed kindConfig map didn't know about. The map lookup returned undefined, and reading .icon on it threw — taking the whole Activity Log page down. Two fixes: 1. Add "manual_match" to the ActivityKind union in src/types/index.ts and to the kindConfig map in src/components/ActivityFeed.tsx (with a Wrench icon + neutral tone), so the kind is properly typed and rendered. 2. Add a FALLBACK_KIND guard so any future backend-emitted kind that arrives before the frontend is updated no longer crashes the page. kindConfig stays exhaustive for known kinds, so TypeScript still catches missing entries at compile time. Also adds src/components/ActivityFeed.test.tsx with three regression tests (empty state, multi-item render, unknown-kind safety).
This commit is contained in:
+5
-1
@@ -20,7 +20,11 @@ export type ActivityKind =
|
||||
| "claim_denied"
|
||||
| "claim_accepted"
|
||||
| "remit_received"
|
||||
| "provider_added";
|
||||
| "provider_added"
|
||||
// Emitted by `cyclone.store.record_manual_match` when an operator
|
||||
// pairs a remit to a claim by hand. Surface as a neutral event on
|
||||
// the Activity Log; do NOT treat it as a status change.
|
||||
| "manual_match";
|
||||
|
||||
export interface Claim {
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user