Skip to content

Sticky lane labels - #2384

Draft
hechler wants to merge 14 commits into
bpmn-io:developfrom
hechler:sticky-lane-labels
Draft

Sticky lane labels#2384
hechler wants to merge 14 commits into
bpmn-io:developfrom
hechler:sticky-lane-labels

Conversation

@hechler

@hechler hechler commented Jan 28, 2026

Copy link
Copy Markdown

Proposed Changes

This pull request addresses the following issue: camunda/camunda-modeler#1345

It improves the swimlane overlay by displaying the lane name at the top when the original label scrolls out of the viewport. The overlay is removed once the entire lane leaves the viewport.

Demo:

output.mov

Checklist

Ensure you provide everything we need to review your contribution:

  • Contribution meets our definition of done
  • Pull request establishes context
    • [] Link to related issue(s), i.e. Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}
    • Brief textual description of the changes
    • Screenshots or short videos showing UI/UX changes
    • Steps to try out, i.e. using the @bpmn-io/sr tool

@CLAassistant

CLAassistant commented Jan 28, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hechler
hechler marked this pull request as ready for review January 28, 2026 11:03
Copilot AI review requested due to automatic review settings January 28, 2026 11:03

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 implements a sticky lane label feature that displays the swimlane name at the top of the viewport when the original label scrolls out of view, addressing issue #1345.

Changes:

  • Added a new StickyLaneLabels module that creates overlay labels for BPMN participant pools
  • Integrated the module into the Modeler's modeling modules
  • Added CSS styles for the sticky labels with visibility control

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
lib/features/sticky-lane-labels/index.js Module definition that exports and registers the StickyLaneLabels feature
lib/features/sticky-lane-labels/StickyLaneLabels.js Core implementation that manages sticky label overlays and viewport position tracking
lib/Modeler.js Integration of StickyLaneLabelsModule into the modeling modules array
assets/bpmn-js.css Styling for sticky labels with hidden state support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


// after label edit
eventBus.on('element.changed', (e) => {
if (e.element.type === 'bpmn:Lane') {

Copilot AI Jan 28, 2026

Copy link

Choose a reason for hiding this comment

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

The overlay logic targets 'bpmn:Participant' elements (line 9), but this event handler checks for 'bpmn:Lane'. When a lane is edited, the overlays won't be updated because addOverlays() processes participants, not lanes. This should check for 'bpmn:Participant' instead.

Suggested change
if (e.element.type === 'bpmn:Lane') {
if (e.element.type === 'bpmn:Participant') {

Copilot uses AI. Check for mistakes.
Comment thread assets/bpmn-js.css Outdated
/*transform: rotate(270deg);*/
}

.hidden{

Copilot AI Jan 28, 2026

Copy link

Choose a reason for hiding this comment

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

Missing space after class selector. Should be '.hidden {' for consistency with the project's CSS formatting style.

Suggested change
.hidden{
.hidden {

Copilot uses AI. Check for mistakes.
Comment thread assets/bpmn-js.css Outdated
border-radius: 4px;
pointer-events: none;
white-space: nowrap;
/*transform: rotate(270deg);*/

Copilot AI Jan 28, 2026

Copy link

Choose a reason for hiding this comment

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

Commented-out code should be removed. If this transformation might be needed in the future, document the reasoning in a comment instead of leaving dead code.

Suggested change
/*transform: rotate(270deg);*/

Copilot uses AI. Check for mistakes.
Comment thread lib/Modeler.js
Comment on lines +156 to +157


Copilot AI Jan 28, 2026

Copy link

Choose a reason for hiding this comment

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

Multiple consecutive blank lines are unnecessary and should be reduced to a single blank line for cleaner code formatting.

Copilot uses AI. Check for mistakes.
@jarekdanielak

jarekdanielak commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution! ❤️

Why did you choose to put the label on top of the element instead of the solution proposed in the issue? In my opinion, it's not intuitive if the label changes its location completely.

It can break sometimes, too. 😉

image

@barmac

barmac commented Feb 4, 2026

Copy link
Copy Markdown
Member

We need you to sign the CLA, otherwise we cannot merge your contribution. Feel free to ping me once it's done.

@nikku

nikku commented Feb 4, 2026

Copy link
Copy Markdown
Member

As @jarekdanielak mentioned, this is not an intuitive solution.

  • I expect the pool label to vanish, when the pool goes out of sight
  • I expect to be able to see both pool and lane labels

We need to figure if outside or within pool is the right way to do it. I expect inside of pool is more robust, because users can easily "zoom in", as shown below:

capture akt0Ah_optimized

In such cases we need to establish context on pool, lane or sub-process.

@barmac barmac added the needs review Review pending label Mar 10, 2026 — with bpmn-io-tasks
@barmac
barmac marked this pull request as draft March 11, 2026 13:54
@bpmn-io-tasks bpmn-io-tasks Bot removed the needs review Review pending label Mar 11, 2026
@barmac

barmac commented Mar 11, 2026

Copy link
Copy Markdown
Member

@hechler Feel free to tag me once you address the feedback from #2384 (comment)

@barmac barmac added the backlog Queued in backlog label Mar 11, 2026
@timonlazarviadee

Copy link
Copy Markdown
Contributor

Good morning,

We have changed the contributor internally for this PR. To clarify the needs of the new contributor, I would like to discuss the following points:

  1. Implement a zoom correction to manage text overflow and ensure it stays within the pool.
  2. As a user of bpmn.io, I would expect the lane name (as shown in picture 1) to remain at the edge of the pool as long as the pool is visible. Therefore, I would assume that the red section should move along until either the lane or the pool is out of view.
  3. Additionally, implement the same behavior for the lanes, as you have already mentioned.

picture 1
image

Thank you!

@timonlazarviadee

Copy link
Copy Markdown
Contributor

The current state of the branch reflects what I was trying to explain in my comment: #2384 (comment)

2026-07-27.13-33-01.mp4

The behavior should remain stable when zooming in or out. Additionally, the overlay should disappear when the corresponding participant or lane is outside the viewport.

2026-07-27.13-33-13.mp4

Even a complex, nested lane structure is represented using the same behavior.

2026-07-27.13-33-40.mp4

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

Labels

backlog Queued in backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants