Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ The new template for functional specification is located in `doc/iterations/YYYY
The technical specifications will now rely on a new architectural decision record template located in `doc/adrs/adr.adoc`.
This new template for ADRs will have several additional requirements compared to the previous one.
It will require contributors to specify the persons involved in the decision process, to details the qualities expected of the solution, to list the various options considered, to clarify why a specific option has been selected, its advantages and drawbacks, which steps will be taken for the implementation among other things.


- https://github.com/eclipse-sirius/sirius-web/issues/6215[#6215] [diagram] When a tool opens a selection dialog to ask for input, the tree displayed in the dialog is now expanded to reveal the element on which the tool was invoked to provide better context.

== 2026.3.0

Expand Down Expand Up @@ -203,8 +202,6 @@ Trees defined via the view DSL can alternatively provide a tooltip expression vi
- https://github.com/eclipse-sirius/sirius-web/issues/6267[#6267] [sirius-web] Allow customizing the content of the Views Explorer via delegates.
- https://github.com/eclipse-sirius/sirius-web/issues/6268[#6268] [sirius-web] Allow customizing the labels of the Views Explorer via delegates.



== 2026.1.0

=== Pitches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
TreeItemActionProps,
TreeView,
useExpandAllTreePath,
useTreePath,
} from '@eclipse-sirius/sirius-components-trees';
import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore';
import IconButton from '@mui/material/IconButton';
Expand All @@ -40,6 +41,7 @@ const useTreeStyle = makeStyles<{ hasSelection: boolean }>()((theme, { hasSelect
const initialState: SelectionDialogTreeViewState = {
expanded: [],
maxDepth: 1,
initialized: false,
};

export const SelectionDialogTreeView = ({
Expand All @@ -51,6 +53,7 @@ export const SelectionDialogTreeView = ({
}: SelectionDialogTreeViewProps) => {
const { classes } = useTreeStyle({ hasSelection: selectedTreeItemIds.length !== 0 });
const [state, setState] = useState<SelectionDialogTreeViewState>(initialState);
const { getTreePath, data: treePathData } = useTreePath();

const treeId = `selection://?treeDescriptionId=${encodeURIComponent(treeDescriptionId)}${encodeVariables(variables)}`;
const { tree } = useSelectionDialogTreeSubscription(editingContextId, treeId, state.expanded, state.maxDepth);
Expand All @@ -60,9 +63,30 @@ export const SelectionDialogTreeView = ({
...prevState,
expanded: newExpandedIds,
maxDepth: Math.max(newMaxDepth, prevState.maxDepth),
initialized: true,
}));
};

useEffect(() => {
if (tree && !state.initialized) {
var targetObjectId = variables.find((variable) => variable.name === 'targetObjectId')?.value as string;
getTreePath({
variables: {
editingContextId,
treeId: tree.id,
selectionEntryIds: [targetObjectId],
},
});
}
}, [tree, state.initialized, variables]);

useEffect(() => {
if (treePathData && treePathData.viewer?.editingContext?.treePath) {
const { treeItemIdsToExpand, maxDepth } = treePathData.viewer.editingContext.treePath;
onExpandedElementChange(treeItemIdsToExpand ?? [], maxDepth ?? 1);
}
}, [treePathData]);

return (
<div className={classes.borderStyle}>
{tree ? (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024, 2025 Obeo.
* Copyright (c) 2024, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand All @@ -24,4 +24,5 @@ export interface SelectionDialogTreeViewProps {
export interface SelectionDialogTreeViewState {
expanded: string[];
maxDepth: number;
initialized: boolean;
}
Loading