-
Notifications
You must be signed in to change notification settings - Fork 24
Sticky list headers #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Sticky list headers #397
Conversation
Great contribution! 👏 I think we could consider making stickiness the default behavior for the list headers, like it is for the group headers. What do you think @barmac? Let's have our designer take a look too. cc. @lmbateman (Task > Inputs > Assignment type > Map > Map entries) I prepared a test branch in
I'll continue with a proper code review when we decide if we want to make it the new default. |
src/assets/properties-panel.css
Outdated
@@ -826,6 +826,18 @@ textarea.bio-properties-panel-input { | |||
height: 32px; | |||
} | |||
|
|||
.bio-properties-panel-list-entry-header.position-sticky { | |||
position: -webkit-sticky; /* for safari */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
position: sticky
is now widely available for all major browsers. I think we can skip it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out, I removed -webkit-sticky
I agree. It works great for the groups, so there's no reason to not make it the default for lists too. |
Thanks for trying this out! I'm guessing it would not be easy to move the left border to the left a few pixels to prevent the jump. If that's correct, then we should probably stay with the version without the left border. |
de6326c
to
1ecf52e
Compare
See my proposal for a simplified solution (1ecf52e), that:
It misses the edge case where the nested header is briefly hidden behind the main header. However, this isn’t noticeable during normal use of the properties panel, so I don’t think it’s worth adding extra logic to the Intersection Observer just to handle it. @barmac let's have a final look & merge. |
Could you please share a screencast? |
275e2ec
to
6e3acec
Compare
Is this what you meant? Screen.Recording.2025-06-12.at.15.20.46.mov |
This problem can be solved if we lower the z-index of the nested header. Screen.Recording.2025-06-12.at.15.26.31.mov |
I tried this out locally, via Overall it works correctly, and is a simple solution. However across list items and now map headers being sticky I miss the actual elements to be sticky, too. The fact that I am in the inputs section is now preserved, the fact that I'm within an input's map section is preserved. What I don't know is what input I'm currently manipulating. |
Indeed, we'd need to implement sticky Collapsible headers to achieve what you propose @nikku. That should close the story. |
Proposed Changes
Related to bpmn-io/bpmn-js-properties-panel#1103
These changes allow list headers to become sticky to the properties panel when scrolled past. This is particularly useful when managing long lists of values, as it eliminates the need to constantly scroll back up to add new elements to a list or map. It is especially convenient for maps where each entry contains multiple fields making scrolling distance quite long.
Additionally, there is the ability to set nesting levels for headers, which is useful when working with multiple nested lists or maps. This value is used to set z-index and top margin for the sticky position and to properly detect stickiness with
useStickyIntersectionObserver
hook.A value of 1 means that the list is at the first nesting level within its group section. If this property is not set, the header will behave as before.
How it looks like
Checklist
To ensure you provided everything we need to look at your PR:
@bpmn-io/sr
toolCloses {LINK_TO_ISSUE}
orRelated to {LINK_TO_ISSUE}