This project implements two critical feature gaps in PyFlowGraph that are considered "table stakes" in the node editor market: a comprehensive Undo/Redo system and Node Grouping/Container functionality. These features directly address the most significant competitive disadvantages identified in market analysis and are essential for PyFlowGraph to be considered a professional-grade tool.
PyFlowGraph Feature Parity Initiative - Phase 1
Estimated 6-8 weeks for full implementation
Critical - These features are blockers for professional adoption
- User Productivity: 40-60% reduction in error recovery time
- Graph Complexity: Enable 5-10x larger graphs through grouping
- Market Competitiveness: Move from "interesting prototype" to "viable tool"
PyFlowGraph currently lacks two fundamental features that every professional node editor provides:
- No Undo/Redo: Users cannot recover from mistakes without manual reconstruction
- No Node Grouping: Complex graphs become unmanageable without abstraction layers
- 100% of competitors have both features
- User feedback consistently cites these as deal-breakers
- Professional users expect these as baseline functionality
- Zero user complaints about missing undo/redo
- Ability to manage graphs with 200+ nodes effectively
- 50% reduction in reported user errors
- Positive user feedback on workflow improvements
- Multi-level undo/redo (minimum 50 steps)
- Keyboard shortcuts (Ctrl+Z, Ctrl+Y/Ctrl+Shift+Z)
- Menu integration with history display
- Undo/redo for all graph operations:
- Node creation/deletion
- Connection creation/deletion
- Node movement/resizing
- Property changes
- Code modifications
- Copy/paste operations
- Group/ungroup operations
- Cross-session undo persistence
- Branching undo trees
- Undo for file operations
Implement Command Pattern with the following structure:
class Command(ABC):
@abstractmethod
def execute(self): pass
@abstractmethod
def undo(self): pass
@abstractmethod
def get_description(self): str
class CommandHistory:
def __init__(self, max_size=50):
self.history = []
self.current_index = -1
self.max_size = max_size- node_graph.py: Wrap all graph modifications in commands
- node_editor_view.py: Handle keyboard shortcuts
- node_editor_window.py: Add menu items and toolbar buttons
- node.py: Track property changes
- connection.py: Track connection changes
Phase 1: Infrastructure (Week 1)
- Create command base classes
- Implement CommandHistory manager
- Add undo/redo stack to NodeGraph
Phase 2: Basic Commands (Week 2)
- CreateNodeCommand
- DeleteNodeCommand
- MoveNodeCommand
- CreateConnectionCommand
- DeleteConnectionCommand
Phase 3: Complex Commands (Week 3)
- CompositeCommand for multi-operations
- PropertyChangeCommand
- CodeModificationCommand
- CopyPasteCommand
Phase 4: UI Integration (Week 4)
- Keyboard shortcuts
- Menu items with descriptions
- Toolbar buttons
- Visual feedback
- Ctrl+Z: Undo last action
- Ctrl+Y or Ctrl+Shift+Z: Redo
- Alt+Backspace: Alternative undo (for accessibility)
Edit Menu
├── Undo [Action Name] Ctrl+Z
├── Redo [Action Name] Ctrl+Y
├── ─────────────────────────
├── Undo History...
└── Clear History
- Show action description in status bar
- Temporary highlight of affected elements
- Disable undo/redo buttons when not available
- Collapse selected nodes into a single group node
- Expand groups back to constituent nodes
- Nested groups (groups within groups)
- Custom I/O pins for groups
- Visual representation as single node
- Save groups as reusable templates
- Load group templates into any graph
- Cross-project group libraries
- Online group sharing
- Auto-grouping suggestions
- Group versioning
class NodeGroup(Node):
def __init__(self):
super().__init__()
self.internal_graph = NodeGraph()
self.input_mappings = {} # External pin -> internal node.pin
self.output_mappings = {} # Internal node.pin -> external pin
self.collapsed = True
self.group_color = QColor()
class GroupTemplate:
def __init__(self):
self.name = ""
self.description = ""
self.internal_graph_data = {}
self.interface_definition = {}Group Creation Process:
- Select nodes to group
- Analyze external connections
- Create interface pins automatically
- Generate group node
- Reroute external connections
- Hide internal nodes
Group Expansion Process:
- Restore internal nodes to scene
- Restore internal connections
- Reroute external connections
- Remove group node
- Maintain positioning
Phase 1: Basic Grouping (Week 1-2)
- Implement NodeGroup class
- Selection to group conversion
- Basic collapse/expand
- Pin interface generation
Phase 2: Visual Representation (Week 3)
- Custom group node painting
- Nested view navigation
- Breadcrumb UI for hierarchy
- Group color coding
Phase 3: Templates (Week 4)
- Save group as template
- Load template system
- Template management dialog
- Template metadata
Phase 4: Advanced Features (Week 5)
- Nested groups support
- Group property dialog
- Custom pin configuration
- Group documentation
- Select nodes (Ctrl+Click or drag selection)
- Right-click → "Group Selected" or Ctrl+G
- Name dialog appears
- Group created with auto-generated interface
- Double-click: Enter/exit group
- Right-click: Group context menu
- Alt+Click: Quick expand/collapse
- Ctrl+Shift+G: Ungroup
Collapsed Group:
┌─────────────────┐
│ 📦 Group Name │
├─────────────────┤
│ ● Input 1 │
│ ● Input 2 │
│ Output ● │
└─────────────────┘
Expanded View:
Shows internal nodes with breadcrumb:
[Main Graph] > [Group Name] > [Nested Group]
The Markdown flow format needs extension for groups:
## Group: Data Processing
<!--group-metadata
collapsed: true
color: "#4A90E2"
position: [100, 200]
interface:
inputs: [{name: "data", type: "list"}]
outputs: [{name: "result", type: "dict"}]
-->
### Internal Nodes
[Internal graph structure here]
## End Group- Groups reduce scene complexity when collapsed
- Lazy evaluation of hidden nodes
- Cache group execution results
- Memory overhead for group metadata (~1KB per group)
- Command execution and undo
- History management
- Group creation/destruction
- Template save/load
- Nested group operations
- Undo/redo with groups
- Copy/paste of groups
- File save/load with groups
- Execution of grouped nodes
- Undo history with 1000+ operations
- Groups with 100+ internal nodes
- Deeply nested groups (10+ levels)
Risk: Command serialization for complex operations Mitigation: Start with memory-only undo, add persistence later
Risk: Groups may break execution dependency resolution Mitigation: Maintain flat execution graph internally
Risk: Nested navigation may confuse users Mitigation: Clear breadcrumbs and visual hierarchy
Risk: File format changes break existing graphs Mitigation: Version field in files, migration code
- 1 Senior Developer (full-time, 6 weeks)
- 1 UI/UX Designer (part-time, 2 weeks)
- 1 QA Tester (part-time, 2 weeks)
- Development environment with PyFlowGraph
- Test dataset of complex graphs
- Performance profiling tools
- ✅ 50-step undo history minimum
- ✅ All graph operations undoable
- ✅ Groups can be created/expanded
- ✅ Groups can be nested
- ✅ Templates can be saved/loaded
- ✅ Keyboard shortcuts work consistently
- Undo/redo operation < 100ms
- Group creation < 500ms for 50 nodes
- No memory leaks in history
- File size increase < 20% with history
- Zero crashes from undo/redo
- Consistent state after any undo sequence
- Groups maintain execution correctness
- All existing tests still pass
- Internal testing
- Power user feedback
- Performance profiling
- Public beta release
- Documentation creation
- Video tutorials
- Final bug fixes
- Marketing materials
- Version 1.0 release
- User guide for undo/redo
- Group creation tutorial
- Template sharing guide
- API documentation for developers
- Cloud template library
- Collaborative undo/redo
- Smart grouping suggestions
- Visual undo timeline
- Group version control
Implementing these Priority 1 features transforms PyFlowGraph from an interesting prototype into a professional tool. The Undo/Redo system provides the safety net users expect, while Node Grouping enables the complexity management required for real-world applications. Together, these features establish feature parity with competitors and create a foundation for future innovation.
- Review and approve technical approach
- Allocate development resources
- Set up development branch
- Begin Phase 1 implementation
- Schedule weekly progress reviews
- Confirm 50-step history limit
- Approve file format changes
- Select beta testing group
- Define template sharing approach
This project brief serves as the definitive guide for implementing PyFlowGraph's Priority 1 features. Success will be measured by user adoption, reduced error rates, and the ability to handle complex professional workflows.