-
Notifications
You must be signed in to change notification settings - Fork 30
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
392: Add structured nodes to the Workflow example #136
Conversation
d5099a6
to
bb3e18b
Compare
bb3e18b
to
a15baf7
Compare
a15baf7
to
5b1e350
Compare
@CamilleLetavernier I had a look at the code, fixed some minor issues and rebased it. There is still an issue with Sprottys implementation of the layout registry so I had to add a custom one to allow overriding layouts which we do for the 'vbox' layout. Other than that the code looks good! However, I am a bit concerned about the usage of 'layoutData'. In my opinion this is basically the same as 'layoutOptions' which are already provided by sprotty and for which we already have our customizations. I don't think we should introduce yet another mechanism but instead should stay as close as possible to sprotty. I think interpretation of the options is part of the layouter. So if we think a property should not be inherited, we simply do not go through the parent hierarchy using the default |
- Introduce Struct compartment with an X/YLayout (Freeform) - Add a custom VBoxLayout that supports both automatic (based on content) and manual resizing - Disable the collision movement restrictor in Workflow Example (Issue #394) Fixes eclipse-glsp/glsp/issues/392 Signed-off-by: Camille Letavernier <[email protected]>
- Remove workaround for layout registration -- Provide new layout registry that allows overriding - Fix new imports due to sprotty update - Fix some checkstyle issues
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.
Looks good to me, thank you for the update Tobias!
* 392: Add structured nodes to the Workflow example - Introduce Struct compartment with an X/YLayout (Freeform) - Add a custom VBoxLayout that supports both automatic (based on content) and manual resizing - Disable the collision movement restrictor in Workflow Example (Issue eclipse-glsp#394) Fixes eclipse-glsp/glsp/issues/392 Signed-off-by: Camille Letavernier <[email protected]> Co-authored-by: Martin Fleck <[email protected]>
* 392: Add structured nodes to the Workflow example - Introduce Struct compartment with an X/YLayout (Freeform) - Add a custom VBoxLayout that supports both automatic (based on content) and manual resizing - Disable the collision movement restrictor in Workflow Example (Issue eclipse-glsp#394) Fixes eclipse-glsp/glsp/issues/392 Signed-off-by: Camille Letavernier <[email protected]> Co-authored-by: Martin Fleck <[email protected]>
This PR depends on the corresponding server changes eclipse-glsp/glsp-server/pull/129
Note that the PR still contains the debug "construction lines" for the compartments, to highlight the shape of the compartment. It can be turned off by removing the
class-debug={true}
fromStructureCompartmentView
incompartments.tsx
. It was probably not necessary to introduce a new CompartmentView, but having decoration-support for Compartments can be helpful (And for future improvements, the compartment could have a different style from the parent Node, e.g. different background or specific borders, to separate the Header from the Compartment area).Regarding the custom LayoutRegistry, it should be considered a placeholder, until we can integrate the changes from Sprotty (See eclipse-sprotty/sprotty/issues/232). Once we update to the latest version of Sprotty, it can be removed.
The new VBox layout was intended to replace the original Sprotty one (With the same set of features, plus a few new parameters), however it turned out a bit more complicated than expected. Also, I didn't have enough use cases in the Workflow example to fully test it (Especially, we don't have list-compartments examples, or multi-compartment examples). So, I could only test it with a very simple case (Activity Nodes) and the new Structured Nodes (Categories).
Collision Movement Restrictor has been disabled in the Workflow example, because in its current state, it prevents manipulating nested nodes (Which always collide with their parent/children). I've opened eclipse-glsp/glsp/issues/394 for follow-up improvements.
The new Category nodes can be connected with Edges (From/To Tasks or other Categories), which can be used to reproduce the issue from eclipse-glsp/glsp/issues/224. No fix for that yet, though :)
In terms of model, the main change is the extraction of layout-specific parameters in a new (optional) "LayoutData" attribute. There are multiple reasons for this:
Finally, there are still several issues with this PR, as the goal was to introduce nested nodes in the Workflow example, to provide a reproducible example for solving bugs related to nested nodes, and to implement extra features such as reparenting. Especially, this branch does not include reparenting. At the moment, the only supported interactions for structured nodes are Create, Delete, Move and Resize.