mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-30 06:12:06 +00:00
- Memoize onNodeClick callback in App.tsx to prevent unnecessary re-renders - Add useRef pattern in DependencyGraph to store callback without triggering useMemo recalculation when callback identity changes - Add hash-based change detection to only update ReactFlow state when actual graph data changes (node status, edges), not on every parent render - Add GraphErrorBoundary class component to catch ReactFlow rendering errors and provide a "Reload Graph" recovery button instead of blank screen - Wrap DependencyGraph with error boundary and resetKey for graceful recovery The root cause was frequent WebSocket updates during active agent sessions causing parent re-renders, which created new inline callback functions, triggering useMemo/useEffect chains that corrupted ReactFlow's internal state over time (approximately 1 minute of continuous updates). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>