Commit 3163bcc
Add comprehensive bug tracking system with GitHub Issues integration (#36)
* Implement comprehensive undo/redo system with command pattern
## Summary
Complete implementation of undo/redo functionality for PyFlowGraph using the Command pattern. This addresses all node deletion issues including the "black node" bug and adds full support for undoing/redoing operations.
## Features Added
- **Command Pattern Architecture**: Full command system with base classes and command history
- **Node Operations**: Create, delete, move, and property change commands with complete state preservation
- **Connection Operations**: Create, delete, and reroute node commands with pin relationship tracking
- **RerouteNode Support**: Proper handling of RerouteNode objects in all operations
- **Keyboard Shortcuts**: Ctrl+Z (undo), Ctrl+Y/Ctrl+Shift+Z (redo)
- **Color & Size Restoration**: Full preservation of node visual properties during undo/redo
- **UUID Synchronization**: Fixed issues with markdown-loaded nodes having mismatched object references
## Bug Fixes
- **Black Node Bug**: Fixed CompositeCommand rollback issue that caused successful deletions to be undone
- **RerouteNode Deletion**: Added proper pin structure handling for RerouteNode vs regular Node objects
- **Pin Destruction**: Fixed NoneType errors when destroying pins during node deletion
- **Connection Restoration**: Enhanced connection recreation with support for both node types
- **Type Preservation**: RerouteNodes now restore as RerouteNodes, not regular Nodes
## Architecture
- `src/commands/`: Command pattern implementation with base classes and specific command types
- `src/commands/command_base.py`: Abstract base class and composite command support
- `src/commands/command_history.py`: Undo/redo stack management with memory limits
- `src/commands/node_commands.py`: All node-related operations (create, delete, move, properties)
- `src/commands/connection_commands.py`: All connection-related operations including reroute nodes
## Testing
- Added comprehensive test suite covering all command operations
- GUI-based tests for real-world deletion scenarios
- Specific tests for RerouteNode undo/redo functionality
- Markdown file loading deletion tests
## Integration
- Integrated into NodeEditorWindow with keyboard shortcuts
- Connected to NodeGraph for all graph operations
- Maintains backward compatibility with existing code
- Memory-efficient with configurable command history limits
🤖 Generated with [Claude Code](https://claude.ai/code)
* Fix RerouteNode creation undo issue
The main issue was that when a RerouteNode was deleted and restored via undo,
DeleteNodeCommand.undo() created a new RerouteNode object with the same UUID.
However, CreateRerouteNodeCommand.undo() was trying to remove the original
RerouteNode object reference, which no longer existed in the graph.
Changes:
- Modified CreateRerouteNodeCommand.undo() to find current RerouteNode by UUID
- Added fallback to search for any RerouteNode if UUID lookup fails
- Properly remove connections to/from current RerouteNode before removal
- Ensure RerouteNode is removed from both scene and nodes list
- Added comprehensive test suite for RerouteNode creation/deletion/undo/redo
Test Results:
- RerouteNode creation undo now properly removes the node
- Redo operations work correctly with RerouteNodes
- Final state after undo creation: 2 nodes, 1 direct connection (as expected)
Fixes user reported issue: "reroute will still exist but the last undo will
successfully reconnect the graph to the original state"
* Fix RerouteNode creation redo issue
The issue was that CreateRerouteNodeCommand.execute() tried to remove the
original connection object stored in self.original_connection, but during
redo operations, this object reference was stale - the connection had been
recreated as a new object during the undo operation.
Changes:
- Modified execute() to find and remove current connection by pin matching
- Instead of relying on stored connection object, find connection dynamically
- Added safety checks for scene and connections list membership
- This allows both initial execution and redo to work correctly
The fix resolves:
- QGraphicsScene::removeItem: item's scene is different error
- list.remove(x): x not in list error during redo operations
Test Results:
- RerouteNode creation redo now works correctly
- RerouteNode deletion redo continues to work
- All undo/redo operations function properly
Fixes the user's redo issue with RerouteNodes.
* Add centralized debug configuration system
- Add debug_config.py with category-based debug controls
- DEBUG_LAYOUT, DEBUG_UNDO_REDO, DEBUG_FILE_LOADING, DEBUG_PINS
- DEBUG_MASTER_SWITCH for production use
- should_debug() helper function for conditional debug output
- Enables targeted debugging of node sizing and layout issues
🤖 Generated with [Claude Code](https://claude.ai/code)
* Add comprehensive node minimum size calculation and validation
- Add calculate_absolute_minimum_size() method for accurate size requirements
- Calculate based on title width, pin labels, GUI content, and margins
- Enhanced fit_size_to_content() with debug output and validation
- Improved _update_layout() with complete visual refresh chain
- Added prepareGeometryChange() and enhanced pin connection updates
- Comprehensive debug logging for layout operations
- Ensures nodes always meet minimum size requirements for proper display
Fixes critical issue where nodes could be smaller than their content,
causing GUI elements to be crushed and pins to be mispositioned.
🤖 Generated with [Claude Code](https://claude.ai/code)
* Enhance pin positioning and visual state management
- Enhanced update_label_pos() with debug output for positioning verification
- Add update_visual_state() method for complete pin refresh
- Improved visual update chain for label positioning and connections
- Debug logging for pin position calculations and updates
- Ensures pins are properly positioned and visually updated during layout changes
Part of the comprehensive fix for pin positioning issues during
node creation, deletion, and undo/redo operations.
🤖 Generated with [Claude Code](https://claude.ai/code)
* Fix critical node sizing validation during file loading
- Add load-time size validation to prevent undersized nodes from files
- Calculate minimum size requirements and auto-correct loaded dimensions
- Add critical deferred validation after GUI construction completes
- Fix timing issue where GUI widgets affect minimum size calculations
- Add final_load_update() validation pass for accurate sizing
- Debug logging for size corrections and validation steps
Resolves the "nagging bug" where nodes loaded from files were smaller
than their content requirements, causing GUI elements to be crushed
and pins to be positioned incorrectly until manual resize.
The key insight: minimum size calculations change as GUI widgets are
constructed, requiring a second validation pass after Qt event loop
processes all pending widget creation and sizing events.
🤖 Generated with [Claude Code](https://claude.ai/code)
* Enhance undo/redo operations with proper size validation
- Enhanced DeleteNodeCommand.undo() with size validation during restoration
- Add comprehensive debug output for undo/redo operations
- Ensure restored nodes meet minimum size requirements
- Improved node restoration process with proper layout updates
- Fix pin positioning issues during undo/redo operations
- Added proper visual refresh chain for restored nodes
Completes the fix for pin positioning issues during node creation,
deletion, and undo/redo operations by ensuring restored nodes are
properly sized and laid out.
🤖 Generated with [Claude Code](https://claude.ai/code)
* Add comprehensive plan documentation for node sizing fixes
- Document the complete investigation and fix plan for node sizing issues
- Detailed task breakdown for fixing pin positioning and minimum size bugs
- Implementation strategy for size validation and layout improvements
- Focus on debug-first approach for GUI-dependent issues
- Reference documentation for the comprehensive node sizing system fixes
🤖 Generated with [Claude Code](https://claude.ai/code)
* Fix GUI content loss during delete/undo operations
- Use proper setter methods instead of direct property assignment in undo
- Changed to use set_code() and set_gui_code() during node restoration
- Ensures rebuild_gui() is called to create widgets before apply_gui_state()
- Enhanced debug output for GUI state capture and restoration process
- Added comprehensive GUI widget validation during restoration
Resolves the "GUI empty after undo" bug where restored nodes had correct
size and pins but missing GUI content. The issue was that GUI widgets
weren't being recreated because rebuild_gui() wasn't called, causing
apply_gui_state() to fail silently.
The key insight: Direct property assignment bypasses the rebuild process,
while setter methods properly trigger GUI reconstruction.
🤖 Generated with [Claude Code](https://claude.ai/code)
* Reorganize documentation structure and streamline CLAUDE.md
- Restructure docs/ with logical organization:
- architecture/ for technical design docs
- specifications/ for feature specs
- development/ for testing guides and implementation notes
- Break down monolithic TODO.md into focused documents:
- roadmap.md for feature priorities
- competitive-analysis.md for missing features analysis
- development/implementation-notes.md for technical priorities
- Update testing documentation to match current 18+ test suite
- Streamline CLAUDE.md from 190 to 62 lines (67% reduction)
- Fix documentation errors: module counts, test infrastructure, architecture
- Add comprehensive navigation guide (docs/README.md)
* Add bug tracking system for systematic issue management
Create docs/bugs/ directory with structured bug reporting system including main tracking index and detailed report for reroute node execution data loss issues.
🤖 Generated with [Claude Code](https://claude.ai/code)
* Enhance bug tracking with GitHub Issues integration and automation
- Add comprehensive GitHub sync process documentation
- Implement Python automation script for bidirectional sync
- Create GitHub Actions workflow for automated synchronization
- Add label setup scripts for proper issue categorization
- Update existing bug with GitHub issue #35 reference
- Enable rich GitHub issue formatting with direct file links
Features:
- Manual and automated sync between docs/bugs/ and GitHub Issues
- Smart labeling based on priority and component metadata
- Direct clickable links from GitHub issues to documentation files
- Validation tools for sync status monitoring
🤖 Generated with [Claude Code](https://claude.ai/code)
---------
Co-authored-by: Bryan Howard <bhowiebkr@gmail.com>1 parent ae5673f commit 3163bcc
47 files changed
Lines changed: 11072 additions & 312 deletions
File tree
- .github/workflows
- docs
- architecture
- bugs
- development
- fixes
- specifications
- scripts
- src
- commands
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 5 | + | |
32 | 6 | | |
33 | | - | |
| 7 | + | |
34 | 8 | | |
35 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
36 | 12 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 13 | + | |
42 | 14 | | |
43 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
44 | 22 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
72 | 26 | | |
73 | 27 | | |
74 | 28 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
95 | 32 | | |
96 | 33 | | |
97 | 34 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | 35 | | |
103 | 36 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
123 | 46 | | |
124 | 47 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 48 | | |
138 | 49 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
175 | 53 | | |
176 | 54 | | |
177 | 55 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
0 commit comments