Skip to content

[2590] Redefine the selected nested feature chain and document the tool - #2676

Open
jerome-obeo wants to merge 1 commit into
eclipse-syson:mainfrom
jerome-obeo:jgo/enh/redefinition_nested_feature_final
Open

jerome-obeo wants to merge 1 commit into
eclipse-syson:mainfrom
jerome-obeo:jgo/enh/redefinition_nested_feature_final

Conversation

@jerome-obeo

Copy link
Copy Markdown
Contributor

Execute redefinition on confirmation dialog of the Redefined a nested feature tool and reveal the resulting feature in the Model Explorer.

Bug: #2590

PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW

Auto review

  • Have you reviewed this PR? Please do a first quick review, It is very useful to detect typos and missing copyrights, check comments, check your code... The reviewer will thank you for that :)

Project management

  • Has the pull request been added to the relevant milestone?
  • Have the queue: and review-window: labels been added to the pull request? (In case of doubt, start with the labels queue: triage and review-window: unscheduled)
  • Have the relevant issues been added to the pull request?
  • Have the relevant labels been added to the issues? (package:, type:)
  • Have the relevant issues been added to the same project milestone as the pull request?

Changelog and release notes

  • Has the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc been updated to reference the relevant issues?
  • Have the relevant API breaks been described in the CHANGELOG.adoc?
  • Are the new / upgraded dependencies mentioned in the relevant section of the CHANGELOG.adoc?
  • In case of a change with a visual impact, are there any screenshots in the doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • In case of a key change, has the change been added to Key highlights section in doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?

Documentation

  • Have you included an update of the documentation in your pull request? Please ask yourself if an update (installation manual, user manual, developer manual...) is needed and add one accordingly.

Tests

  • Is the code properly tested? Any pull request (fix, enhancement or new feature) should come with a test (or several). It could be unit tests, integration tests or cypress tests depending on the context. Only doc and releng pull request do not need for tests.

Comment on lines +265 to +270
{
canHandle: (representationKind: string, tool: GQLTool) => {
return representationKind === DIAGRAM_REPRESENTATION_KIND && tool.label === 'Redefine a nested feature';
},
component: RedefineNestedFeatureToolOverriddenContribution,
},

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to register a custom tool in order to provide the selection in both Model explorer and diagram of the last feature of the selected feature chain .

@jerome-obeo
jerome-obeo force-pushed the jgo/enh/redefinition_nested_feature_final branch from db38152 to 48decb1 Compare November 26, 2026 10:50
@AxelRICHARD AxelRICHARD added this to the 2026.12.0 milestone Nov 26, 2026
@AxelRICHARD AxelRICHARD added queue: triage A reviewer needs to evaluate the capacity to review this PR review-window: unscheduled The PR is not scheduled for review labels Nov 26, 2026
@AxelRICHARD AxelRICHARD linked an issue Nov 26, 2026 that may be closed by this pull request
@adaussy

adaussy commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Test the complete tool execution and final selection

  • Cause: The new tests call the Java service directly. They do not exercise dialog selection resolution, the AQL operation, the returned newSelection, or the custom frontend code that updates Explorer and Details.
  • Fix: Add an integration test invoking the actual diagram tool and checking the created chain and final selection. Add a browser test confirming that Explorer reveals the last redefined feature and Details displays it, including when the feature has no graphical node.
  • If skipped: The existing tests can remain green while the main user workflow fails between dialog confirmation and final selection.

@jerome-obeo
jerome-obeo force-pushed the jgo/enh/redefinition_nested_feature_final branch from 48decb1 to 2361b02 Compare November 26, 2026 14:42
@jerome-obeo

Copy link
Copy Markdown
Contributor Author

Test the complete tool execution and final selection

* Cause: The new tests call the Java service directly. They do not exercise dialog selection resolution, the AQL operation, the returned newSelection, or the custom frontend code that updates Explorer and Details.

* Fix: Add an integration test invoking the actual diagram tool and checking the created chain and final selection. Add a browser test confirming that Explorer reveals the last redefined feature and Details displays it, including when the feature has no graphical node.

* If skipped: The existing tests can remain green while the main user workflow fails between dialog confirmation and final selection.

Done, 3 tests have been added:

  • an integration test verifying that the diagram tool redefines the chain selected in the dialog and returns its last feature in newSelection.
  • a E2E test verifying that confirming dialog after selecting wheel feature automatically reveals and selects the feature in Explorer and displays it in Details.
  • a E2E test verifying the same behavior for wheel.diameter, whose last feature has no graphical node.

@jerome-obeo
jerome-obeo changed the base branch from ada/fix/2654-part1 to main November 26, 2026 14:52
@adaussy

adaussy commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Update the changelog and document the constructor API break

  • Cause: The PR updates the release notes but leaves the existing changelog entry unchanged. It also replaces TreeMutationAQLService’s implicit public no-argument constructor with a constructor requiring IFeedbackMessageService, without migration guidance.
  • Fix: Extend the existing Provide tool to ease the redefinition of nested feature #2590 entry with chain materialization and final selection. Add a Breaking changes entry identifying the constructor change and explaining that direct callers must supply a feedback service.
  • If skipped: The changelog does not describe the completed functionality, and downstream callers encounter a constructor incompatibility without documented migration instructions.

@jerome-obeo

