Skip to content

[Good First Issue] Add reusable API error banner component to frontend #19

@Oshgig

Description

@Oshgig

Overview

When the API returns a 401 (missing API key) or 500 (inference error), the frontend currently fails silently or shows a generic browser error. We need user-friendly error messages.

Scope

  • Create a reusable ApiError component in frontend/src/components/ui/
  • Display the error message from the API response (e.g., "API key required. Include X-API-Key header.")
  • Wire it into:
    • NewAnalysis.tsx — show error if prediction fails
    • Upload.tsx — show error if upload fails
  • Style with Tailwind: red border, error icon from lucide-react, dismiss button
  • Ensure the error component is responsive

Acceptance Criteria

  • When a user submits a prediction without cv_dev key, they see a red banner saying "API key required" instead of a blank screen
  • Error banner can be dismissed via an X button
  • Component renders correctly on mobile viewport

Resources

  • frontend/src/pages/NewAnalysis.tsx
  • frontend/src/pages/Upload.tsx
  • lucide-reactAlertCircle, X icons

Difficulty: Beginner-friendly
Labels: good first issue, frontend, ux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions