feat: improve flow layout algorithm and add move_flow_components command#160
Draft
Ruari-Phipps wants to merge 15 commits into
Draft
feat: improve flow layout algorithm and add move_flow_components command#160Ruari-Phipps wants to merge 15 commits into
Ruari-Phipps wants to merge 15 commits into
Conversation
…layout
Replaces the old recursive grid layout with a proper hierarchical layout
algorithm (BFS layers, barycenter ordering) that produces clean top-to-bottom
flow visualizations matching GLOT's dagre approach.
Key changes:
- New flow_layout_utils.py with Sugiyama-style layout algorithm
- Resolves edges from conditions, goto_step() calls, and {{ft:func}} prompts
- Estimates card height from prompt length for vertical spacing
- Centers function steps within step columns
- New flows get full clean layout; existing flows place new steps relative to parents
- Includes HTML visualizer script (scripts/visualize_flow.py)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Coverage Report
Changed file coverage
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the flow layout algorithm with a hierarchical Sugiyama-style layout using networkx, aligns layout constants with the actual Jupiter frontend rendering dimensions, and adds support for pushing position updates via the
move_flow_componentsplatform command.Motivation
Changes
build_move_commandsandclean_flow_positionstoflow_layout_utils.pyfor buildingMoveFlowComponentsprotosqueue_commandtosync_clientandinterfacefor queuing arbitrary command protos--clean-flowsflag topoly push— re-layouts changed flows and pushes positions viamove_flow_components--clean-flowsonly processes flows with changes in the changesetTest strategy
poly <command>)Checklist
ruff check .andruff format --check .passpytestpassespolyCLI interface (or migration path documented)