Fix edge labels rendered behind nodes and selected edges#203
Open
handreyrc wants to merge 4 commits into
Open
Conversation
✅ Deploy Preview for swf-editor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #199 by ensuring edge labels consistently render above parent nodes and above selected edges in the React Flow-based diagram editor.
Changes:
- Elevates the React Flow edge-label renderer container via CSS so labels don’t get painted behind nodes.
- Introduces a z-index hierarchy where regular edges (0) < selected edges (100) < labels (1000+), and disables React Flow’s automatic edge elevation on select.
- Adds/updates unit tests to cover edge/label z-index behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/serverless-workflow-diagram-editor/tests/react-flow/edges/Edges.test.tsx | Adds tests for EdgeLabel z-index behavior and edge selection integration. |
| packages/serverless-workflow-diagram-editor/tests/react-flow/diagram/Diagram.test.tsx | Adds tests for elevateEdgesOnSelect={false} and edge z-index behavior in Diagram. |
| packages/serverless-workflow-diagram-editor/src/react-flow/edges/Edges.tsx | Adds selected-aware z-index styling to edge labels. |
| packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.tsx | Applies explicit z-index management for edges and disables automatic edge elevation on selection. |
| packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.css | Elevates .react-flow__edgelabel-renderer above nodes to prevent labels being hidden. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5390e99 to
3f898d0
Compare
33ede30 to
c26042c
Compare
lornakelly
reviewed
Jun 26, 2026
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
c26042c to
99f8a18
Compare
Signed-off-by: handreyrc <handrey.cunha@gmail.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.
Closes: #199
Summary
This PR fixed the issue where edge labels are being rendered behind parent nodes and selected edges.
Changes