react-flow-advanced
Advanced React Flow Patterns
Gates (check before shipping)
Use these as sequenced checks—not “I think it works.”
- Sub-flows / groups: Pass: Every
parentIdmatches an existing nodeid; the parenttypeis registered innodeTypes; child positions are relative to the parent as intended (spot-check one drag inside/outside the group). - Custom connection line: Pass: With a valid/invalid drag, stroke or
connectionStatusvisibly differs; path renders without console errors fromgetSmoothStepPath(invalid coords). - External drag-and-drop: Pass:
onDragOveralwayspreventDefault(); drop position usesscreenToFlowPosition(not rawclientX/clientYas flow coords); new node appears under the cursor on the pane. - Undo/redo: Pass: One undo returns to the prior
{ nodes, edges }; redo restores; rapid changes do not leavecanUndo/canRedoinconsistent with visible graph (exercise add → undo → redo once). - Programmatic layout (dagre): Pass: After
setNodes, node positions match intendedrankdir;fitViewruns after layout (e.g.requestAnimationFrame) so the viewport is not stale. - Connect on drop (new node): Pass: Dropping on empty pane creates a node and an edge from the source handle; dropping on a valid target does not duplicate nodes (only the invalid-drop path adds a node).
- Selectors / store: Pass: Components that
useStorewith objects useshallow(or equivalent) so unrelated store updates do not re-render every frame.
Sub-Flows (Nested Nodes)
More from existential-birds/beagle
langgraph-code-review
Reviews LangGraph code for bugs, anti-patterns, and improvements. Use when reviewing code that uses StateGraph, nodes, edges, checkpointing, or other LangGraph features. Catches common mistakes in state management, graph structure, and async patterns.
827react-flow
React Flow (@xyflow/react) for workflow visualization with custom nodes and edges. Use when building graph visualizations, creating custom workflow nodes, implementing edge labels, or controlling viewport. Triggers on ReactFlow, @xyflow/react, Handle, NodeProps, EdgeProps, useReactFlow, fitView.
772tailwind-v4
Tailwind CSS v4 with CSS-first configuration and design tokens. Use when setting up Tailwind v4, defining theme variables, using OKLCH colors, or configuring dark mode. Triggers on @theme, @tailwindcss/vite, oklch, CSS variables, --color-, tailwind v4.
596python-code-review
Reviews Python code for type safety, async patterns, error handling, and common mistakes. Use when reviewing .py files, checking type hints, async/await usage, or exception handling.
426docling
Docling document parser for PDF, DOCX, PPTX, HTML, images, and 15+ formats. Use when parsing documents, extracting text, converting to Markdown/HTML/JSON, chunking for RAG pipelines, or batch processing files. Triggers on DocumentConverter, convert, convert_all, export_to_markdown, HierarchicalChunker, HybridChunker, ConversionResult.
378react-router-v7
React Router v7 best practices for data-driven routing. Use when implementing routes, loaders, actions, Form components, fetchers, navigation guards, protected routes, or URL search params. Triggers on createBrowserRouter, RouterProvider, useLoaderData, useActionData, useFetcher, NavLink, Outlet.
365