Skip to content

Ensure ApplicationShellOptions are properly used for shell init#12983

Merged
martin-fleck-at merged 1 commit intomasterfrom
issues/12982
Oct 11, 2023
Merged

Ensure ApplicationShellOptions are properly used for shell init#12983
martin-fleck-at merged 1 commit intomasterfrom
issues/12982

Conversation

@martin-fleck-at
Copy link
Contributor

What it does

Ensure ApplicationShellOptions are properly used for shell init
Fixes #12982

How to test

  1. Use a custom re-binding in your application, e.g., rebind(ApplicationShellOptions).toConstantValue(<ApplicationShell.Options>{ leftPanel: { initialSizeRatio: 0.5 } }); or replace the binding in Theia with something that has values (https://github.com/eclipse-theia/theia/blob/master/packages/core/src/browser/frontend-application-module.ts#L163)
  2. Ensure your workspace layout is reset to default.
  3. Expand the left sidebar and see that the right ratio is used.

Follow-ups

None.

Review checklist

Reminder for reviewers

@@ -307,15 +307,15 @@ export class ApplicationShell extends Widget {
this.options = {
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we could resolve the options directly in the constructor. There is no need to this in postConstruct because we don't rely on any injected services. This would also remove the need to expose the partial options as protected property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the having a look! Good point, I updated the PR with this simplification.

Copy link
Contributor

@tortmayr tortmayr left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix. Change works great and custom shell options are now properly picked up and used for shell init. 👍🏼

@martin-fleck-at martin-fleck-at merged commit f1056b3 into master Oct 11, 2023
@martin-fleck-at martin-fleck-at deleted the issues/12982 branch October 11, 2023 15:21
@github-actions github-actions bot added this to the 1.43.0 milestone Oct 11, 2023
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.

ApplicationShellOptions are not used on ApplicationShell

2 participants