Skip to content

Fix edge labels rendered behind nodes and selected edges - #203

Merged
ricardozanini merged 4 commits into
open-workflow-specification:mainfrom
handreyrc:fix-edge-label-z-index
Jun 30, 2026
Merged

ricardozanini merged 4 commits into
open-workflow-specification: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.

@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 pnpm-lock.yaml Resolved
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
Collaborator

Choose a reason for hiding this comment

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

LGTM

@fantonangeli fantonangeli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, I only left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this file will be very useful in the future, and we won't lose track of the z-indexes

expect(resultString).toContain(`"zIndex":${expectedZIndex}`);
});

it("applies default regular label z-index when selected prop is not provided", () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this test is already covered by the selected: undefined at line 516

@handreyrc
handreyrc requested a review from ricardozanini June 30, 2026 12:59
@handreyrc

Copy link
Copy Markdown
Contributor Author

@ricardozanini,

This PR is good enough to be merged.

Thanks

@ricardozanini
ricardozanini merged commit fd9e132 into open-workflow-specification:main Jun 30, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Editor Project Tracker Jun 30, 2026
cheryl7114 pushed a commit to cheryl7114/editor that referenced this pull request Jul 3, 2026
ricardozanini pushed a commit that referenced this pull request Jul 3, 2026
* rebase main

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* feat: add toast alert system

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* test: update Mermaid Actions tests

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* add changeset

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* fix copilot complaints

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* feat: add Sonner

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* fix copilot complaints

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* fix: add license header

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* fix:  replace hardcoded colors with css variables in toast

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* feat: Styling tweaks (#206)

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* Fix edge labels rendered behind nodes and selected edges (#203)

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* Style start/end node components   (#202)

* start end node styling

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* Copilot and team review

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* updating pmpl from upstream

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* Copilot reviews

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* colour fixing

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* fixing colour

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* node unclickable

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* size made small

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* running pnpm changeset

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* naming changeset file

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* removed custom node container

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

* resolving warnings

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>

---------

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

* fix:  replace hardcoded colors with css variables in toast

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

---------

Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Co-authored-by: Cheryl Kong <cherylkong50@gmail.com>
Co-authored-by: lornakelly <lornakelly88@gmail.com>
Co-authored-by: Handreyrc <47090342+handreyrc@users.noreply.github.com>
Co-authored-by: Kumar Aditya Raj <sedulous.0007@gmail.com>
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

None yet

Development

Successfully merging this pull request may close these issues.

bug: Edge labels rendered behind nodes and edges

5 participants