Skip to content

Epic: Web UI (3/4) - Frontend Dashboard Widgets #55

Closed

Description

@integry

Epic: GitFix Web Management UI

This is the third of four issues to build the web UI.

Previous Issue: #54

This Issue (3/4): Frontend Dashboard Widgets

This task focuses on building the individual UI components that make up the main dashboard page and populating them with data from the backend API.

High-Level Goal

  • Develop React components for each panel described in the feature plan.
  • Fetch data from the API and display it in a clean, user-friendly way using Tailwind CSS.
  • Implement polling to ensure the dashboard data is always up-to-date.

Implementation Steps

  1. Create Data Fetching Hooks:
    • Create a custom React hook (e.g., useApiData) that handles fetching data from an API endpoint, managing loading/error states, and polling for updates.
  2. Build Components:
    • SystemStatusPanel.js: Fetches from /api/status and displays the health indicators.
    • QueueStatsPanel.js: Fetches from /api/queue/stats and displays the job counts. Active jobs should link to the (yet to be created) task introspection page: /tasks/:taskId.
    • ActivityFeed.js: Fetches from /api/activity and displays a formatted list of recent events.
    • MetricsPanel.js: Fetches from /api/metrics and displays the key performance stats.
  3. Assemble the Dashboard:
    • Combine all the panel components into a single DashboardPage.js component, arranging them in a grid layout using Tailwind CSS.

Activity

  1. integry commented on Sep 12, 2025

    @integry
    OwnerAuthor

    Suggested Implementation: React SystemStatusPanel Component

    This component demonstrates how to fetch data using a custom hook and render it with Tailwind CSS styling.

    Reasoning:

    • Component-Based: Follows standard React practices by encapsulating UI and logic into a reusable component.
    • Declarative Styling: Uses Tailwind CSS utility classes for rapid, maintainable styling directly in the JSX.
    • Custom Hook: The useApiData hook (not shown but implied) centralizes data fetching logic, making components cleaner and more focused on presentation.
    // packages/dashboard/client/src/components/SystemStatusPanel.js
    import React from 'react';
    import { useApiData } from '../hooks/useApiData'; // Custom hook for fetching
    
    const StatusIndicator = ({ status, text }) => {
      const isOk = status && (status === 'ok' || status === 'running' || status === 'connected');
      const bgColor = isOk ? 'bg-green-500' : 'bg-red-500';
    
      return (
        <div className='flex items-center justify-between p-2'>
          <span>{text}</span>
          <div className='flex items-center'>
            <span className={`w-3 h-3 rounded-full ${bgColor} mr-2`}></span>
            <span className='capitalize'>{status || 'loading...'}</span>
          </div>
        </div>
      );
    };
    
    export const SystemStatusPanel = () => {
      const { data: status, error } = useApiData('/api/status');
    
      if (error) return <div className='text-red-500'>Failed to load system status.</div>;
    
      return (
        <div className='bg-gray-800 rounded-lg shadow-md p-4'>
          <h2 className='text-lg font-bold mb-2'>System Status</h2>
          <div className='divide-y divide-gray-700'>
            <StatusIndicator status={status?.daemon} text='Daemon' />
            <StatusIndicator status={status?.redis} text='Redis Connection' />
            <StatusIndicator status={status?.githubAuth} text='GitHub App Auth' />
            {/* Add Claude Auth status here */}
          </div>
        </div>
      );
    };
  2. propr-dev commented on Sep 12, 2025

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude-opus-4-20250514 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Model: claude-opus-4-20250514
    • Branch: ai-fix/55-epic-web-ui-3-4-frontend--20250913-0103-claude-opus-4-20250514-cwy
    • Base Branch: main
    • Worktree: issue-55-20250913-0103-claude-opus-4-20250514-cwy
  3. added a commit that references this issue on Sep 12, 2025
  4. added a commit that references this issue on Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions