Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve implementation around widget management #13818

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

pisv
Copy link
Contributor

@pisv pisv commented Jun 16, 2024

What it does

Mainly, this PR ensures that any widget promises returned by the WidgetManager will only resolve when the entire widget creation process has completed successfully, including the 'onWillCreateWidget` part.

(Prior to the fix, some widget promises returned by the WidgetManager could resolve as soon as the widget was created by its factory, which did not take into account the other parts of the widget creation process, such as the 'onWillCreateWidget' part.)

How to test

This PR is intended to be verified mainly by code inspection, but it is important to make sure that no regressions are introduced: all tests should still pass, and everything related to widget management should still work normally.

Review checklist

Reminder for reviewers

Mainly, ensures that any widget promises returned by the `WidgetManager`
will only resolve when the entire widget creation process has completed
successfully, including the 'onWillCreateWidget` part.

(Prior to the fix, some widget promises returned by the `WidgetManager`
could resolve as soon as the widget was created by its factory, which
did not take into account the other parts of the widget creation process,
such as the 'onWillCreateWidget' part.)
Copy link
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

As far as I can tell, everything still works as expected and the introduced awaiting of the onWillCreateWidget listeners absolutely make sense in my opinion. Thank you very much @pisv!

I can see that the 3PP License Check but it is unrelated to this PR.

@@ -96,7 +96,7 @@ export abstract class WidgetOpenHandler<W extends BaseWidget> implements OpenHan
...options
};
if (!widget.isAttached) {
this.shell.addWidget(widget, op.widgetOptions || { area: 'main' });
await this.shell.addWidget(widget, op.widgetOptions || { area: 'main' });
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@pisv
Copy link
Contributor Author

pisv commented Jun 27, 2024

As far as I can tell, everything still works as expected and the introduced awaiting of the onWillCreateWidget listeners absolutely make sense in my opinion. Thank you very much @pisv!

@martin-fleck-at Thank you very much for your review and approval!

@martin-fleck-at martin-fleck-at merged commit f996098 into eclipse-theia:master Jun 27, 2024
13 of 14 checks passed
@pisv pisv deleted the fix-widget-manager branch June 27, 2024 13:23
@sgraband sgraband added this to the 1.52.0 milestone Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants