-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add alignment and distribution buttons to the context pad #1682
Add alignment and distribution buttons to the context pad #1682
Conversation
Indeed, I also have a feeling that we should use the popup menu. This will be especially visible when we add the distribution. |
709066a
to
bc6e360
Compare
I like the placement. But I think the icons feel a bit crowded, partially because being all outlines makes it harder to instantly figure out what the icon is. In the example Nico gave, the icons appear cleaner. Also another example: This is just my perception. I know we are not designers and have little design resources at the moment 😅 I can try with the icons and help if needed. |
At the moment, I am mostly re-using the icons from Camunda Modeler (the one in the context pad is mine). I am open to re-designing the icons as a next step after we agree on the layout. |
@barmac makes sense. Looks nice for the first iteration, specially with more space. Nice work |
Just added a second sketch with even more space to #1682 (comment) |
We designed these icons a long time ago. I think they're ready for an overhaul. |
It seems we do not only need to refresh styles, but also add features to the Popup Menu code. I identified grouping so far but there may be more. Or we can reimplement the menu for align&distribution, as we did in the connectors extension 😉 . At the moment, Popup Menu can be shortly described as "give me list of header entries to display next to each other, and a list of regular entries to display one below another". This is in fact too little to implement #1682 (comment), so I will need to spend some more time on it. |
@barmac The latest design works for now in my opinion. |
As we incorporate create/append anything into the core we'll get things aligned (again). |
I have two ideas how we can improve the popup menu so that it can be used for this PR and possible future improvements:
eventBus.on('popup-menu.render', (menuId, node) => /* do stuff with node and return `true` if handled */) For the current task of align/distribute menu, the minimal solution seems to be good enough. This is what I will implement but we can keep |
+1 for doing that. If data-attributes are attached to the groups styling can be done naturally to achieve what you showcased. |
New challenge: Distribution and align actions can sometimes be cancelled internally when the action does not make sense (e.g. distribution of a task with boundary event). Notice how the popup menu does not close on the capture below for alignment. It closes for distribution actions, but only because I force it: Screen.Recording.2022-06-27.at.15.37.09.movThe non-action buttons are similar to what Miro has, where the buttons are also displayed as disabled: So I can see the following solutions:
I'd rather not display disabled controls as a user cannot make any use of them. I am sure we should close the popup menu once a button is clicked. I think that in the end a solution based on rules (3) is the most intuitive. I doubt a user could be surprised there is no option to distribute elements if too few are selected. Still, in the initial iteration, we could have (1), and implement rules as a next step. |
7b14df1
to
50e01e7
Compare
I implemented option (1). Test this with:
|
50e01e7
to
a85103b
Compare
008af35
to
62b315f
Compare
This is now ready for review. |
a980d70
to
27ae402
Compare
I played around with it a bit and noticed something strange. On the simple process, if I align everything Obviously this is not what this tool was intended for, but would be interesting to know what causes a reconnect in the first place. Is |
That is what's happening, yes. |
I guess we could prevent this, but isn't it an edge case? |
I would say it is an edge case that we don't have to fix right now |
I've created an issue for this: #1693 |
I will check this. Thanks for pointing this out. |
Otherwise, this is looking really good and very solid. Looking forward to getting that thing out of the door. 💪🏻 |
OK it doesn't make sense. For some unknown to me reason, the legacy code disallowed distribution of participants. |
I will add a test case for this. |
27ae402
to
2c75c8f
Compare
OK done @philippfromme |
This broke other tests 🙈 |
2c75c8f
to
8218ec3
Compare
OK Fixed. |
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.
Great job! 🚀
Closes #1680
Closes #1691
Requires bpmn-io/diagram-js#656