Conversation
…B workflow layout Reserve a configured cluster-root node's full rendered width in the vertical (TB) dagre layout and place condition branch children by handle column instead of top-left, so cluster-root boxes (Approval/AI Agent) no longer overlap sibling branches and stay aligned with the chain and their child nodes. Bound the inline label width, center the cluster-element icon row, and left-align the box so its icon sits on the connection handle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the workflow editor layout pipeline to better account for the rendered width and handle alignment of configured clusterRoot nodes (e.g., Approval / AI Agent) in top-to-bottom (TB) layouts, preventing branch overlap and improving visual alignment.
Changes:
- Added explicit TB width + label-width constants for configured
clusterRootnodes. - Updated Dagre sizing + post-processing constraints to align condition-branch children by handle column and to expand branch offsets when a wide configured
clusterRootwould otherwise overlap a sibling branch. - Refined
AiAgentNodeTB rendering (label width bounding, left alignment, centered icon row) and added/updated unit tests around the new layout math.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
client/src/shared/constants.tsx |
Adds TB cluster-root sizing constants (CLUSTER_ROOT_NODE_WIDTH, CLUSTER_ROOT_NODE_LABEL_WIDTH). |
client/src/pages/platform/workflow-editor/utils/postDagreConstraints.ts |
Adjusts branch-child alignment to use handle columns; expands condition branch offsets based on cross-size; adds cluster-root width/handle offset logic. |
client/src/pages/platform/workflow-editor/utils/postDagreConstraints.test.ts |
Extends constraint tests to cover configured cluster-root branches and the new offset computation. |
client/src/pages/platform/workflow-editor/utils/layoutUtils.tsx |
Centralizes Dagre node sizing via getDagreNodeSize() and reserves full TB width for configured cluster roots. |
client/src/pages/platform/workflow-editor/utils/layoutUtils.test.tsx |
Adds coverage for getDagreNodeSize() (TB + LR behavior). |
client/src/pages/platform/workflow-editor/nodes/AiAgentNode.tsx |
TB visual tweaks: left-align box, bound label width, center the configured icon row, improve truncation alignment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… handle offsets, rename layout fn - Consolidate the "configured cluster elements" predicate into a single exported hasConfiguredClusterElements() in postDagreConstraints.ts and reuse it across layoutUtils.tsx (removing nodeHasConfiguredClusterElements and the two inline hasValidClusterElements blocks). - Export REGULAR_NODE_HANDLE_OFFSET / CONFIGURED_CLUSTER_ROOT_HANDLE_OFFSET and import them in the test so the offsets stay coupled to the production values. - Rename pullSimpleConditionChildrenInward to alignSimpleConditionChildren and document its bidirectional (pull-inward/push-outward) behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <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.


Reserve a configured cluster-root node's full rendered width in the vertical
(TB) dagre layout and place condition branch children by handle column instead
of top-left, so cluster-root boxes (Approval/AI Agent) no longer overlap sibling
branches and stay aligned with the chain and their child nodes. Bound the inline
label width, center the cluster-element icon row, and left-align the box so its
icon sits on the connection handle.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com