eclipse-sprotty / sprotty

A diagramming framework for the web
https://sprotty.org/
Eclipse Public License 2.0
731 stars 83 forks source link

AbstractUIExtension enabled on startup #463

Open MatDau opened 2 months ago

MatDau commented 2 months ago

I am creating a vscode extension that uses sprotty to draw diagrams integrated with an LSP. I am trying to develop an AbstractUIExtension that simulates like a chat on the diagram and I would like this to start at a start-up. I have tried several ways but have yet to succeed. Is there a way?

spoenemann commented 2 months ago

It's not necessary to use that interface for integrating additional UI with the diagram. You can just use any UI framework like React and position the element where you want it using CSS. The question is how tightly you want to integrate that UI with the inner workings of the diagram viewer. There is no general answer to that because it depends on what information from the diagram is needed by the UI.

MatDau commented 2 months ago

I want my UI to be very diagram-related, as I would like to realize a chat that then sends WorkspaceEdits.

I was able to activate the AbstractUIextension at diagram startup by having my UI extension implement IActionHandler and handle a SetModelAction to send the SetUIExtensionVisibilityAction