Skip to content

[Web UI] Replace vcStatus as any pattern across execution components #233

@santoshkumarradha

Description

@santoshkumarradha

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

  1. Define a shared VCStatusData interface 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
}
  1. Update the VC display components (VCVerificationCard, SimpleVCTag, etc.) to accept VCStatusData as their vcData prop type.

  2. Update the hooks/API response types to return VCStatusData.

  3. Remove all as any casts — 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

  • VCStatusData type defined and shared across components
  • All vcStatus as any casts removed (5 instances in 5 files)
  • Remaining 9 as any in other TSX files addressed
  • TypeScript compilation passes
  • npm run lint passes
  • No @ts-ignore or @ts-expect-error introduced

Files

  • src/components/execution/CompactExecutionHeader.tsx
  • src/components/execution/ExecutionHeader.tsx
  • src/components/execution/EnhancedExecutionHeader.tsx
  • src/components/execution/ExecutionIdentityPanel.tsx
  • src/components/execution/ExecutionHero.tsx
  • src/components/WorkflowDAG/HoverDetailPanel.tsx
  • src/components/reasoners/ExecutionQueue.tsx
  • src/components/reasoners/EnhancedJsonViewer.tsx
  • src/components/execution/EnhancedModal.tsx
  • src/components/layout/ResponsiveGrid.tsx

Related Issues


Using AI to solve this issue? Read our AI-Assisted Contributions guide for testing requirements, prompt strategies, and common pitfalls to avoid.

Metadata

Metadata

Assignees

Labels

area:web-uiReact web UI functionalitygood first issueGood for newcomerstype-safetyTypeScript or Python type improvements

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions