Skip to content

Editor manager should be singleton, patched layout restorer to avoid duplicate editor tabs #1024

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

Merged
merged 3 commits into from
Jun 8, 2022

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Jun 7, 2022

Motivation

This PR should fix the duplicate editor tab issue.

Change description

  • Fixes the dependency injection by binding the editor manager in a singleton scope,
  • Added a workaround in the layout data parser to drop preview editor constructions options when restoring the layout at app startup.

Other information

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@kittaakos kittaakos requested a review from fstasi June 7, 2022 12:52
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jun 7, 2022
Copy link
Contributor

@fstasi fstasi left a comment

Choose a reason for hiding this comment

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

it does perfectly make sense!

Added some logging when filtering the layout data.

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos kittaakos force-pushed the editor-manager-di branch 2 times, most recently from d15e4b0 to 4d38eb4 Compare June 8, 2022 06:51
@kittaakos kittaakos changed the title Editor manager should be singleton. Editor manager should be singleton, patched layout restorer to avoid duplicate editor tabs Jun 8, 2022
@kittaakos kittaakos force-pushed the editor-manager-di branch from 4d38eb4 to 1fde017 Compare June 8, 2022 08:30
Akos Kitta added 2 commits June 8, 2022 16:38
Customized the shell layout restorer:
 - If a resource is about to open in code editor and preview,
do not open the preview.
 - If a resource is about to open in preview only, open a code
editor instead.

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos kittaakos force-pushed the editor-manager-di branch from d6a6ccd to 16e4623 Compare June 8, 2022 14:40
}
return desc;
})
.filter(notEmpty);
Copy link
Contributor

Choose a reason for hiding this comment

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

for the sake of performance: I see 3 loops here: forEach, map, filter. If we expect this to be time consuming we could think of refactoring it a bit in the future. Btw this is fine as of now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
3 participants