Skip to content

Fix edge labels rendered behind nodes and selected edges#203

Open
handreyrc wants to merge 4 commits into
serverlessworkflow:mainfrom
handreyrc:fix-edge-label-z-index
Open

Fix edge labels rendered behind nodes and selected edges#203
handreyrc wants to merge 4 commits into
serverlessworkflow:mainfrom
handreyrc:fix-edge-label-z-index

Conversation

@handreyrc

Copy link
Copy Markdown
Contributor

Closes: #199

Summary

This PR fixed the issue where edge labels are being rendered behind parent nodes and selected edges.

Changes

  • Added higher z-index styling to edge labels.
  • Adjusted edge z-index to work in a lower range than labels.
  • Added logic to handle label z-index on edge selection.
  • Added unit tests.

Copilot AI review requested due to automatic review settings June 25, 2026 23:28
@netlify

netlify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploy Preview for swf-editor ready!

Name Link
🔨 Latest commit 5d5c9e0
🔍 Latest deploy log https://app.netlify.com/projects/swf-editor/deploys/6a3e8307ba0ac90007b26ad8
😎 Deploy Preview https://deploy-preview-203--swf-editor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/serverless-workflow-diagram-editor/tests/react-flow/edges/Edges.test.tsx Outdated
@handreyrc handreyrc force-pushed the fix-edge-label-z-index branch from 5390e99 to 3f898d0 Compare June 25, 2026 23:33
Copilot AI review requested due to automatic review settings June 25, 2026 23:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread packages/serverless-workflow-diagram-editor/src/styles.css Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/diagram/Diagram.tsx Outdated
Comment thread pnpm-lock.yaml
jsdom:
specifier: ^29.1.0
version: 29.1.1
lint-staged:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Think you need to rebase as this shouldnt be included

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@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>
@handreyrc handreyrc force-pushed the fix-edge-label-z-index branch from c26042c to 99f8a18 Compare June 26, 2026 13:22
Copilot AI review requested due to automatic review settings June 26, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Signed-off-by: handreyrc <handrey.cunha@gmail.com>
@handreyrc handreyrc requested a review from lornakelly June 26, 2026 13:56

@lornakelly lornakelly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

bug: Edge labels rendered behind nodes and edges

3 participants