-
Notifications
You must be signed in to change notification settings - Fork 131
Description
Summary
The vcStatus as any type suppression is duplicated across 4+ execution-related TSX components. A single proper type definition would fix all of them simultaneously.
Current State
The following components all cast vcStatus as any when passing VC status data to child components:
| File | Line | Code |
|---|---|---|
CompactExecutionHeader.tsx |
L248 | vcData={vcStatus as any} |
ExecutionHeader.tsx |
L274 | vcData={vcStatus as any} |
EnhancedExecutionHeader.tsx |
L329 | vcData={vcStatus as any} |
ExecutionIdentityPanel.tsx |
L169 | vcData={vcStatus as any} |
ExecutionHero.tsx |
L72 | vcData={vcStatus as any} |
Additionally, ExecutionHero.tsx has status={execution.status as any} at L137.
Root Cause
The vcStatus variable's type (likely from an API response or hook) doesn't match the vcData prop type expected by VC display components (e.g., VCVerificationCard, SimpleVCTag). Instead of fixing the type mismatch, as any was used as a workaround.
Proposed Fix
- Define a shared
VCStatusDatainterface that represents the VC status shape:
// src/types/vc.ts (or alongside existing VC components)
export interface VCStatusData {
verified: boolean;
credentialId?: string;
issuerDid?: string;
subjectDid?: string;
issuanceDate?: string;
// ... other fields from actual API response
}-
Update the VC display components (
VCVerificationCard,SimpleVCTag, etc.) to acceptVCStatusDataas theirvcDataprop type. -
Update the hooks/API response types to return
VCStatusData. -
Remove all
as anycasts — TypeScript should now type-check cleanly.
Additional as any in Web UI TSX
While fixing this pattern, also consider these other TSX as any instances found in the audit:
| File | Line | Code | Fix |
|---|---|---|---|
HoverDetailPanel.tsx |
L145-146 | (node as any).agent_name |
Add agent_name/task_name to workflow node type |
ExecutionQueue.tsx |
L455, 568 | e as any |
Fix React event type for click handler |
EnhancedJsonViewer.tsx |
L91, 116 | typeof obj as any, type as any |
Use proper JSON value type union |
EnhancedModal.tsx |
L152 | value as any |
Type Radix UI onValueChange callback |
ResponsiveGrid.tsx |
L333 | ref as any |
Fix React ref forwarding type |
Total: 14 as any across 10 TSX files.
Acceptance Criteria
-
VCStatusDatatype defined and shared across components - All
vcStatus as anycasts removed (5 instances in 5 files) - Remaining 9
as anyin other TSX files addressed - TypeScript compilation passes
-
npm run lintpasses - No
@ts-ignoreor@ts-expect-errorintroduced
Files
src/components/execution/CompactExecutionHeader.tsxsrc/components/execution/ExecutionHeader.tsxsrc/components/execution/EnhancedExecutionHeader.tsxsrc/components/execution/ExecutionIdentityPanel.tsxsrc/components/execution/ExecutionHero.tsxsrc/components/WorkflowDAG/HoverDetailPanel.tsxsrc/components/reasoners/ExecutionQueue.tsxsrc/components/reasoners/EnhancedJsonViewer.tsxsrc/components/execution/EnhancedModal.tsxsrc/components/layout/ResponsiveGrid.tsx
Related Issues
- [Web UI] Replace any types in ExecutionForm.tsx #105 — Replace
anytypes inExecutionForm.tsx(same pattern, different file) - feat: abstract SDK-injected prompt text into a configurable PromptTemplates layer #229 — PromptTemplates (broader SDK quality initiative)
Using AI to solve this issue? Read our AI-Assisted Contributions guide for testing requirements, prompt strategies, and common pitfalls to avoid.