Files
pentagi/frontend
Sergey KozyrenkoandClaude Opus 4.7 b7ed0689a9 perf(frontend): drop Dashboard period-switch INP from 434ms to 134ms
The Analytics tab on /dashboard renders 4 Recharts plus a Flow
Execution Details list with 130+ Collapsible rows. Switching the period
(Week/Month/Quarter) re-rendered everything synchronously: the
pointerdown→paint interaction had INP=434ms (Google "Needs Improvement"
zone), with processing duration alone accounting for 403ms.

Four small changes, no new dependencies:

  1. useMemo on usageChartData / toolcallsChartData / flowsChartData so
     Recharts receives stable references when only an unrelated piece
     of parent state changes (e.g. tooltip hover state).
  2. useDeferredValue(executionStats) so a period switch can repaint
     the charts first and reconcile the long list as a low-priority
     follow-up. While the deferred value is stale we dim the list to
     60% opacity, matching the existing dashboard.tsx convention.
  3. content-visibility: auto + contain-intrinsic-size on every
     FlowExecutionItem. Off-screen rows skip layout and paint entirely
     — this is the cheapest possible virtualization, with no deps,
     measurement, or scroll math.
  4. React.memo on FlowExecutionItem and TaskExecutionItem so parent
     re-renders don't traverse the entire 130-row tree.

Measured via chrome-devtools MCP performance trace:

  Before:  INP 434ms — input 1ms / processing 403ms / present 29ms
  After:   INP 134ms — input 1ms / processing 112ms / present 21ms

CLS stays at 0.00.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 09:39:24 +07:00
..
2026-03-26 06:16:07 +03:00
2026-03-26 06:16:07 +03:00
2026-03-26 06:16:07 +03:00
2026-03-26 06:16:07 +03:00
2026-03-26 06:16:07 +03:00
2026-03-26 06:16:07 +03:00
2026-04-21 01:59:08 +07:00
2026-03-26 06:16:07 +03:00

PentAGI Frontend

A chat application built with React, TypeScript, and GraphQL that enables intelligent conversations with AI agents.

Features

  • 💬 Real-time chat interface with AI agents
  • 🤖 Multiple AI agent support and management
  • 📊 Real-time terminal output monitoring
  • 🎯 Task and subtask tracking system
  • 🔍 Integrated search capabilities
  • 📚 Vector store for knowledge base management
  • 📸 Screenshot capture and management
  • 🌓 Dark/Light theme support
  • 📱 Responsive design (mobile, tablet, desktop)
  • 🔐 Authentication system with multiple providers
  • 🔄 Real-time updates via GraphQL subscriptions
  • ⚡ High-performance React components

Tech Stack

  • Framework: React 18 with TypeScript
  • Build Tool: Vite
  • Styling: Tailwind CSS
  • UI Components:
    • shadcn/ui
    • Radix UI primitives
    • Lucide icons
  • State Management:
    • React Context
    • Custom Hooks
  • API Integration:
    • GraphQL
    • Apollo Client
    • WebSocket subscriptions
  • Type Safety: TypeScript
  • Authentication: Multiple provider support
  • Code Quality:
    • ESLint
    • Prettier
    • TypeScript strict mode

Project Structure

src/ ├── components/ # Shared UI components │ ├── ui/ # Base UI components │ └── icons/ # SVG icons and logo ├── features/ # Feature-based modules │ ├── chat/ # Chat related components │ ├── authentication/ # Auth related components ├── hooks/ # Custom React hooks ├── lib/ # Utilities and configurations ├── graphql/ # GraphQL operations and types ├── models/ # TypeScript interfaces └── pages/ # Application routes

Key Components

Chat Interface

  • Split view with messages and tools panels
  • Resizable panels for desktop
  • Mobile-optimized view with tabs
  • Real-time message updates

Task System

  • Real-time task tracking
  • Subtask management
  • Progress monitoring
  • Status updates

Terminal

  • Command output display
  • Real-time updates
  • Scrollable history
  • Syntax highlighting

Vector Store

  • Knowledge base integration
  • Search capabilities
  • Data management

Agent System

  • Multi-agent support
  • Agent status monitoring
  • Agent communication logs

Development

Prerequisites

  • Node.js 18+
  • pnpm 10+

Installation

  1. Clone the repository
  2. Install dependencies: pnpm install
  3. Start the development server: pnpm run dev

Building for Production

pnpm run build

Environment Variables

Create a .env file in the root directory:

VITE_API_URL=your_api_url

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request