Skip to content

Commit aaeb826

Browse files
bhowiebkrBryan Howard
andauthored
Enhance file organizer workflow and refactor node architecture for v0.8.0 (#34)
* Add comprehensive environment management system with default and graph-specific environments * Fix virtual environment path resolution for development and compiled modes * Fix environment selection dialog timing - defer until after GUI loads * Update main application for environment system compatibility * Improve toolbar layout and radio button styling - Move execution controls to right side of toolbar with spacer - Fix radio buttons to always use circular indicators - Improve text contrast and readability for execution mode selection - Add proper hover states and consistent sizing for radio buttons * Optimize live mode performance and reduce button click delays - Add UI update throttling to prevent redundant live mode updates - Cache environment validation results to avoid repeated file system checks - Optimize event handler setup to be incremental, not full rebuild - Reduce logging spam during live mode activation - Keep event handlers persistent for faster mode switching - Fix performance regression introduced by environment management system * Improve execution button visibility and remove emoji icons - Change button text color to black for better visibility on bright backgrounds - Remove emoji icons from all execution button text states - Keep white text only on red (paused) button for contrast - Update all button states: Execute Graph, Start Live Mode, Pause/Resume, etc. * Rename Run menu to Environment menu for better clarity - Changed 'Run' menu to 'Environment' menu since it only contains environment management - More descriptive and intuitive menu organization - Better reflects the actual functionality contained within * Implement comprehensive graph description editing and fix paragraph spacing - Add graph description extraction from markdown H1 titles and following paragraphs - Implement Graph Properties dialog accessible via File → Graph Properties menu - Fix paragraph spacing preservation in both node and graph descriptions - Update FlowFormatHandler to properly parse and generate graph metadata - Ensure copy/paste operations exclude graph descriptions as requested - Add proper paragraph break handling with double newlines between paragraphs - Rename json_to_flow/flow_to_json methods to data_to_markdown/markdown_to_data - Include actual node descriptions in saved markdown instead of placeholder text 🤖 Generated with [Claude Code](https://claude.ai/code) * Add node description editing capability - Add description field to Node class with serialization support - Enhance Node Properties dialog with description editor (QTextEdit) - Update dialog constructor to accept and display node descriptions - Preserve node descriptions in save/load cycle - Support markdown formatting in node description editor 🤖 Generated with [Claude Code](https://claude.ai/code) * Remove JSON file format support and update file operations - Remove JSON file format from save/load dialogs (only .md files supported) - Update _save_file() to use actual graph title/description instead of defaults - Simplify _load_file() to only handle .md format using FlowFormatHandler - Use data_to_markdown() and markdown_to_data() method names consistently - Ensure graph metadata is properly preserved during save/load operations 🤖 Generated with [Claude Code](https://claude.ai/code) * Improve view state persistence and add comprehensive testing - Update save_view_state() to accept optional file_path parameter - Simplify view state loading logic with robust transform and center point handling - Add comprehensive GUI-based test for view state persistence functionality - Test covers zoom/pan operations, file switching, and state restoration - Ensure view state is properly saved when switching between files 🤖 Generated with [Claude Code](https://claude.ai/code) * Update password generator example with comprehensive descriptions - Add detailed graph description explaining the complete workflow - Enhance node descriptions with multi-paragraph technical details - Include implementation specifics for each component - Demonstrate proper paragraph spacing in descriptions - Update node positions and GUI state after testing 🤖 Generated with [Claude Code](https://claude.ai/code) * Fix virtual environment dialog and view state persistence issues - Fixed startup venv dialog not showing for new/example graphs - Added proper environment selection prompts before execution - Fixed QSettings path errors in environment manager using correct project root detection - Fixed view state (pan/zoom) not being restored when loading last saved graph on startup - Set default environment to True for new/untitled graphs - Added ensure_environment_selected() method called before execution * Fix pin generation for complex generic types and improve example graphs Two major fixes for the pin generation system: 1. Fix _parse_type_hint() method to properly handle complex generic types like List[Dict]: - Added support for ast.Name slices (simple generics) - Added support for ast.Tuple slices (multiple parameters) - Added fallback handling for other slice structures 2. Fix update_pins_from_code() logic error for List/Tuple detection: - Changed to only treat Tuple types as multiple outputs - Handle List[Dict] and other single-element generics correctly - Prevents AttributeError when accessing .elts on non-Tuple slices Example graph improvements: - Fixed missing GUI State Handler functions (set_values, set_initial_state) - Connected data-generator to rest of analysis pipeline - Removed non-functional buttons from dashboard and password generator - Updated node positions and metadata from GUI testing 🤖 Generated with [Claude Code](https://claude.ai/code) * Fix file organizer automation workflow and refactor node architecture - Add missing workflow starter entry point node for clean initiation - Fix broken data flow connections between all nodes in pipeline - Refactor complex @node_entry functions following FlowSpec best practices: * File Categorizer: Extract FileCategorizer class with modular methods * File Mover: Extract FileOrganizer class with specialized operations * Operation Verifier: Extract OrganizationVerifier class with focused methods - Add comprehensive error handling and validation throughout workflow - Enhance GUI elements with tooltips and better user experience - Fix folder scanner to return tuple with both file list and base path - Add operation verification node for post-organization validation - Create complete data pipeline: Scanner → Categorizer → Creator → Mover → Verifier - Ensure all pin connections properly match function signatures - Improve code maintainability and testability with helper classes 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Bryan Howard <[email protected]>
1 parent 7294b9b commit aaeb826

20 files changed

+2089
-244
lines changed

examples/data_analysis_dashboard.md

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ The node serves as a data source for testing downstream analytics components wit
1919
"uuid": "data-generator",
2020
"title": "Sample Data Generator",
2121
"pos": [
22-
100.0,
23-
200.0
22+
-46.05000000000001,
23+
220.70000000000005
2424
],
2525
"size": [
2626
250,
27-
190
27+
265
2828
],
2929
"colors": {
3030
"title": "#007bff",
3131
"body": "#0056b3"
3232
},
3333
"gui_state": {
3434
"num_records": 100,
35-
"data_type": "Sales"
35+
"data_type": "Weather"
3636
}
3737
}
3838
```
@@ -111,6 +111,10 @@ def get_values(widgets):
111111
'data_type': widgets['data_type'].currentText()
112112
}
113113

114+
def set_values(widgets, outputs):
115+
# Data generator doesn't need to display outputs
116+
pass
117+
114118
def set_initial_state(widgets, state):
115119
widgets['num_records'].setValue(state.get('num_records', 100))
116120
widgets['data_type'].setCurrentText(state.get('data_type', 'Sales'))
@@ -132,8 +136,8 @@ Returns three outputs: statistics dictionary with calculated metrics, total reco
132136
"uuid": "statistics-calculator",
133137
"title": "Statistics Calculator",
134138
"pos": [
135-
450.0,
136-
100.0
139+
295.9000000000001,
140+
123.0
137141
],
138142
"size": [
139143
250,
@@ -212,8 +216,8 @@ Returns three outputs: trends dictionary containing monthly distributions, patte
212216
"uuid": "trend-analyzer",
213217
"title": "Trend Analyzer",
214218
"pos": [
215-
450.0,
216-
400.0
219+
643.1999999999998,
220+
324.1000000000001
217221
],
218222
"size": [
219223
250,
@@ -302,12 +306,12 @@ Outputs a single formatted string suitable for display in QTextEdit widgets. The
302306
"uuid": "dashboard-display",
303307
"title": "Analytics Dashboard",
304308
"pos": [
305-
850.0,
306-
250.0
309+
1017.9,
310+
143.04999999999998
307311
],
308312
"size": [
309-
276,
310-
589
313+
270.1,
314+
581.45
311315
],
312316
"colors": {
313317
"title": "#6c757d",
@@ -394,12 +398,6 @@ widgets['dashboard_display'].setPlainText('Generate data and run analysis to see
394398
font = QFont('Courier New', 9)
395399
widgets['dashboard_display'].setFont(font)
396400
layout.addWidget(widgets['dashboard_display'])
397-
398-
widgets['export_btn'] = QPushButton('Export Report', parent)
399-
layout.addWidget(widgets['export_btn'])
400-
401-
widgets['refresh_btn'] = QPushButton('Refresh Analysis', parent)
402-
layout.addWidget(widgets['refresh_btn'])
403401
```
404402

405403
### GUI State Handler
@@ -411,16 +409,44 @@ def get_values(widgets):
411409
def set_values(widgets, outputs):
412410
dashboard = outputs.get('output_1', 'No dashboard data')
413411
widgets['dashboard_display'].setPlainText(dashboard)
412+
413+
def set_initial_state(widgets, state):
414+
# Dashboard doesn't have saved state to restore
415+
pass
414416
```
415417

416418

417419
## Connections
418420

419421
```json
420422
[
423+
{
424+
"start_node_uuid": "data-generator",
425+
"start_pin_name": "exec_out",
426+
"end_node_uuid": "statistics-calculator",
427+
"end_pin_name": "exec_in"
428+
},
429+
{
430+
"start_node_uuid": "data-generator",
431+
"start_pin_name": "output_1",
432+
"end_node_uuid": "statistics-calculator",
433+
"end_pin_name": "data"
434+
},
421435
{
422436
"start_node_uuid": "statistics-calculator",
423437
"start_pin_name": "exec_out",
438+
"end_node_uuid": "trend-analyzer",
439+
"end_pin_name": "exec_in"
440+
},
441+
{
442+
"start_node_uuid": "data-generator",
443+
"start_pin_name": "output_1",
444+
"end_node_uuid": "trend-analyzer",
445+
"end_pin_name": "data"
446+
},
447+
{
448+
"start_node_uuid": "trend-analyzer",
449+
"start_pin_name": "exec_out",
424450
"end_node_uuid": "dashboard-display",
425451
"end_pin_name": "exec_in"
426452
},

0 commit comments

Comments
 (0)