⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@bgentry
Copy link
Contributor

@bgentry bgentry commented Feb 10, 2026

Workflow dependency graphs with fan-in/fan-out could still be misleading in several cases: bends could occur under sibling cards, long horizontal segments could run through node bodies, and direct upstream dependencies could appear to terminate at separate nearby merge points. Those patterns made true dependency relationships harder to read at a glance.

The routing logic now keeps the original Manhattan style by default, but validates each candidate lane against stricter constraints. Edge selection rejects lanes whose turns fall inside node no-turn zones and also rejects lanes whose orthogonal segments intersect non-endpoint nodes. For mixed fan-in targets, layout now adds a shared preferredBendX hint so off-row incoming edges converge on a common merge lane when safe.

Coverage was expanded with focused routing tests for node-body crossing avoidance, near-target lane fallback in same-row sibling scenarios, shared preferred merge-lane convergence, and merge-hint assignment at the layout layer.

Notice how in the before case there's a line connecting AgentPlanExecution directly to AgentVerifyDraft, but it disappears behind the intermediate AgentCallTool task. That's solved now including test coverage.

Before After
Screenshot 2026-02-10 at 9 19 57 AM Screenshot 2026-02-10 at 9 43 02 AM

@bgentry bgentry requested a review from brandur February 10, 2026 16:06
Copy link
Collaborator

@brandur brandur left a comment

Choose a reason for hiding this comment

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

Dang, this is a lot of code. Going to assume 100% LLM generated? A little scary that I definitely could not fix a problem in here without an LLM there to help.

Still, definitely good to have this fixed up. Thanks!

@bgentry bgentry force-pushed the bg/workflow-no-turn-zone-routing branch 2 times, most recently from bd35f4f to 174b17b Compare February 11, 2026 17:02
Workflow dependency graphs with fan-in/fan-out could still be misleading in
several cases: bends could occur under sibling cards, long horizontal
segments could run through node bodies, and direct upstream dependencies
could appear to terminate at separate nearby merge points. Those patterns
made true dependency relationships harder to read at a glance.

The routing logic now keeps the original Manhattan style by default,
but validates each candidate lane against stricter constraints. Edge
selection rejects lanes whose turns fall inside node no-turn zones and
also rejects lanes whose orthogonal segments intersect non-endpoint
nodes. For mixed fan-in targets, layout now adds a shared
`preferredBendX` hint so off-row incoming edges converge on a common
merge lane when safe.

Coverage was expanded with focused routing tests for node-body crossing
avoidance, near-target lane fallback in same-row sibling scenarios,
shared preferred merge-lane convergence, and merge-hint assignment at
the layout layer.
Workflow diagram logic had grown monolithic in
`src/components/WorkflowDiagram.tsx`, mixing React wiring with graph
construction, Dagre layout, and edge styling. It also crashed on some
historical payloads where `metadata.deps` was missing, because the graph
model read `job.metadata.deps` directly.

This refactor moves workflow diagram code into
`src/components/workflow-diagram/` and separates responsibilities across
`workflowDiagramGraphModel.ts`, `workflowDiagramLayout.ts`,
`workflowDiagramGeometry.ts`, and `workflowDiagramConstants.ts`, while
keeping edge-path routing and merge hints in dedicated modules. The
model builder now normalizes dependency reads with
`job.metadata.deps ?? []` so missing deps are treated as empty lists.

The change preserves rendering behavior and routing parity while
improving maintainability and preventing runtime failures for malformed
or historical rows. Coverage adds regressions for missing
`metadata.deps` in `WorkflowDiagram.test.tsx` and
`workflowDiagramGraphModel.test.ts`, alongside relocated routing and
merge-hint tests in the new module folder.
Workflow diagram tests in `WorkflowDiagram.test.tsx` and
`workflowDiagramGraphModel.test.ts` each defined a local `workflowJob`
fixture with nearly identical defaults. That duplication made workflow
metadata drift likely when fields like `deps` or `workflow_id` changed
in one file but not the other.

Add a shared `workflowJobFactory` in
`src/test/factories/workflowJob.ts`, built on top of `jobFactory`. The
factory centralizes workflow-specific metadata defaults (`deps`, `task`,
`workflow_id`, `workflow_staged_at`) while still allowing per-test
overrides for state and dependency scenarios.

Both workflow diagram test files now use the shared factory and no
longer carry their own fixture builder logic. This keeps existing
behavior coverage while reducing fixture boilerplate and making future
test updates easier to apply consistently.
@bgentry bgentry force-pushed the bg/workflow-no-turn-zone-routing branch from 174b17b to 4df7817 Compare February 11, 2026 17:07
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.

2 participants