Skip to content

[P3] Refactor: Split Dashboard.tsx (934 lines) into tab-specific components #277

@frankbria

Description

@frankbria

Problem

Dashboard.tsx at 934 lines handles 6 tabs, 20+ state variables, and 10+ effects. Too much responsibility in one component.

Current State

  • File: web-ui/src/components/Dashboard.tsx (~934 lines)
  • Manages: Overview, Tasks, Quality Gates, Checkpoints, Metrics, Context tabs
  • Contains: Complex conditional rendering, tab-specific logic mixed together

Impact

  • Hard to maintain and extend
  • Performance concerns with unnecessary re-renders
  • New developers overwhelmed by file size
  • Testing requires mocking too much state

Required Decomposition

New Structure

web-ui/src/components/dashboard/
├── Dashboard.tsx              # Shell with tab navigation (~200 lines)
├── DashboardOverview.tsx      # Overview tab content
├── DashboardTasks.tsx         # Tasks tab (existing TaskList integration)
├── DashboardQualityGates.tsx  # Quality gates tab
├── DashboardCheckpoints.tsx   # Checkpoints tab
├── DashboardMetrics.tsx       # Metrics tab
└── DashboardContext.tsx       # Context tab

Shared State

  • Keep AgentStateContext for shared state
  • Each tab component subscribes to what it needs
  • Dashboard shell manages active tab only

Acceptance Criteria

  • Dashboard.tsx reduced to <250 lines
  • Each tab component is independently testable
  • Tab switching performance unchanged
  • All existing tests pass
  • No visual regression

Committee Report Reference

Frontend Architect rated Dashboard as "Too High" complexity. Quote: "6 tabs, 20+ state variables, 10+ effects... Should be split."

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-post-betaLow priority - can wait until after beta (v2.0)architectureSystem architecture and design patternsux

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions