eclipse-sirius / sirius-web

Sirius Web: open-source low-code platform to define custom web applications supporting your specific visual languages
https://eclipse.dev/sirius/sirius-web.html
Eclipse Public License 2.0
72 stars 48 forks source link

Add the ability to select newly created node #3980

Open sbegaudeau opened 1 week ago

sbegaudeau commented 1 week ago
pcdavid commented 1 week ago

We will leverage the exising WorkbenchSelection returned when invoking a tool on a diagram:

// diagram.graphqls
type InvokeSingleClickOnTwoDiagramElementsToolSuccessPayload {
  id: ID!
  newSelection: WorkbenchSelection
  messages: [Message]!
}

// core.graphqls
type WorkbenchSelection {
  entries: [WorkbenchSelectionEntry!]!
}

type WorkbenchSelectionEntry {
  id: String!
  label: String!
  kind: String!
}

Note that since #3675 the corresponding frontend type SelectionEntry no longer includes the label.

pcdavid commented 1 week ago

AFAICT, the infrastructure to propagate this during the evaluation of model opertations (e.g. ChildModelOperationHandler), and to return this as part of the tool's payload (e.g. in InvokeSingleClickOnDiagramElementToolEventHandler.handle()) is in place.

However the only place where the Success.NEW_SELECTION is actually set in the backend seems to be in NavigationOperationHandler.

From what I can see, it does not seem to be used on the frontend? It was used at some point, but it looks like something that has not yet been re-introduced in the new React Flow-based diagrams.