This is particularly visible when a large diagram is opened.
Open a project with two diagrams, one small (S) and one big (B).
Open S, select a element in the explorer.
Expand/collapse the element in the explorer, not changing the selection. The effect is immediate.
Open B instead of S, and repeat step 3, expanding/collapsing the same element. It is now very slow.
There is no actual selection change, but since SelectionContextProvider's setSelection does not check that it calls setState with a new selection objet structurally equivalent but different in terms of identity. Now that the selection context is high in the component hierarchy, this re-renders the whole workbench, including the big diagram.
The solution is the same as in d995d6e79d41926f41290f0b4661a1ae118bc2b9: update the selection state if the key is new value is really structurally different from the previous one.
This is particularly visible when a large diagram is opened.
There is no actual selection change, but since
SelectionContextProvider
'ssetSelection
does not check that it callssetState
with a new selection objet structurally equivalent but different in terms of identity. Now that the selection context is high in the component hierarchy, this re-renders the whole workbench, including the big diagram.The solution is the same as in d995d6e79d41926f41290f0b4661a1ae118bc2b9: update the selection state if the key is new value is really structurally different from the previous one.