Copy link
Copy Markdown
Contributor Author

Update the changelog and document the constructor API break

* Cause: The PR updates the release notes but leaves the existing changelog entry unchanged. It also replaces TreeMutationAQLService’s implicit public no-argument constructor with a constructor requiring IFeedbackMessageService, without migration guidance.

* Fix: Extend the existing [Provide tool to ease the redefinition of nested feature #2590](https://github.com/eclipse-syson/syson/issues/2590) entry with chain materialization and final selection. Add a Breaking changes entry identifying the constructor change and explaining that direct callers must supply a feedback service.

* If skipped: The changelog does not describe the completed functionality, and downstream callers encounter a constructor incompatibility without documented migration instructions.

Done

@jerome-obeo
jerome-obeo force-pushed the jgo/enh/redefinition_nested_feature_final branch 2 times, most recently from e3df3ed to 2bd1118 Compare November 26, 2026 17:42
@adaussy
adaussy marked this pull request as ready for review November 27, 2026 07:03
return;
}
registerPostToolSelection(payload.id, selection);
setSelection(selection);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Palette search with Enter skips Explorer and Details focus

Import RedefineNestedFeature.sysml from this PR and open view1. On vehicle, search the palette for Redefine a nested feature and press Enter from the search field. Select wheel.diameter and confirm. The redefinition is created, but Explorer and Details do not focus on the new diameter.

  • Cause — Sirius Web's palette search invokes the default diagram tool handler on Enter. The calls that update the workbench selection and reveal the feature in Explorer live inside this override's click handler. The default handler relies on a matching graphical element, and diameter has none in this view.
  • Fix — Route Enter and pointer activation through the same tool execution and selection handling. Add a keyboard case to the existing Playwright test using wheel.diameter.
  • If skipped — Keyboard users can create the redefinition but must find it manually before editing its properties.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* the feature chain selected in the dialog
* @return the local redefined feature chain, or null on failure
*/
public List<Feature> redefineFeatureChain(Type context, ContextualFeatureChain chain) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please stop declaring new methods in XXXAQLService class.
As I already told you, those classes are only here to delegate to other service classes.

Here you should declare redefineFeatureChain in a new TreeMutationSelectionDialogService.java
Then in this TreeMutationAQLService you should only declare:

public List<Feature> redefineFeatureChain(Type context, ContextualFeatureChain chain) {
 return this.treeMutationSelectionDialogService.redefineFeatureChain(context, chain);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

List<Feature> result = this.service.redefineFeatureChain(context, new ContextualFeatureChain(context, List.of(action, parameter)));

// THEN null is returned, existing relationships are preserved and no local feature is created
assertThat(result).isNull();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dialog offers parameter chains that confirmation rejects

part def Base {
    action run {
        in attribute input;
    }
}
part p : Base;

Show p in a General View, open Redefine a nested feature, select run.input, and confirm. The tool asks you to select a feature outside the parameter list and creates no redefinition.

  • Cause — The dialog checks accessibility and whether a chain needs a local redefinition. The mutation service rejects input parameters under actions, and this test confirms that rejection.
  • Fix — Filter out chains containing unsupported segments using the same eligibility rules as the mutation service, or integrate positional parameter redefinition before offering these chains. Test the dialog and confirmation together for run.input.
  • If skipped — Users can confirm a selectable path that the tool cannot complete, even when the model stays exactly as it was when the dialog opened.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is using MM services to create redefinitions. The commit c9e1196 which has been merged recently, takes this situation in charge.
Therefore, since this is now working properly, this test can be changed to handle input parameters redefinition.

Comment thread CHANGELOG.adoc Outdated

=== Breaking changes

- https://github.com/eclipse-syson/syson/issues/2590[#2590] [services] `TreeMutationAQLService` now requires an `IFeedbackMessageService` constructor argument instead of providing a public no-argument constructor.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Append the constructor change to the end of Breaking changes

Open the current release's Breaking changes section. The new TreeMutationAQLService entry appears above the existing #2582 entry.

Please do it for every PR, it's not the first time you do that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Confirming a selection closes the dialog without modifying the model.
Actual feature redefinition will be added in a subsequent change.
** A new _Redefine a nested feature_ tool is available in the _Structure_ section of diagram palettes for `Usage` and `Definition` nodes.
Users can select a feature path to create the required local redefinitions in one operation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add a link to the documentation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@AxelRICHARD AxelRICHARD added queue: in-review The PR is being reviewed, the PR author must not update the PR review-window: week 3 The PR is scheduled for review in the third week of the iteration and removed queue: triage A reviewer needs to evaluate the capacity to review this PR review-window: unscheduled The PR is not scheduled for review labels Nov 27, 2026
Execute redefinition on confirmation dialog of the Redefined a nested
feature tool and reveal the resulting feature in the Model Explorer.

Bug: eclipse-syson#2590
Signed-off-by: Jerome Gout <jerome.gout@obeosoft.com>
@jerome-obeo
jerome-obeo force-pushed the jgo/enh/redefinition_nested_feature_final branch from 2bd1118 to f5af47d Compare November 27, 2026 16:30

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

queue: in-review The PR is being reviewed, the PR author must not update the PR review-window: week 3 The PR is scheduled for review in the third week of the iteration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide tool to ease the redefinition of nested feature

3 participants