Skip to content

feat(web): rebuild the session flow view on React Flow with category icons - #621

Merged
JeremyFunk merged 1 commit into
mainfrom
feat/agent-session-flow-react-flow
Aug 24, 2026
Merged

JeremyFunk merged 1 commit into
mainfrom
feat/agent-session-flow-react-flow

Conversation

@JeremyFunk

@JeremyFunk JeremyFunk commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

What

Rebuilds the agent session detail's Flow tab on @xyflow/react, following the pattern investigations/flow/provenance-canvas.tsx established: the lane/column layout stays hand-computed, and xyflow provides the canvas — pan, zoom, and edge rendering — instead of the previous scaled-div scroller with per-lane SVG connectors.

The colored category dots on the node cards and in the legend are replaced with icons from the shared icon set:

  • agent → robot
  • inference → sparkle
  • tool → gear
  • error → red cross (a failed node's glyph is taken over by the outcome, matching how the dots behaved)

The glyphs keep the same chart-* tokens as CATEGORY_FILL, so the color vocabulary stays aligned with the waterfall and the header breakdown — but the kind of work now also reads by shape alone.

Notes

  • Nodes declare width/height and handles up front (every card is the same box), so xyflow draws edges on the first frame without waiting for measurement — which also makes them render under jsdom, keeping the edge-count tests meaningful.
  • The wheel pans rather than zooms (panOnScroll): the canvas fills the viewport, and a wheel that zooms traps the reader. Zoom stays on the buttons and pinch, still clamped to 0.5–1.5 and persisted across a Trace ↔ Flow switch through the existing zoom prop.
  • The reset button restores the origin at 1:1 rather than fitView: fit clamps against the 0.5 floor on any real session and lands somewhere unpredictable, and fitView queues behind the flow's own render when invoked from outside it.
  • Keyboard span navigation now moves the viewport via setCenter, and only when the focused node is out of view.

Testing

  • session-detail.test.tsx updated to read node positions from the xyflow wrappers and count .react-flow__edge elements; 51/51 pass.
  • tsc --noEmit clean for apps/web.
  • Verified interactively against the /lab/agent-session fixture harness: nodes, edges, lane labels, node click → docked drawer, zoom in/out/reset, wheel pan, merge-repeats toggle, and the empty-filter state.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…icons

The flow tab drew its own scaled div canvas with per-lane SVG connectors;
it now hands the same hand-computed lane layout to @xyflow/react — the
split investigations/flow already uses — so pan, zoom and edge drawing
come from the shared canvas instead of a bespoke scroller. Nodes declare
their dimensions and handle spots up front, so edges draw on the first
frame (and under jsdom, which never runs a ResizeObserver pass).

The category dots become glyphs from the shared icon set — robot for
agent, sparkle for inference, gear for tool, a red cross for a failure —
in the node cards and the legend both, so the kind of work reads by
shape rather than by hue alone.
@JeremyFunk
JeremyFunk merged commit 1b65bac into main Aug 24, 2026
31 of 33 checks passed
@JeremyFunk
JeremyFunk deleted the feat/agent-session-flow-react-flow branch August 24, 2026 23:28
@github-actions

Copy link
Copy Markdown

🍁 Maple PR preview

Warning

Preview cleanup could not be confirmed. The Alchemy teardown outcome was skipped.

Final commit 4b99dea · View workflow run

JeremyFunk added a commit that referenced this pull request Aug 25, 2026
Conflict in session-flow.tsx: #621 rebuilt the view on React Flow and moved
the legend/zoom/drawer floor into the new structure. Took main's version and
re-applied this branch's `toolResults` pass-through to the SpanDrawer, which
#621 predates.
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.

1 participant