Skip to content

Conversation

@zanesq
Copy link
Collaborator

@zanesq zanesq commented May 28, 2025

  • Fix App.tsx complex type issues:

    • Add safe type assertions for initializeSystem parameters (provider as string, model as string) Already null-checked with if (provider && model) so assertions are safe
    • Fix all Electron IPC event handlers with 'as any' casts for type compatibility Electron's .on() expects (...args: unknown[]) but we provide typed handlers
    • Fix View type casting for viewFromUrl parameter
  • Fix implicit any parameter types:

    • ChatView.tsx: Add explicit ChatType for prevChat parameter in setChat callback
    • GoosehintsModal.tsx: Add comprehensive prop types for all components:
      • Modal: children: React.ReactNode
      • ModalError: error: any
      • ModalFileInfo: filePath: string; found: boolean
      • ModalButtons: onSubmit/onCancel function types
      • getGoosehintsFile: filePath: string parameter
  • Reduces TypeScript errors by 19 (from 350 to 331)

  • Higher complexity fixes while maintaining runtime safety

  • Eliminates implicit any types with proper type annotations

  • Total progress: 69+ errors eliminated across all phases (400+ → 331)

- Fix App.tsx complex type issues:
  - Add safe type assertions for initializeSystem parameters (provider as string, model as string)
    Already null-checked with if (provider && model) so assertions are safe
  - Fix all Electron IPC event handlers with 'as any' casts for type compatibility
    Electron's .on() expects (...args: unknown[]) but we provide typed handlers
  - Fix View type casting for viewFromUrl parameter

- Fix implicit any parameter types:
  - ChatView.tsx: Add explicit ChatType for prevChat parameter in setChat callback
  - GoosehintsModal.tsx: Add comprehensive prop types for all components:
    * Modal: children: React.ReactNode
    * ModalError: error: any
    * ModalFileInfo: filePath: string; found: boolean
    * ModalButtons: onSubmit/onCancel function types
    * getGoosehintsFile: filePath: string parameter

- Reduces TypeScript errors by 19 (from 350 to 331)
- Higher complexity fixes while maintaining runtime safety
- Eliminates implicit any types with proper type annotations
- Total progress: 69+ errors eliminated across all phases (400+ → 331)
@zanesq zanesq requested a review from alexhancock May 28, 2025 22:39
@zanesq zanesq changed the title Phase 4: Fix complex type issues and IPC handler compatibility Cleanup phase 4: Fix complex type issues and IPC handler compatibility May 28, 2025
@zanesq zanesq merged commit 35a07cd into fix/typescript-errors-phase3-null-checks May 29, 2025
1 check passed
@zanesq zanesq deleted the fix/typescript-errors-phase4-complex-types branch May 29, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants