Fix edge labels rendered behind nodes and selected edges#203
Conversation
✅ Deploy Preview for swf-editor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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
| jsdom: | ||
| specifier: ^29.1.0 | ||
| version: 29.1.1 | ||
| lint-staged: |
There was a problem hiding this comment.
Think you need to rebase as this shouldnt be included
There was a problem hiding this comment.
@lornakelly,
It happened because I rebased and deleted node_modules, then I had issues with pnpm-lock.yaml, so I deleted and let it be generated and I got this issue you pointed.
Well I repeated the process but I used the orignal pnpm-lock.yaml from main instead.
It should be fixed now.
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>
Closes: #199
Summary
This PR fixed the issue where edge labels are being rendered behind parent nodes and selected edges.
Changes