feat: add dotflow viz β terminal pipeline visualization command#160
feat: add dotflow viz β terminal pipeline visualization command#160avarga1 wants to merge 5 commits intodotflow-io:developfrom
Conversation
Closes dotflow-io#108 New command: dotflow viz -s <step> [-m <mode>] [--format terminal|mermaid] Renders a workflow pipeline as an ASCII box diagram in the terminal, or exports Mermaid graph syntax for documentation. - Sequential mode: boxes connected left-to-right with βββΆ arrows - Parallel mode: stacked boxes with fork bracket on the left - Sequential group mode: sections rendered per group - Each box shows task name, retry count, and timeout when set - --format mermaid outputs a graph LR Mermaid diagram - 16 tests covering name resolution, box rendering, and all output modes
|
Hey @dotflow-io β just checking in on this one. Happy to address any feedback or rebase if needed. Let me know! |
There was a problem hiding this comment.
π Code Review
Code issues found: 2 blocking/suggestion + 5 inline guidance comments
| # | Severity | Comment |
|---|---|---|
| 1 | [Blocking] | Background mode displays wrong label |
| 2 | [Suggestion] | Duplicate names break Mermaid output |
| 3 | [Suggestion] | Remove unnecessary inline comments in viz.py |
| 4 | [Suggestion] | Remove narration comments in visualizer.py |
| 5 | [Suggestion] | Use rich console instead of bare print() |
| 6 | [Suggestion] | Leverage rich Panel/Tree/Columns for rendering |
| 7 | [Comment] | Test structure feedback and missing test case |
|
Hey! π Just a heads-up β this branch currently has merge conflicts with git checkout feature/ISSUE-108
git fetch origin
git merge origin/develop
# resolve conflicts
git pushπ‘ Tip: If you're using Claude Code, there's a git-flow skill that automates branch naming, commits, and rebasing following the project conventions: π https://github.com/FernandoCelmer/skills/blob/master/skills/git-flow/SKILL.md You can install it with: claude plugins install git-flow@FernandoCelmer-skillsIt handles the |
|
Hey! One more thing β could you rename the command from
|
- Rename command viz β flow (file, class, setup method, subcommand, __all__) - Fix background mode showing wrong label (was falling through to sequential) - Fix Mermaid duplicate node IDs collapsing into self-loop (positional suffix) - Use console.print() instead of bare print() for Mermaid output - Remove narration inline comments; keep only non-obvious why comments - Add test for duplicate task names in Mermaid output - Update existing Mermaid tests for new node ID format
Closes #108
What this adds
A new
dotflow vizCLI command that renders any workflow as an ASCII pipeline diagram β no browser, no external service, zero new dependencies (usesrichwhich is already in the project).Parallel mode stacks tasks with a fork bracket:
Mermaid export for docs:
Files changed
dotflow/utils/visualizer.pydotflow/cli/commands/viz.pyVizCommandβ wires the CLI args to the visualizerdotflow/cli/commands/__init__.pyVizCommanddotflow/cli/setup.pydotflow vizsubcommand with--step,--mode,--formatargstests/utils/test_visualizer.pyUsage