Sticky lane labels - #2384
Conversation
There was a problem hiding this comment.
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
StickyLaneLabelsmodule 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') { |
There was a problem hiding this comment.
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.
| if (e.element.type === 'bpmn:Lane') { | |
| if (e.element.type === 'bpmn:Participant') { |
| /*transform: rotate(270deg);*/ | ||
| } | ||
|
|
||
| .hidden{ |
There was a problem hiding this comment.
Missing space after class selector. Should be '.hidden {' for consistency with the project's CSS formatting style.
| .hidden{ | |
| .hidden { |
| border-radius: 4px; | ||
| pointer-events: none; | ||
| white-space: nowrap; | ||
| /*transform: rotate(270deg);*/ |
There was a problem hiding this comment.
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.
| /*transform: rotate(270deg);*/ |
|
|
||
|
|
There was a problem hiding this comment.
Multiple consecutive blank lines are unnecessary and should be reduced to a single blank line for cleaner code formatting.
|
We need you to sign the CLA, otherwise we cannot merge your contribution. Feel free to ping me once it's done. |
|
As @jarekdanielak mentioned, this is not an intuitive solution.
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: In such cases we need to establish context on pool, lane or sub-process. |
|
@hechler Feel free to tag me once you address the feedback from #2384 (comment) |
|
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:
Thank you! |
|
The current state of the branch reflects what I was trying to explain in my comment: #2384 (comment) 2026-07-27.13-33-01.mp4The 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.mp4Even a complex, nested lane structure is represented using the same behavior. 2026-07-27.13-33-40.mp4 |



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:
Closes {LINK_TO_ISSUE}orRelated to {LINK_TO_ISSUE}@bpmn-io/srtool