From fbad3eebd04afac5384fdfa736137faeed5bd54f Mon Sep 17 00:00:00 2001 From: Pierre-Charles David Date: Wed, 19 Jun 2024 11:12:11 +0200 Subject: [PATCH] [3645] Propagate a pseudo selection change when re-selecting a representation Bug: https://github.com/eclipse-sirius/sirius-web/issues/3645 Signed-off-by: Pierre-Charles David --- CHANGELOG.adoc | 1 + .../src/selection/SelectionContext.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 8322c5a90bc..676686f1f1a 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -58,6 +58,7 @@ More existing APIs will be migrated to this new common pattern. - https://github.com/eclipse-sirius/sirius-web/issues/3628[#3628] [sirius-web] Restore support for expand all and reveal in the explorer - https://github.com/eclipse-sirius/sirius-web/issues/3616[#3616] [diagram] Fix potential exceptions due to duplicate keys in diagram event processing - https://github.com/eclipse-sirius/sirius-web/issues/3624[#3624] [diagram] Fix an issue where the header separator does not fill the entire width of the node +- https://github.com/eclipse-sirius/sirius-web/issues/3645[#3645] [core] Fix a regression where clicking on an already selected representation did not re-open it === New Features diff --git a/packages/core/frontend/sirius-components-core/src/selection/SelectionContext.tsx b/packages/core/frontend/sirius-components-core/src/selection/SelectionContext.tsx index ca665fdd1e6..dcb24e4464c 100644 --- a/packages/core/frontend/sirius-components-core/src/selection/SelectionContext.tsx +++ b/packages/core/frontend/sirius-components-core/src/selection/SelectionContext.tsx @@ -41,7 +41,10 @@ export const SelectionContextProvider = ({ initialSelection, children }: Selecti .map((entry) => entry.id) .sort() .join(':'); - if (prevSelectionKey !== newSelectionKey) { + if ( + prevSelectionKey !== newSelectionKey || + selection.entries.find((entry) => entry.kind.startsWith('siriusComponents://representation?type=')) + ) { return { ...prevState, selection }; } else { return prevState;