flock-core 0.5.0b50__py3-none-any.whl → 0.5.0b52__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of flock-core might be problematic. Click here for more details.
- flock/dashboard/launcher.py +1 -1
- flock/frontend/README.md +678 -0
- flock/frontend/docs/DESIGN_SYSTEM.md +1980 -0
- flock/frontend/index.html +12 -0
- flock/frontend/package-lock.json +4347 -0
- flock/frontend/package.json +48 -0
- flock/frontend/src/App.tsx +79 -0
- flock/frontend/src/__tests__/e2e/critical-scenarios.test.tsx +587 -0
- flock/frontend/src/__tests__/integration/filtering-e2e.test.tsx +387 -0
- flock/frontend/src/__tests__/integration/graph-rendering.test.tsx +640 -0
- flock/frontend/src/__tests__/integration/indexeddb-persistence.test.tsx +699 -0
- flock/frontend/src/components/common/BuildInfo.tsx +39 -0
- flock/frontend/src/components/common/EmptyState.module.css +115 -0
- flock/frontend/src/components/common/EmptyState.tsx +128 -0
- flock/frontend/src/components/common/ErrorBoundary.module.css +169 -0
- flock/frontend/src/components/common/ErrorBoundary.tsx +118 -0
- flock/frontend/src/components/common/KeyboardShortcutsDialog.css +251 -0
- flock/frontend/src/components/common/KeyboardShortcutsDialog.tsx +151 -0
- flock/frontend/src/components/common/LoadingSpinner.module.css +97 -0
- flock/frontend/src/components/common/LoadingSpinner.tsx +29 -0
- flock/frontend/src/components/controls/PublishControl.css +547 -0
- flock/frontend/src/components/controls/PublishControl.test.tsx +543 -0
- flock/frontend/src/components/controls/PublishControl.tsx +432 -0
- flock/frontend/src/components/details/DetailWindowContainer.tsx +62 -0
- flock/frontend/src/components/details/LiveOutputTab.test.tsx +792 -0
- flock/frontend/src/components/details/LiveOutputTab.tsx +220 -0
- flock/frontend/src/components/details/MessageHistoryTab.tsx +299 -0
- flock/frontend/src/components/details/NodeDetailWindow.test.tsx +501 -0
- flock/frontend/src/components/details/NodeDetailWindow.tsx +218 -0
- flock/frontend/src/components/details/RunStatusTab.tsx +307 -0
- flock/frontend/src/components/details/tabs.test.tsx +1015 -0
- flock/frontend/src/components/filters/CorrelationIDFilter.module.css +102 -0
- flock/frontend/src/components/filters/CorrelationIDFilter.test.tsx +197 -0
- flock/frontend/src/components/filters/CorrelationIDFilter.tsx +121 -0
- flock/frontend/src/components/filters/FilterBar.module.css +29 -0
- flock/frontend/src/components/filters/FilterBar.test.tsx +133 -0
- flock/frontend/src/components/filters/FilterBar.tsx +33 -0
- flock/frontend/src/components/filters/FilterPills.module.css +79 -0
- flock/frontend/src/components/filters/FilterPills.test.tsx +173 -0
- flock/frontend/src/components/filters/FilterPills.tsx +67 -0
- flock/frontend/src/components/filters/TimeRangeFilter.module.css +91 -0
- flock/frontend/src/components/filters/TimeRangeFilter.test.tsx +154 -0
- flock/frontend/src/components/filters/TimeRangeFilter.tsx +105 -0
- flock/frontend/src/components/graph/AgentNode.test.tsx +75 -0
- flock/frontend/src/components/graph/AgentNode.tsx +322 -0
- flock/frontend/src/components/graph/GraphCanvas.tsx +406 -0
- flock/frontend/src/components/graph/MessageFlowEdge.tsx +128 -0
- flock/frontend/src/components/graph/MessageNode.test.tsx +62 -0
- flock/frontend/src/components/graph/MessageNode.tsx +116 -0
- flock/frontend/src/components/graph/MiniMap.tsx +47 -0
- flock/frontend/src/components/graph/TransformEdge.tsx +123 -0
- flock/frontend/src/components/layout/DashboardLayout.css +407 -0
- flock/frontend/src/components/layout/DashboardLayout.tsx +300 -0
- flock/frontend/src/components/layout/Header.module.css +88 -0
- flock/frontend/src/components/layout/Header.tsx +52 -0
- flock/frontend/src/components/modules/EventLogModule.test.tsx +401 -0
- flock/frontend/src/components/modules/EventLogModule.tsx +396 -0
- flock/frontend/src/components/modules/EventLogModuleWrapper.tsx +17 -0
- flock/frontend/src/components/modules/ModuleRegistry.test.ts +333 -0
- flock/frontend/src/components/modules/ModuleRegistry.ts +85 -0
- flock/frontend/src/components/modules/ModuleWindow.tsx +155 -0
- flock/frontend/src/components/modules/registerModules.ts +20 -0
- flock/frontend/src/components/settings/AdvancedSettings.tsx +175 -0
- flock/frontend/src/components/settings/AppearanceSettings.tsx +185 -0
- flock/frontend/src/components/settings/GraphSettings.tsx +110 -0
- flock/frontend/src/components/settings/SettingsPanel.css +327 -0
- flock/frontend/src/components/settings/SettingsPanel.tsx +131 -0
- flock/frontend/src/components/settings/ThemeSelector.tsx +298 -0
- flock/frontend/src/hooks/useKeyboardShortcuts.ts +148 -0
- flock/frontend/src/hooks/useModulePersistence.test.ts +442 -0
- flock/frontend/src/hooks/useModulePersistence.ts +154 -0
- flock/frontend/src/hooks/useModules.ts +139 -0
- flock/frontend/src/hooks/usePersistence.ts +139 -0
- flock/frontend/src/main.tsx +13 -0
- flock/frontend/src/services/api.ts +213 -0
- flock/frontend/src/services/indexeddb.test.ts +793 -0
- flock/frontend/src/services/indexeddb.ts +794 -0
- flock/frontend/src/services/layout.test.ts +437 -0
- flock/frontend/src/services/layout.ts +146 -0
- flock/frontend/src/services/themeApplicator.ts +140 -0
- flock/frontend/src/services/themeService.ts +77 -0
- flock/frontend/src/services/websocket.test.ts +595 -0
- flock/frontend/src/services/websocket.ts +685 -0
- flock/frontend/src/store/filterStore.test.ts +242 -0
- flock/frontend/src/store/filterStore.ts +103 -0
- flock/frontend/src/store/graphStore.test.ts +186 -0
- flock/frontend/src/store/graphStore.ts +414 -0
- flock/frontend/src/store/moduleStore.test.ts +253 -0
- flock/frontend/src/store/moduleStore.ts +57 -0
- flock/frontend/src/store/settingsStore.ts +188 -0
- flock/frontend/src/store/streamStore.ts +68 -0
- flock/frontend/src/store/uiStore.test.ts +54 -0
- flock/frontend/src/store/uiStore.ts +110 -0
- flock/frontend/src/store/wsStore.ts +34 -0
- flock/frontend/src/styles/index.css +15 -0
- flock/frontend/src/styles/scrollbar.css +47 -0
- flock/frontend/src/styles/variables.css +488 -0
- flock/frontend/src/test/setup.ts +1 -0
- flock/frontend/src/types/filters.ts +14 -0
- flock/frontend/src/types/graph.ts +55 -0
- flock/frontend/src/types/modules.ts +7 -0
- flock/frontend/src/types/theme.ts +55 -0
- flock/frontend/src/utils/mockData.ts +85 -0
- flock/frontend/src/utils/performance.ts +16 -0
- flock/frontend/src/utils/transforms.test.ts +860 -0
- flock/frontend/src/utils/transforms.ts +323 -0
- flock/frontend/src/vite-env.d.ts +17 -0
- flock/frontend/tsconfig.json +27 -0
- flock/frontend/tsconfig.node.json +11 -0
- flock/frontend/vite.config.ts +25 -0
- flock/frontend/vitest.config.ts +11 -0
- flock/helper/cli_helper.py +1 -1
- {flock_core-0.5.0b50.dist-info → flock_core-0.5.0b52.dist-info}/METADATA +1 -1
- {flock_core-0.5.0b50.dist-info → flock_core-0.5.0b52.dist-info}/RECORD +117 -7
- {flock_core-0.5.0b50.dist-info → flock_core-0.5.0b52.dist-info}/WHEEL +0 -0
- {flock_core-0.5.0b50.dist-info → flock_core-0.5.0b52.dist-info}/entry_points.txt +0 -0
- {flock_core-0.5.0b50.dist-info → flock_core-0.5.0b52.dist-info}/licenses/LICENSE +0 -0
flock/dashboard/launcher.py
CHANGED
|
@@ -16,7 +16,7 @@ from pathlib import Path
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
# Frontend directory location (adjacent to this dashboard package)
|
|
19
|
-
FRONTEND_DIR = Path(__file__).parent.parent
|
|
19
|
+
FRONTEND_DIR = Path(__file__).parent.parent / "frontend"
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class DashboardLauncher:
|
flock/frontend/README.md
ADDED
|
@@ -0,0 +1,678 @@
|
|
|
1
|
+
# Flock Flow Dashboard
|
|
2
|
+
|
|
3
|
+
A real-time visualization dashboard for monitoring and controlling Flock Flow agent orchestration systems. Built with modern web technologies to provide an intuitive, high-performance interface for observing multi-agent workflows.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Flock Flow Dashboard provides real-time visibility into your agent orchestration system through an interactive graph-based interface. Watch agents activate, messages flow, and data transform in real-time as your multi-agent system operates.
|
|
8
|
+
|
|
9
|
+
The dashboard offers two complementary visualization modes:
|
|
10
|
+
- **Agent View**: Shows agents as nodes with message flows as edges - perfect for understanding agent communication patterns
|
|
11
|
+
- **Blackboard View**: Shows messages as nodes with data transformations as edges - ideal for tracking data lineage and transformations
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
### Real-Time Visualization
|
|
16
|
+
- **WebSocket-Based Updates**: Live streaming of agent activations, message publications, and system events
|
|
17
|
+
- **Dual Visualization Modes**: Switch between agent-centric and message-centric views
|
|
18
|
+
- **Interactive Graph**: Drag nodes, zoom, pan, and explore your system's topology
|
|
19
|
+
- **Auto-Layout**: Intelligent graph layout using the Dagre algorithm for optimal node positioning
|
|
20
|
+
|
|
21
|
+
### Advanced Filtering
|
|
22
|
+
- **Correlation ID Tracking**: Filter all views by correlation ID to trace individual workflows
|
|
23
|
+
- **Time Range Filtering**: Focus on specific time windows with preset ranges (last 5/10/60 minutes) or custom ranges
|
|
24
|
+
- **Active Filter Pills**: Visual indicators of active filters with one-click removal
|
|
25
|
+
- **Autocomplete Search**: Quick correlation ID selection with metadata preview
|
|
26
|
+
|
|
27
|
+
### Node Details & Monitoring
|
|
28
|
+
- **Floating Detail Windows**: Double-click any node to open a draggable, resizable detail window
|
|
29
|
+
- **Live Output Tab**: Stream real-time output from agents with color-coded message types
|
|
30
|
+
- **Message History**: View all consumed and published messages with full JSON payloads
|
|
31
|
+
- **Run Status**: Track agent execution history with timing, status, and metrics
|
|
32
|
+
- **Multi-Window Support**: Open multiple detail windows simultaneously for comparison
|
|
33
|
+
|
|
34
|
+
### Extensible Module System
|
|
35
|
+
- **Custom Visualizations**: Add specialized views via the module system
|
|
36
|
+
- **Event Log Module**: Built-in table view for detailed event inspection
|
|
37
|
+
- **Context Menu Integration**: Right-click to add modules at any location
|
|
38
|
+
- **Persistent Layout**: Module positions and sizes are saved across sessions
|
|
39
|
+
|
|
40
|
+
### Modern UI/UX
|
|
41
|
+
- **Glassmorphism Design**: Modern dark theme with semi-transparent surfaces and blur effects
|
|
42
|
+
- **Keyboard Shortcuts**: Navigate efficiently with Ctrl+M, Ctrl+F, and Esc
|
|
43
|
+
- **Responsive Layout**: Adapts to different screen sizes and orientations
|
|
44
|
+
- **Smooth Animations**: Polished transitions and visual feedback
|
|
45
|
+
|
|
46
|
+
## Getting Started
|
|
47
|
+
|
|
48
|
+
### Prerequisites
|
|
49
|
+
|
|
50
|
+
- **Node.js**: Version 18 or higher
|
|
51
|
+
- **Package Manager**: npm (included with Node.js) or yarn
|
|
52
|
+
- **Flock Flow Backend**: Running orchestrator instance (typically on port 8000)
|
|
53
|
+
|
|
54
|
+
### Installation
|
|
55
|
+
|
|
56
|
+
1. Navigate to the frontend directory:
|
|
57
|
+
```bash
|
|
58
|
+
cd frontend
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
2. Install dependencies:
|
|
62
|
+
```bash
|
|
63
|
+
npm install
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Running the Development Server
|
|
67
|
+
|
|
68
|
+
Start the Vite development server:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm run dev
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The dashboard will be available at `http://localhost:5173`
|
|
75
|
+
|
|
76
|
+
The dev server includes:
|
|
77
|
+
- Hot module replacement (HMR) for instant updates
|
|
78
|
+
- Proxy configuration for API and WebSocket connections
|
|
79
|
+
- Source maps for debugging
|
|
80
|
+
- Fast refresh for React components
|
|
81
|
+
|
|
82
|
+
### Building for Production
|
|
83
|
+
|
|
84
|
+
Create an optimized production build:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run build
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
This will:
|
|
91
|
+
- Compile TypeScript to optimized JavaScript
|
|
92
|
+
- Bundle and minify all assets
|
|
93
|
+
- Generate source maps
|
|
94
|
+
- Output to the `dist/` directory
|
|
95
|
+
|
|
96
|
+
To preview the production build locally:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
npm run preview
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Environment Configuration
|
|
103
|
+
|
|
104
|
+
The dashboard can be configured via environment variables:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# .env file
|
|
108
|
+
VITE_WS_URL=ws://localhost:8000/ws
|
|
109
|
+
VITE_API_URL=http://localhost:8000/api
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
If not specified, defaults to `localhost:8000`.
|
|
113
|
+
|
|
114
|
+
## Design System
|
|
115
|
+
|
|
116
|
+
The dashboard follows a comprehensive design system documented in [`docs/DESIGN_SYSTEM.md`](/Users/ara/Work/flock-flow/frontend/docs/DESIGN_SYSTEM.md).
|
|
117
|
+
|
|
118
|
+
### Design Philosophy
|
|
119
|
+
|
|
120
|
+
1. **Dark-First Design**: Optimized for extended viewing sessions with reduced eye strain
|
|
121
|
+
2. **Information Hierarchy**: Critical data accessible within 5 seconds
|
|
122
|
+
3. **Premium Aesthetic**: Modern, sleek, professional appearance inspired by AutoGen Studio and Flowise AI
|
|
123
|
+
4. **Depth & Dimension**: Glassmorphism and elevation for spatial clarity
|
|
124
|
+
5. **Purposeful Motion**: Smooth, meaningful animations that enhance UX
|
|
125
|
+
|
|
126
|
+
### Color System
|
|
127
|
+
|
|
128
|
+
The design uses a carefully crafted color palette:
|
|
129
|
+
- **Backgrounds**: Layered depth from `#0a0a0b` (base) to `#2a2a32` (floating windows)
|
|
130
|
+
- **Primary Brand**: Indigo (`#6366f1`) for actions and selections
|
|
131
|
+
- **Status Colors**: Success (green), Warning (amber), Error (red), Info (blue)
|
|
132
|
+
- **Graph-Specific**: Distinct colors for agent nodes (blue border) and message nodes (amber border)
|
|
133
|
+
|
|
134
|
+
All color combinations meet WCAG 2.1 AA accessibility standards with minimum 4.5:1 contrast ratios.
|
|
135
|
+
|
|
136
|
+
### Typography
|
|
137
|
+
|
|
138
|
+
- **Font Family**: Inter for UI text, JetBrains Mono for code
|
|
139
|
+
- **Scale**: 8px base grid with systematic font sizes from 10px to 72px
|
|
140
|
+
- **Weights**: Light (300) to Bold (700) for hierarchy
|
|
141
|
+
- **Line Heights**: Optimized for readability (1.1 tight to 2.0 loose)
|
|
142
|
+
|
|
143
|
+
See [`DESIGN_SYSTEM.md`](/Users/ara/Work/flock-flow/frontend/docs/DESIGN_SYSTEM.md) for complete specifications.
|
|
144
|
+
|
|
145
|
+
## Architecture
|
|
146
|
+
|
|
147
|
+
### High-Level Structure
|
|
148
|
+
|
|
149
|
+
The dashboard is built as a single-page application (SPA) using React with TypeScript:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
┌─────────────────────────────────────────────────┐
|
|
153
|
+
│ DashboardLayout │
|
|
154
|
+
├─────────────────────────────────────────────────┤
|
|
155
|
+
│ Header (Mode Toggle, Controls) │
|
|
156
|
+
│ FilterBar (Correlation ID, Time Range) │
|
|
157
|
+
│ ┌──────────────────────┬─────────────────────┐│
|
|
158
|
+
│ │ GraphCanvas │ Controls Sidebar ││
|
|
159
|
+
│ │ (React Flow) │ (Publish/Invoke) ││
|
|
160
|
+
│ │ │ ││
|
|
161
|
+
│ │ - Agent Nodes │ ││
|
|
162
|
+
│ │ - Message Nodes │ ││
|
|
163
|
+
│ │ - Edges │ ││
|
|
164
|
+
│ │ - MiniMap │ ││
|
|
165
|
+
│ └──────────────────────┴─────────────────────┘│
|
|
166
|
+
│ DetailWindowContainer (Floating Windows) │
|
|
167
|
+
│ ModuleWindows (Custom Visualizations) │
|
|
168
|
+
└─────────────────────────────────────────────────┘
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### State Management (Zustand)
|
|
172
|
+
|
|
173
|
+
The application uses Zustand for centralized state management with 6 specialized stores:
|
|
174
|
+
|
|
175
|
+
1. **graphStore**: Agents, messages, events, runs, nodes, edges
|
|
176
|
+
2. **uiStore**: Visualization mode, selection state, detail windows
|
|
177
|
+
3. **filterStore**: Correlation ID filter, time range filter
|
|
178
|
+
4. **streamStore**: Live streaming output from agents
|
|
179
|
+
5. **wsStore**: WebSocket connection state and health
|
|
180
|
+
6. **moduleStore**: Module instances and configurations
|
|
181
|
+
|
|
182
|
+
Each store is:
|
|
183
|
+
- Type-safe with TypeScript interfaces
|
|
184
|
+
- Devtools-enabled for debugging
|
|
185
|
+
- Persisted where appropriate (UI preferences, filters)
|
|
186
|
+
|
|
187
|
+
### Data Flow
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
WebSocket Connection
|
|
191
|
+
↓
|
|
192
|
+
Event Reception (websocket.ts)
|
|
193
|
+
↓
|
|
194
|
+
Store Updates (graphStore, streamStore)
|
|
195
|
+
↓
|
|
196
|
+
React Components Re-render
|
|
197
|
+
↓
|
|
198
|
+
Graph Regeneration (generateAgentViewGraph / generateBlackboardViewGraph)
|
|
199
|
+
↓
|
|
200
|
+
React Flow Rendering
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Key Services
|
|
204
|
+
|
|
205
|
+
- **websocket.ts**: Manages WebSocket connection with auto-reconnection and exponential backoff
|
|
206
|
+
- **indexeddb.ts**: Browser-native persistence with 7 object stores and LRU eviction
|
|
207
|
+
- **layout.ts**: Dagre-based automatic graph layout algorithm
|
|
208
|
+
- **api.ts**: REST API client for publish/invoke operations
|
|
209
|
+
|
|
210
|
+
## Key Components
|
|
211
|
+
|
|
212
|
+
### GraphCanvas
|
|
213
|
+
The main visualization component using React Flow v12.
|
|
214
|
+
|
|
215
|
+
**Features**:
|
|
216
|
+
- Custom node types (AgentNode, MessageNode)
|
|
217
|
+
- Custom edge types (MessageFlowEdge, TransformEdge)
|
|
218
|
+
- Drag-and-drop node positioning with persistence
|
|
219
|
+
- Double-click to open detail windows
|
|
220
|
+
- Right-click context menu for auto-layout and modules
|
|
221
|
+
|
|
222
|
+
**Location**: `src/components/graph/GraphCanvas.tsx`
|
|
223
|
+
|
|
224
|
+
### AgentNode
|
|
225
|
+
Displays agent information in the graph.
|
|
226
|
+
|
|
227
|
+
**Shows**:
|
|
228
|
+
- Agent name
|
|
229
|
+
- Status indicator (running/idle/error) with color coding
|
|
230
|
+
- Message type subscriptions as badges
|
|
231
|
+
- Consumed/published message counts
|
|
232
|
+
|
|
233
|
+
**Interactions**:
|
|
234
|
+
- Drag to reposition
|
|
235
|
+
- Double-click to open detail window
|
|
236
|
+
- Click to select
|
|
237
|
+
|
|
238
|
+
**Location**: `src/components/graph/AgentNode.tsx`
|
|
239
|
+
|
|
240
|
+
### MessageNode
|
|
241
|
+
Displays message information in blackboard view.
|
|
242
|
+
|
|
243
|
+
**Shows**:
|
|
244
|
+
- Message type
|
|
245
|
+
- Correlation ID
|
|
246
|
+
- Content preview (first 50 characters)
|
|
247
|
+
- Timestamp
|
|
248
|
+
|
|
249
|
+
**Interactions**:
|
|
250
|
+
- Drag to reposition
|
|
251
|
+
- Double-click to open detail window
|
|
252
|
+
- Click to select
|
|
253
|
+
|
|
254
|
+
**Location**: `src/components/graph/MessageNode.tsx`
|
|
255
|
+
|
|
256
|
+
### NodeDetailWindow
|
|
257
|
+
Draggable, resizable floating window with three tabs.
|
|
258
|
+
|
|
259
|
+
**Tabs**:
|
|
260
|
+
1. **Live Output**: Real-time streaming output with color-coded types
|
|
261
|
+
2. **Message History**: Table of consumed/published messages
|
|
262
|
+
3. **Run Status**: Historical execution runs with metrics
|
|
263
|
+
|
|
264
|
+
**Features**:
|
|
265
|
+
- Virtualized rendering for 1000+ output lines
|
|
266
|
+
- Expandable JSON payloads
|
|
267
|
+
- Auto-scroll to bottom (toggleable)
|
|
268
|
+
- Persistent position and size
|
|
269
|
+
|
|
270
|
+
**Location**: `src/components/details/NodeDetailWindow.tsx`
|
|
271
|
+
|
|
272
|
+
### FilterBar
|
|
273
|
+
Global filtering interface in the dashboard header.
|
|
274
|
+
|
|
275
|
+
**Filters**:
|
|
276
|
+
- **Correlation ID**: Autocomplete dropdown with recent IDs
|
|
277
|
+
- **Time Range**: Presets (5m, 10m, 1h) or custom range
|
|
278
|
+
|
|
279
|
+
**Features**:
|
|
280
|
+
- Active filter pills with remove buttons
|
|
281
|
+
- Keyboard shortcut (Ctrl+F) to focus
|
|
282
|
+
- Real-time filter application
|
|
283
|
+
- Combined filter strategy
|
|
284
|
+
|
|
285
|
+
**Location**: `src/components/filters/FilterBar.tsx`
|
|
286
|
+
|
|
287
|
+
### EventLogModule
|
|
288
|
+
Extensible table view for detailed event inspection.
|
|
289
|
+
|
|
290
|
+
**Features**:
|
|
291
|
+
- Sortable columns (timestamp, type, agent, correlation ID)
|
|
292
|
+
- Expandable rows for full JSON payloads
|
|
293
|
+
- Filtering integration with global filters
|
|
294
|
+
- Dark theme with glassmorphism
|
|
295
|
+
- Empty state messaging
|
|
296
|
+
|
|
297
|
+
**Location**: `src/components/modules/EventLogModule.tsx`
|
|
298
|
+
|
|
299
|
+
### ModuleWindow
|
|
300
|
+
Generic draggable, resizable window wrapper for modules.
|
|
301
|
+
|
|
302
|
+
**Features**:
|
|
303
|
+
- Position and size persistence
|
|
304
|
+
- Close button
|
|
305
|
+
- Dark theme integration
|
|
306
|
+
- Z-index management
|
|
307
|
+
|
|
308
|
+
**Location**: `src/components/modules/ModuleWindow.tsx`
|
|
309
|
+
|
|
310
|
+
## Keyboard Shortcuts ⌨️
|
|
311
|
+
|
|
312
|
+
The dashboard supports comprehensive keyboard shortcuts for efficient navigation and control:
|
|
313
|
+
|
|
314
|
+
### Panel Controls
|
|
315
|
+
|
|
316
|
+
| Shortcut | Action | Description |
|
|
317
|
+
|----------|--------|-------------|
|
|
318
|
+
| `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) | Toggle Publish Panel | Open/close the publish control panel |
|
|
319
|
+
| `Ctrl+Shift+D` (or `Cmd+Shift+D` on Mac) | Toggle Agent Details | Show/hide agent detail windows for all agents |
|
|
320
|
+
| `Ctrl+Shift+F` (or `Cmd+Shift+F` on Mac) | Toggle Filters Panel | Open/close the filters panel |
|
|
321
|
+
| `Ctrl+,` (or `Cmd+,` on Mac) | Toggle Settings Panel | Open/close the settings panel |
|
|
322
|
+
|
|
323
|
+
### Navigation
|
|
324
|
+
|
|
325
|
+
| Shortcut | Action | Description |
|
|
326
|
+
|----------|--------|-------------|
|
|
327
|
+
| `Ctrl+M` (or `Cmd+M` on Mac) | Toggle View Mode | Switch between Agent View and Blackboard View |
|
|
328
|
+
| `Ctrl+F` (or `Cmd+F` on Mac) | Focus Filter | Focus the correlation ID filter input for quick searching |
|
|
329
|
+
| `Esc` | Close Windows | Close all open detail windows and panels (priority order) |
|
|
330
|
+
|
|
331
|
+
### Help
|
|
332
|
+
|
|
333
|
+
| Shortcut | Action | Description |
|
|
334
|
+
|----------|--------|-------------|
|
|
335
|
+
| `Ctrl+/` (or `Cmd+/` on Mac) | Show Keyboard Shortcuts | Open the keyboard shortcuts help dialog |
|
|
336
|
+
|
|
337
|
+
**Implementation**: See `src/hooks/useKeyboardShortcuts.ts` and `src/components/common/KeyboardShortcutsDialog.tsx`
|
|
338
|
+
|
|
339
|
+
### Accessibility Features
|
|
340
|
+
|
|
341
|
+
The dashboard is **WCAG 2.1 AA compliant** with:
|
|
342
|
+
- All buttons have proper ARIA attributes (`aria-pressed`, `aria-label`)
|
|
343
|
+
- Dynamic state indication for screen readers
|
|
344
|
+
- Keyboard-only navigation support
|
|
345
|
+
- Platform-aware shortcuts (⌘ on Mac, Ctrl on Windows/Linux)
|
|
346
|
+
- Help button (?) in toolbar for discoverability
|
|
347
|
+
|
|
348
|
+
### Using Keyboard Shortcuts
|
|
349
|
+
|
|
350
|
+
**Quick Access to Help**:
|
|
351
|
+
```
|
|
352
|
+
Press Ctrl+/ to see all available keyboard shortcuts in a beautiful modal dialog
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
**Toggle Panels**:
|
|
356
|
+
```
|
|
357
|
+
Press Ctrl+Shift+P to open/close the Publish panel
|
|
358
|
+
Press Ctrl+Shift+D to show/hide all agent detail windows
|
|
359
|
+
Press Ctrl+Shift+F to open/close filters
|
|
360
|
+
Press Ctrl+, to open/close settings
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**Navigate Views**:
|
|
364
|
+
```
|
|
365
|
+
Press Ctrl+M to quickly switch between Agent View and Blackboard View
|
|
366
|
+
Press Ctrl+F to focus the filter input
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
**Close Everything**:
|
|
370
|
+
```
|
|
371
|
+
Press Esc to close panels and windows (follows priority: Settings → Publish → Filters → Detail Windows)
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
## Development
|
|
375
|
+
|
|
376
|
+
### Adding New Features
|
|
377
|
+
|
|
378
|
+
The dashboard is designed for extensibility. Here are common development tasks:
|
|
379
|
+
|
|
380
|
+
#### Adding a New Module
|
|
381
|
+
|
|
382
|
+
1. Create the module component:
|
|
383
|
+
```typescript
|
|
384
|
+
// src/components/modules/MyModule.tsx
|
|
385
|
+
import { ModuleContext } from './ModuleRegistry';
|
|
386
|
+
|
|
387
|
+
interface MyModuleProps {
|
|
388
|
+
context: ModuleContext;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export const MyModule: React.FC<MyModuleProps> = ({ context }) => {
|
|
392
|
+
const { agents, messages, events } = context;
|
|
393
|
+
|
|
394
|
+
return (
|
|
395
|
+
<div>
|
|
396
|
+
{/* Your module UI */}
|
|
397
|
+
</div>
|
|
398
|
+
);
|
|
399
|
+
};
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
2. Register the module:
|
|
403
|
+
```typescript
|
|
404
|
+
// src/components/modules/registerModules.ts
|
|
405
|
+
import { moduleRegistry } from './ModuleRegistry';
|
|
406
|
+
import { MyModule } from './MyModule';
|
|
407
|
+
|
|
408
|
+
moduleRegistry.register({
|
|
409
|
+
id: 'my-module',
|
|
410
|
+
name: 'My Module',
|
|
411
|
+
icon: '📊',
|
|
412
|
+
component: MyModule,
|
|
413
|
+
defaultSize: { width: 600, height: 400 },
|
|
414
|
+
});
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
3. The module will appear in the right-click context menu automatically.
|
|
418
|
+
|
|
419
|
+
#### Adding a New Node Type
|
|
420
|
+
|
|
421
|
+
1. Create the node component in `src/components/graph/`
|
|
422
|
+
2. Register in `GraphCanvas.tsx`:
|
|
423
|
+
```typescript
|
|
424
|
+
const nodeTypes = useMemo(
|
|
425
|
+
() => ({
|
|
426
|
+
agent: AgentNode,
|
|
427
|
+
message: MessageNode,
|
|
428
|
+
myCustomNode: MyCustomNode, // Add here
|
|
429
|
+
}),
|
|
430
|
+
[]
|
|
431
|
+
);
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
3. Update graph generation logic in `graphStore.ts`
|
|
435
|
+
|
|
436
|
+
#### Adding a New Filter
|
|
437
|
+
|
|
438
|
+
1. Create the filter component in `src/components/filters/`
|
|
439
|
+
2. Add state to `filterStore.ts`
|
|
440
|
+
3. Integrate into `FilterBar.tsx`
|
|
441
|
+
4. Update filter application logic in `graphStore.ts`
|
|
442
|
+
|
|
443
|
+
### Testing
|
|
444
|
+
|
|
445
|
+
The dashboard has comprehensive test coverage (367 tests):
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
# Run all tests
|
|
449
|
+
npm run test
|
|
450
|
+
|
|
451
|
+
# Run specific test suite
|
|
452
|
+
npm run test graphStore.test.ts
|
|
453
|
+
|
|
454
|
+
# Run with UI
|
|
455
|
+
npm run test:ui
|
|
456
|
+
|
|
457
|
+
# Run with coverage
|
|
458
|
+
npm run test -- --coverage
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
**Test Categories**:
|
|
462
|
+
- **Unit Tests**: Component rendering, state management, utilities
|
|
463
|
+
- **Integration Tests**: Multi-component interactions, data flow
|
|
464
|
+
- **E2E Tests**: Critical user scenarios, performance benchmarks
|
|
465
|
+
|
|
466
|
+
**Key Test Files**:
|
|
467
|
+
- `src/store/*.test.ts` - State management tests
|
|
468
|
+
- `src/components/**/*.test.tsx` - Component tests
|
|
469
|
+
- `src/__tests__/integration/*.test.tsx` - Integration tests
|
|
470
|
+
- `src/__tests__/e2e/*.test.tsx` - End-to-end tests
|
|
471
|
+
|
|
472
|
+
### Linting and Type Checking
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
# Type check without emitting files
|
|
476
|
+
npm run type-check
|
|
477
|
+
|
|
478
|
+
# The project uses TypeScript strict mode
|
|
479
|
+
# All code must compile with zero type errors
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
### Code Style Guidelines
|
|
483
|
+
|
|
484
|
+
1. **TypeScript**: Use strict mode, avoid `any` types
|
|
485
|
+
2. **React**: Functional components with hooks
|
|
486
|
+
3. **State**: Use Zustand stores, not local state for shared data
|
|
487
|
+
4. **Styling**: Inline styles using CSS variables from design system
|
|
488
|
+
5. **Performance**: Memoize expensive computations, use React.memo sparingly
|
|
489
|
+
6. **Testing**: Write tests for new features, maintain coverage
|
|
490
|
+
|
|
491
|
+
## Troubleshooting
|
|
492
|
+
|
|
493
|
+
### Dashboard Not Loading
|
|
494
|
+
|
|
495
|
+
**Symptom**: Blank screen or loading spinner
|
|
496
|
+
|
|
497
|
+
**Solutions**:
|
|
498
|
+
1. Check browser console for errors (F12)
|
|
499
|
+
2. Verify backend is running on port 8000
|
|
500
|
+
3. Check WebSocket connection status in UI
|
|
501
|
+
4. Clear IndexedDB: Open DevTools → Application → IndexedDB → Delete
|
|
502
|
+
5. Clear localStorage: `localStorage.clear()` in console
|
|
503
|
+
|
|
504
|
+
### WebSocket Connection Issues
|
|
505
|
+
|
|
506
|
+
**Symptom**: "Disconnected" status indicator
|
|
507
|
+
|
|
508
|
+
**Solutions**:
|
|
509
|
+
1. Verify backend WebSocket endpoint is accessible: `ws://localhost:8000/ws`
|
|
510
|
+
2. Check for CORS issues in browser console
|
|
511
|
+
3. Check network tab for WebSocket connection attempts
|
|
512
|
+
4. Restart the backend server
|
|
513
|
+
5. Dashboard will auto-reconnect with exponential backoff
|
|
514
|
+
|
|
515
|
+
### Graph Performance Issues
|
|
516
|
+
|
|
517
|
+
**Symptom**: Slow rendering or laggy interactions
|
|
518
|
+
|
|
519
|
+
**Solutions**:
|
|
520
|
+
1. Reduce node count by filtering (use correlation ID or time range)
|
|
521
|
+
2. Close unnecessary detail windows
|
|
522
|
+
3. Check browser performance tab for bottlenecks
|
|
523
|
+
4. Clear old data: Click "Clear all dashboard data" button in header
|
|
524
|
+
5. Disable browser extensions that may interfere
|
|
525
|
+
|
|
526
|
+
### Filter Not Working
|
|
527
|
+
|
|
528
|
+
**Symptom**: Graph not updating when filter applied
|
|
529
|
+
|
|
530
|
+
**Solutions**:
|
|
531
|
+
1. Ensure filter is active (check filter pills)
|
|
532
|
+
2. Verify data exists for the filter criteria
|
|
533
|
+
3. Check browser console for errors
|
|
534
|
+
4. Clear filters and re-apply
|
|
535
|
+
5. Refresh the page
|
|
536
|
+
|
|
537
|
+
### Detail Window Not Opening
|
|
538
|
+
|
|
539
|
+
**Symptom**: Double-click does not open window
|
|
540
|
+
|
|
541
|
+
**Solutions**:
|
|
542
|
+
1. Try single-clicking first to select the node
|
|
543
|
+
2. Check if maximum window limit reached (close some windows)
|
|
544
|
+
3. Check browser console for errors
|
|
545
|
+
4. Verify node data exists in store
|
|
546
|
+
|
|
547
|
+
### IndexedDB Quota Exceeded
|
|
548
|
+
|
|
549
|
+
**Symptom**: Warning about storage quota
|
|
550
|
+
|
|
551
|
+
**Solutions**:
|
|
552
|
+
1. Dashboard uses LRU eviction automatically at 80% quota
|
|
553
|
+
2. Manually clear old data using "Clear all dashboard data" button
|
|
554
|
+
3. Check browser storage settings
|
|
555
|
+
4. Dashboard targets 60% quota after eviction
|
|
556
|
+
|
|
557
|
+
### Build Errors
|
|
558
|
+
|
|
559
|
+
**Symptom**: `npm run build` fails
|
|
560
|
+
|
|
561
|
+
**Solutions**:
|
|
562
|
+
1. Run `npm install` to ensure dependencies are up-to-date
|
|
563
|
+
2. Check for TypeScript errors: `npm run type-check`
|
|
564
|
+
3. Clear node_modules and reinstall: `rm -rf node_modules && npm install`
|
|
565
|
+
4. Check Node.js version (must be 18+)
|
|
566
|
+
|
|
567
|
+
### Common Error Messages
|
|
568
|
+
|
|
569
|
+
**"WebSocket connection failed"**
|
|
570
|
+
- Backend is not running or not accessible
|
|
571
|
+
- Check `VITE_WS_URL` environment variable
|
|
572
|
+
|
|
573
|
+
**"Failed to fetch artifact types"**
|
|
574
|
+
- REST API endpoint not available
|
|
575
|
+
- Check `VITE_API_URL` environment variable
|
|
576
|
+
|
|
577
|
+
**"QuotaExceededError"**
|
|
578
|
+
- Browser storage full
|
|
579
|
+
- LRU eviction will trigger automatically
|
|
580
|
+
- Manually clear data if needed
|
|
581
|
+
|
|
582
|
+
## Performance Targets
|
|
583
|
+
|
|
584
|
+
The dashboard is optimized for high performance:
|
|
585
|
+
|
|
586
|
+
| Metric | Target | Description |
|
|
587
|
+
|--------|--------|-------------|
|
|
588
|
+
| Initial Render | <200ms | Time to first paint |
|
|
589
|
+
| Graph Regeneration | <100ms | View mode switch or filter application |
|
|
590
|
+
| Position Save | <50ms | Node position persistence after drag |
|
|
591
|
+
| Position Load | <100ms | Restore positions on startup |
|
|
592
|
+
| WebSocket Latency | <50ms | Event processing time |
|
|
593
|
+
| Filter Application | <100ms | Filter criteria change to graph update |
|
|
594
|
+
| Autocomplete Response | <50ms | Correlation ID search results |
|
|
595
|
+
|
|
596
|
+
**Actual Performance**: All targets consistently met, with initial render averaging 8.9ms (22x faster than target).
|
|
597
|
+
|
|
598
|
+
## Browser Support
|
|
599
|
+
|
|
600
|
+
The dashboard requires a modern browser with support for:
|
|
601
|
+
- **ES2020+** JavaScript features
|
|
602
|
+
- **WebSocket API** for real-time updates
|
|
603
|
+
- **IndexedDB API** for persistence
|
|
604
|
+
- **CSS Grid and Flexbox** for layout
|
|
605
|
+
- **CSS Custom Properties** (variables) for theming
|
|
606
|
+
|
|
607
|
+
**Recommended Browsers**:
|
|
608
|
+
- Chrome/Edge 90+
|
|
609
|
+
- Firefox 88+
|
|
610
|
+
- Safari 14+
|
|
611
|
+
|
|
612
|
+
## Contributing
|
|
613
|
+
|
|
614
|
+
We welcome contributions! Please follow these guidelines:
|
|
615
|
+
|
|
616
|
+
1. **Code Style**: Follow existing patterns, use TypeScript strict mode
|
|
617
|
+
2. **Testing**: Write tests for new features, maintain coverage
|
|
618
|
+
3. **Documentation**: Update README and DESIGN_SYSTEM.md as needed
|
|
619
|
+
4. **Performance**: Keep within performance targets
|
|
620
|
+
5. **Accessibility**: Maintain WCAG 2.1 AA compliance
|
|
621
|
+
|
|
622
|
+
### Development Workflow
|
|
623
|
+
|
|
624
|
+
1. Fork the repository
|
|
625
|
+
2. Create a feature branch: `git checkout -b feature/my-feature`
|
|
626
|
+
3. Make changes with tests
|
|
627
|
+
4. Run tests: `npm run test`
|
|
628
|
+
5. Type check: `npm run type-check`
|
|
629
|
+
6. **Build production bundle: `npm run build`** ⚠️ **REQUIRED - MUST pass without errors!**
|
|
630
|
+
7. Commit changes: `git commit -m "feat: add my feature"`
|
|
631
|
+
8. Push to branch: `git push origin feature/my-feature`
|
|
632
|
+
9. Create a pull request
|
|
633
|
+
|
|
634
|
+
### 🚨 Critical Build Requirement
|
|
635
|
+
|
|
636
|
+
**Before committing any UI/frontend changes:**
|
|
637
|
+
|
|
638
|
+
```bash
|
|
639
|
+
npm run build
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
**This MUST complete successfully with:**
|
|
643
|
+
- ✅ Zero TypeScript compilation errors
|
|
644
|
+
- ✅ Zero linting errors
|
|
645
|
+
- ✅ No runtime errors in production build
|
|
646
|
+
|
|
647
|
+
**Failure to build is a blocking issue - do not commit broken builds!**
|
|
648
|
+
|
|
649
|
+
The build process:
|
|
650
|
+
1. Compiles TypeScript (`tsc`)
|
|
651
|
+
2. Bundles and optimizes with Vite
|
|
652
|
+
3. Outputs to `dist/` directory
|
|
653
|
+
4. Shows any errors or warnings
|
|
654
|
+
|
|
655
|
+
If the build fails, fix all errors before committing. Common issues:
|
|
656
|
+
- TypeScript type errors (check with `npm run type-check`)
|
|
657
|
+
- Missing dependencies (run `npm install`)
|
|
658
|
+
- Import errors or circular dependencies
|
|
659
|
+
- Invalid JSX or syntax errors
|
|
660
|
+
|
|
661
|
+
## License
|
|
662
|
+
|
|
663
|
+
MIT License - see LICENSE file for details
|
|
664
|
+
|
|
665
|
+
## Additional Resources
|
|
666
|
+
|
|
667
|
+
- **Design System**: [`docs/DESIGN_SYSTEM.md`](/Users/ara/Work/flock-flow/frontend/docs/DESIGN_SYSTEM.md)
|
|
668
|
+
- **Product Requirements**: `docs/specs/003-real-time-dashboard/PRD.md`
|
|
669
|
+
- **Solution Design**: `docs/specs/003-real-time-dashboard/SDD.md`
|
|
670
|
+
- **Implementation Plan**: `docs/specs/003-real-time-dashboard/PLAN.md`
|
|
671
|
+
- **Backend Documentation**: `../README.md`
|
|
672
|
+
|
|
673
|
+
## Support
|
|
674
|
+
|
|
675
|
+
For issues, questions, or contributions:
|
|
676
|
+
- Open an issue on GitHub
|
|
677
|
+
- Check existing documentation
|
|
678
|
+
- Review test files for usage examples
|