fix: show step name in tree view for forEach-expanded steps#868
Conversation
When using forEach to expand workflow steps, the live tree view previously showed only "modelName → methodName" for every expanded step, making it impossible to distinguish between iterations (e.g., all showing "tester → smokeTest"). Now the tree view prefixes the step name when it differs from the model name, producing labels like "test-alpine: tester → smokeTest". This applies to: - Live running step labels (StepLine component) - Inline single-step job labels (JobLine component) - Graduated scrollback labels after job completion The prefix is only added when stepId !== modelName, so non-forEach steps that naturally match (e.g., stepId "ec2-instance" with modelName "ec2-instance") remain unchanged as "ec2-instance → create". Closes #867
There was a problem hiding this comment.
CLI UX Review
Blocking
None.
Suggestions
None.
Verdict
PASS — Clean presentation fix. The step-name: model → method format is clear and scannable, the prefix is correctly suppressed when stepId === modelName (preserving existing non-forEach output), and all three label construction sites are updated consistently. JSON output was already correct; this brings the tree view in line.
There was a problem hiding this comment.
Code Review
Presentation-only fix that's well-scoped and correctly implemented. All three label construction sites (step_line.tsx, job_line.tsx, state.ts) apply the same stepId !== modelName prefix logic consistently. The domain layer already had the right data — this just surfaces it in the tree view.
Blocking Issues
None.
Suggestions
- The label construction logic (
modelMethod+ conditionalstepPrefix) is duplicated across three files. A small shared helper (e.g.,formatStepLabel(stepId, modelName, methodName)) would reduce the duplication, but this is minor given the simplicity of the logic and not worth blocking on.
DDD: Changes are purely presentation-layer — no domain logic modified. ✓
Imports: All libswamp imports go through mod.ts. ✓
Tests: Two new tests cover the forEach-expanded prefix case and the no-prefix case; existing test updated to match the new behavior. ✓
License headers: Present on all files. ✓
Code style: No any types, named exports used. ✓
Summary
Fixes #867 — forEach-expanded steps in the workflow tree view now show the step name as a prefix when it differs from the model name.
Before:
After:
What changed
Three label construction sites in the tree view renderer were updated to prefix the step ID when
stepId !== modelName:step_line.tsx— live expanded step labelsjob_line.tsx— inline single-running-step labelsstate.ts— graduated scrollback labels after job completionWhy this is correct
test-alpine) as thestepIdthrough workflow events — this is purely a presentation fixstepId !== modelName, so non-forEach steps where the step name naturally matches the model name (e.g.,ec2-instance → create) remain unchanged--jsonoutput and report system already had the correct step names — this brings the tree view in line with thoseUser impact
Users running workflows with
forEachsteps can now tell which iteration is which during live execution, without the workaround of creating N separate model instances per iteration.Test Plan
stepId !== modelNameshows"test-alpine: tester → smokeTest"stepId === modelNameshows"ec2-instance → create"(no prefix)workflow_run_tree/passdeno check,deno lint,deno fmtpass🤖 Generated with Claude Code