mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
Add handling for config assets in the Qt6 frontend generator: generate_cmake.py now discovers config files (find_config_files) and includes their QML/JS entries and JSON resources in the generated lists. CMakeLists.txt was updated to use ../../qml/qt6 path prefixes for root QML files, to include numerous config JSON/JS resources, and to update the auto-generated header file counts. Also rename several frontend docs into frontends/qt6/docs/.
4.1 KiB
4.1 KiB
Phase 9: Visual Workflow Canvas + Frontend Parity
Status: Complete Started: 2026-03-19
Part A: QML Workflow Canvas (PRIMARY)
Replace the list-based WorkflowEditor with a spatial infinite canvas.
Steps
-
Step 1: NodeRegistry C++ class ✓
- New
src/NodeRegistry.h+src/NodeRegistry.cpp - Reads
workflow/plugins/registry/node-registry.json - Exposes
nodeTypes(),groups(),nodeType(name),nodesByGroup(),searchNodes()to QML - Registered as context property
NodeRegistryinmain.cpp - Auto-discovered by
generate_cmake.py(6 C++ sources total)
- New
-
Step 2: Canvas Infrastructure ✓
Flickable5000x5000 with grid backgroundScaletransform for zoom (0.25x–2x)- Mousewheel zoom, zoom overlay with +/- buttons
Canvas2D connection layer +Repeaternode layer
-
Step 3: WorkflowNode Component ✓
qmllib/MetaBuilder/WorkflowNode.qmlwith DragHandler- Colored header by group (prefix-based color mapping)
- Input ports (left, blue), output ports (right, green)
- Click-to-select with visual highlight
- Inline node delegates in WorkflowEditor for tight integration
-
Step 4: Bezier Connection Drawing ✓
- QML
Canvaswithcontext.bezierCurveTo() - Parses n8n-style
connectionsadjacency map - Control points offset 40% of horizontal distance
- Arrow heads at destination ports
- Dashed line for connection being drawn
requestPaint()on node drag and connection changes
- QML
-
Step 5: Node Palette (Left Sidebar) ✓
- ListView from
NodeRegistry.nodeTypesfiltered by search + group - Group filter chips (All, core, logic, transform, integration, etc.)
- Double-click to add at canvas center
Drag.active+DropAreafor drag-to-canvas
- ListView from
-
Step 6: Properties Panel (Right Sidebar) ✓
- Animated slide-in panel (300px)
- Name (editable), Type (badge with group color)
- Parameters from
NodeRegistry.nodeType()schema - Dynamic text fields and dropdowns for property options
- Input/output port display with chips
- Workflow variables display
- Position readout, Delete button
-
Step 7: Workflow I/O ✓
- Full n8n-style JSON: name, active, settings, tags, meta, variables, nodes, connections
- DBAL load/save via
DBALProvider.list/create/update/remove - Mock workflows with realistic graph layouts as fallback
- Add/remove nodes + connections with proper cleanup
Files
| File | Action |
|---|---|
WorkflowEditor.qml |
Full rewrite — spatial canvas |
qmllib/MetaBuilder/WorkflowNode.qml |
New — draggable node component |
src/NodeRegistry.h |
New — C++ node type loader |
src/NodeRegistry.cpp |
New — implementation |
main.cpp |
Register NodeRegistry context property |
CMakeLists.txt |
Add NodeRegistry to sources |
Verification
- Build compiles clean
- God Panel → Workflows tab shows canvas
- Pan (scroll) + zoom (Ctrl+scroll) works
- Load
seed_game.json(58 nodes) renders correctly - Drag from palette → node on canvas
- Port-to-port connection drawing
- Properties panel for selected node
- Save roundtrip to DBAL
Part B: Next.js Frontend Alignment ✓
- AppShell with 5-level auth gating (Guest → SuperGod)
- Sidebar with static core items + dynamic DBAL package nav
- God Panel with 10 tabs (schemas, workflows, packages, users, DB, etc.)
- Super God Panel with multi-tenant control
- JSON-driven config (sidebar-config.json, god-panel-config.json)
- Workflow editor integration via WorkflowBuilder component
Part C: CLI Feature Parity ✓
workflow list/get/run/create/statuscommandspackage list/install/uninstall/info/searchcommands- Formatted table + JSON output, DBAL REST API backed
Reusable Code
DBALProvider.qml— DBAL REST client (keep as-is)PackageLoaderC++ pattern — template for NodeRegistrynode-registry.json— 152 node typescomponents/workflow-editor/ConnectionLine.tsx— Bezier math referencegameengine/packages/seed/workflows/*.json— test data