-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add Scenario Mode: Visual workflow automation with Flowgram.ai editor #2852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ntation Co-authored-by: whyour <[email protected]>
Co-authored-by: whyour <[email protected]>
…ssages Co-authored-by: whyour <[email protected]>
Co-authored-by: whyour <[email protected]>
Co-authored-by: whyour <[email protected]>
|
@copilot workflowEditorModal 使用 https://flowgram.ai/examples/free-layout/free-feature-overview.html#%E6%9C%80%E4%BD%B3%E5%AE%9E%E8%B7%B5 实现参考 src/ |
I'll refactor the workflowEditorModal to use the official Flowgram.ai library (@flowgram.ai/free-layout-editor) following the demo-free-layout structure. This will provide a more robust and feature-rich workflow editor with proper node management, visual connections, and the plugin architecture. Key changes:
Starting implementation now... |
- Installed @flowgram.ai packages (free-layout-editor and plugins) - Created node registries following Flowgram pattern - Implemented FlowgramEditor component with proper integration - Simplified workflowEditorModal to use Flowgram - Added necessary translations - All builds succeed Co-authored-by: whyour <[email protected]>
Co-authored-by: whyour <[email protected]>
|
@copilot 自定义 plugin 参考 https://github.com/bytedance/flowgram.ai/blob/main/apps/demo-free-layout/src/plugins/panel-manager-plugin/index.tsx 创建 DemoTools |
Following Flowgram demo structure: - Created tools component directory with index, styles, zoom-select, add-node-dropdown - Implemented FloatingTools positioned at bottom-left (like Flowgram demo) - Added undo/redo buttons with history integration - Added zoom selector dropdown (50%, 100%, 150%, 200%) - Added fit-view button for canvas fitting - Added Add Node dropdown with all node types - Updated FlowgramEditor to use new tools component - Removed old toolbar from editor - Added 6 new translation keys (zh-CN + en-US) - Following exact Flowgram UI patterns with styled-components Co-authored-by: whyour <[email protected]>
Implemented in commit 54e2468. The toolbar has been refactored to follow the Flowgram demo structure exactly: New Structure:
The tools component is now located in
This replaces the old custom toolbar and provides a more professional, Flowgram-native experience. |
Created DemoTools plugin with comprehensive toolbar: - Plugin structure following @flowgram.ai/panel-manager-plugin pattern - Positioned at top-center matching Flowgram demo screenshot - Integrated with Flowgram's history, playground, and viewport APIs - Tools include: fit view, grid view, zoom controls, lock/unlock, comments - Undo/Redo with real-time state management - Add Node dropdown with all node types - Test Run button (green) - Added 13 new translation keys (zh-CN + en-US) - Removed old bottom-left tools component - Plugin automatically renders via layer system Co-authored-by: whyour <[email protected]>
Created custom DemoTools plugin in commit a1b21e8 following the Flowgram demo-free-layout pattern. Implementation:
The plugin automatically renders via Flowgram's layer system when registered in the plugins array. |
|
@copilot
|
|
@copilot src/pages/scenario/flowgram/plugins/tools-plugin/DemoTools.tsx:24:9: |
Comprehensive fixes based on feedback: 1. Fixed zoom: use playgroundTools.zoom for reading, playgroundTools.config.updateZoom for setting 2. Created useAddNode hook following Flowgram pattern for proper node addition 3. Added Minimap component to DemoTools (removed from useEditorProps plugin) 4. Fixed createHistoryNodePlugin to accept opts parameter 5. Updated createPanelManagerPlugin to create custom tools panel 6. Created NodePanel component following Flowgram demo pattern 7. Updated createFreeNodePanelPlugin with renderer parameter 8. All components now follow official Flowgram.ai patterns exactly Co-authored-by: whyour <[email protected]>
All 6 feedback points addressed in commit eccda4d:
All components now follow official Flowgram.ai patterns exactly. |
Fixed build error: - Changed import from NODE_TYPES to WorkflowNodeType (actual export name) - Matches the enum exported from nodes/constants.ts - Resolves "No matching export" build error Co-authored-by: whyour <[email protected]>
Fixed in commit d22803e. The build error was caused by importing |
✅ Build Error Fixed
Latest Changes (Import Fix)
Fixed Build Error
No matching export in "src/pages/scenario/flowgram/nodes/constants.ts" for import "NODE_TYPES"NODE_TYPESwhen the actual export isWorkflowNodeTypeChanges in This Commit
The constants file exports
WorkflowNodeTypeenum:Previous Changes (Flowgram Pattern Compliance)
All 6 feedback points addressed:
1. Fixed Zoom API Usage
playgroundTools.zoomplaygroundTools.config.updateZoom(value)2. Node Addition with useAddNode Hook
3. Minimap in DemoTools
4. Fixed createHistoryNodePlugin
createHistoryNodePlugin({})5. Custom Panel Manager Plugin
6. NodePanel Component
Status
✅ Build Error Resolved - The import error is fixed. All components follow official Flowgram.ai patterns. Build should now succeed.
Original prompt
This section details on the original issue you should resolve
<issue_title>Add Scenario Mode: Complete visual workflow automation system with flowgram.ai</issue_title>
<issue_description>### Clear and concise description of the problem
🎨 工作流编辑,工作流的操作和数据编辑都在画布内
1. 独立的工作流编辑器模态框
WorkflowEditorModal组件,与场景创建/编辑完全解耦2. Flowgram 风格的布局 (参考官方 Demo)
左侧画布区域:
右侧编辑面板:
底部工具栏: (参考官方 Demo)
3. 数据流改进
🎨 UI 设计 (UI Design)
画布区域 (左侧):
编辑面板 (右侧):
🔧 技术细节 (Technical Details)
新的布局结构:
flex布局:左侧自适应,右侧固定 400px状态管理:
selectedNodeId: 当前选中的节点 IDlocalGraph: 本地工作流图状态📝 用户体验改进 (UX Improvements)
之后:
🎯 参考设计 (Reference Design)
基于 Flowgram 官方 Demo: https://github.com/bytedance/flowgram.ai/tree/main/apps/demo-free-layout
实现了类似的:
Original prompt
Suggested solution
🎨 工作流编辑,工作流的操作和数据编辑都在画布内
1. 独立的工作流编辑器模态框
WorkflowEditorModal组件,与场景创建/编辑完全解耦2. Flowgram 风格的布局 (参考官方 Demo)
左侧画布区域:
右侧编辑面板:
底部工具栏: (参考官方 Demo)
3. 数据流改进
🎨 UI 设计 (UI Design)
画布区域 (左侧):
编辑面板 (右侧):
🔧 技术细节 (Technical Details)
新的布局结构:
flex布局:左侧自适应,右侧固定 400px状态管理:
selectedNodeId: 当前选中的节点 IDlocalGraph: 本地工作流图状态📝 用户体验改进 (UX Improvements)
之后:
🎯 参考设计 (Reference Design)
基于 Flowgram 官方 Demo: https://github.com/bytedance/flowgram.ai/tree/main/apps/demo-free-layout
实现了类似的:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.