feat(studio): nest per-iteration / per-region step logs in the flow Runs panel (#1505)#2667
Merged
Merged
Conversation
…uns panel (#1505) FlowRunsPanel rendered a run's step log flat, so a `loop` container showed as a single step and its body steps — one set per iteration — appeared as an undifferentiated repeat of the same node ids, with `parallel` branches and `try`/`catch` handlers likewise flattened. The automation engine already tags each structured-region body step with its container (`parentNodeId`) plus an `iteration` / `regionKind` (ADR-0031, framework #1505); the panel ignored them. Reconstruct the execution tree from the flat, pre-order step log (`buildStepTree`) and nest body steps under their container node, grouped by a per-iteration / per-branch / handler header (`Iteration 2`, `Branch 1`, `Try`, `Catch`). The reconstruction is robust to repeated node ids (a loop body node runs once per iteration) and to regions nested inside regions, and degrades safely — a body step whose container was dropped by durable-history truncation still surfaces at the top level rather than vanishing. Adds `buildStepTree` / `regionLabel` unit tests and a render test asserting the loop per-iteration headers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VuvxWgoadqryqBcjs7TpVi
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 18, 2026 15:38
This was referenced Jul 18, 2026
os-zhuang
added a commit
that referenced
this pull request
Jul 19, 2026
… flow canvas (#2670) (#2675) Phase 1 of #2670 (ADR-0031 designer rendering follow-up to the Runs-panel nesting in #2667). The flow designer rendered `loop`/`parallel`/`try_catch` containers as opaque single cards; their nested regions (`config.body` / `config.branches[]` / `config.try`/`catch`) were only visible as raw JSON. - `extractRegions(node)` (flow-canvas-layout) — pure: pulls a container's labeled regions from config; returns [] for ordinary nodes and legacy flat loops. - `flow-region-view` — read-only mini-canvas for a region, reusing `computeLayout` / `diagramSize` / `edgePath` at full scale then fitting to width with one CSS transform (no new layout engine). - `NodeCard` — a container gains a "show nested regions" control that opens the region(s) in a Popover, each with a header (named branch / `Branch N` / `Try` / `Catch`). Floating + portaled, so it never overlaps canvas nodes and needs no change to the layout or edge routing — zero regression to existing flows. Read-only for now; inline push-down nesting and nested editing are the next increments on #2670. Adds `extractRegions` unit tests and FlowCanvas render tests (loop body, parallel branch labels, legacy-loop has no control). Claude-Session: https://claude.ai/code/session_01VuvxWgoadqryqBcjs7TpVi Co-authored-by: Claude <noreply@anthropic.com>
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
Completes the observability surface for ADR-0031 structured control-flow regions (
loop/parallel/try_catch). The automation engine already folds each region's body steps into the run log tagged withparentNodeId/iteration/regionKind(framework #1505, now merged) — but the Studio Runs panel ignored those fields and rendered the step log flat. Alooptherefore showed as a single container step followed by its per-iteration body steps as an undifferentiated repeat of the same node ids;parallelbranches andtry/catchhandlers were flattened the same way. This is the UI half of the issue.FlowRunsPanel(Studio → flow preview → Runs) now reconstructs the execution tree from the flat, pre-order step log and nests body steps under their container node, grouped by a per-iteration / per-branch / handler header.What changed
FlowRunsPanel.tsxRunStepextended with the engine's grouping fields (parentNodeId,iteration,regionKind) fromExecutionStepLogSchema.buildStepTree()— reconstructs the container→children execution tree from the flat log via a stack walk. Robust to the two things that break naive grouping: repeated node ids (a loop body node runs once per iteration) and regions nested inside regions. Degrades safely — a body step whose container was dropped by durable-history truncation surfaces at the top level rather than vanishing.regionLabel()— 1-basedIteration N/Branch N, andTry/Catch.StepNode+RegionHeaderrendering with per-iteration/branch/handler headers and depth indentation. Top-level, region-free runs render exactly as before.buildStepTree/regionLabelunit tests (flat, loop, parallel, try/catch, nested loop, truncated-history orphan) and a render test asserting the loop per-iteration headers.@object-ui/app-shell.Representation
Each body step carries only its immediate container (innermost-wins tagging in the engine), and a whole region's steps are contiguous in the array (the engine appends
NodeExecutionResult.childStepsin one shot), so the flat log is a faithful pre-order DFS — which is what makes the stack-based tree reconstruction exact, including for nested regions. No engine/API change is required; the fields already flow throughgetRun/listRunsuntouched.Verification
vitest runon both test files — 20/20 pass.turbo run type-check --filter=@object-ui/app-shell— passes (29/29).eslinton the changed files — 0 errors.Closes #1505.
🤖 Generated with Claude Code
Generated by Claude Code