Skip to content

Web frontend error handling and type safety improvements #22

Description

@longzhi

Problem

Multiple frontend quality issues in web/src/:

1. Generic error messages

catch { toast.error("Analysis failed") } in Skills.tsx, Agents.tsx, Channels.tsx without showing actual error details. Users see unhelpful messages when operations fail.

2. TypeScript any types

event-stream.tsx has 5+ any usages that should be typed interfaces. This reduces type safety and IDE support.

3. Missing loading states

Providers.tsx testProvider and Channels.tsx submit buttons lack loading/disabled feedback during async operations. Users can double-click or not know an operation is in progress.

4. Console.error in production

event-stream.tsx:128 has console.error that should be removed or replaced with proper error handling.

Proposed Solution

  1. Extract error message from caught errors: catch (e) { toast.error(e instanceof Error ? e.message : "Unknown error") }
  2. Define typed interfaces for event stream data structures
  3. Add loading state tracking with disabled buttons and spinners
  4. Remove or replace console.error with user-facing error handling

Impact

  • UX — users see actionable error messages
  • DX — better type safety reduces bugs
  • Polish — loading states prevent double-submission and confusion

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3: lowNice-to-have, do when time permitsenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions