Skip to content

fix: show step name in tree view for forEach-expanded steps#868

Merged
stack72 merged 1 commit intomainfrom
fix/867-foreach-step-names-in-tree-view
Mar 25, 2026
Merged

fix: show step name in tree view for forEach-expanded steps#868
stack72 merged 1 commit intomainfrom
fix/867-foreach-step-names-in-tree-view

Conversation

@stack72
Copy link
Contributor

@stack72 stack72 commented Mar 25, 2026

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:

test
  ├─ tester → smokeTest    ∴ 1.9s
  ├─ tester → smokeTest    ∴ 1.9s
  ├─ tester → smokeTest    ∴ 1.9s

After:

test
  ├─ test-alpine: tester → smokeTest    ∴ 1.9s
  ├─ test-discord: tester → smokeTest   ∴ 1.9s
  ├─ test-github: tester → smokeTest    ∴ 1.9s

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 labels
  • job_line.tsx — inline single-running-step labels
  • state.ts — graduated scrollback labels after job completion

Why this is correct

  • The domain layer already propagates the correct expanded step name (e.g., test-alpine) as the stepId through workflow events — this is purely a presentation fix
  • The prefix is only added when stepId !== modelName, so non-forEach steps where the step name naturally matches the model name (e.g., ec2-instance → create) remain unchanged
  • The --json output and report system already had the correct step names — this brings the tree view in line with those

User impact

Users running workflows with forEach steps can now tell which iteration is which during live execution, without the workaround of creating N separate model instances per iteration.

Test Plan

  • Updated existing scrollback label assertion to account for the new prefix format
  • Added test: forEach-expanded step with stepId !== modelName shows "test-alpine: tester → smokeTest"
  • Added test: regular step with stepId === modelName shows "ec2-instance → create" (no prefix)
  • All 39 tests in workflow_run_tree/ pass
  • Full deno check, deno lint, deno fmt pass

🤖 Generated with Claude Code

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
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. The label construction logic (modelMethod + conditional stepPrefix) 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. ✓

@stack72 stack72 merged commit eb02760 into main Mar 25, 2026
10 checks passed
@stack72 stack72 deleted the fix/867-foreach-step-names-in-tree-view branch March 25, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

forEach steps should show step name in tree view, not just model→method

1 participant