-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
implement workbench: startup editor preference #12813
implement workbench: startup editor preference #12813
Conversation
packages/getting-started/src/browser/getting-started-contribution.ts
Outdated
Show resolved
Hide resolved
packages/getting-started/src/browser/getting-started-contribution.ts
Outdated
Show resolved
Hide resolved
packages/getting-started/src/browser/getting-started-contribution.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @msujew ,
Thanks for reviewing, I have addressed your comments and fixed the implementation errors. It should be a lot cleaner now 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me. Each of the new preference values seem to work as expected 👍
@vince-fugnitto Do you want to merge this? |
Not yet, I'm still performing an offline review with @vladarama about the changes. |
packages/getting-started/src/browser/getting-started-contribution.ts
Outdated
Show resolved
Hide resolved
packages/getting-started/src/browser/getting-started-contribution.ts
Outdated
Show resolved
Hide resolved
packages/getting-started/src/browser/getting-started-contribution.ts
Outdated
Show resolved
Hide resolved
packages/getting-started/src/browser/getting-started-contribution.ts
Outdated
Show resolved
Hide resolved
packages/getting-started/src/browser/getting-started-preferences.ts
Outdated
Show resolved
Hide resolved
packages/getting-started/src/browser/getting-started-contribution.ts
Outdated
Show resolved
Hide resolved
This commit introduces 5 new startup editor preferences: - none: no editor will be shown on startup - welcomePage: the default welcome page will be shown on startup - readme: it will open the folder's readme in preview mode - newUntitledFile: opens an untitled file on startup - welcomePageInEmptyWorkbench: only opens the welcome page when opening empty workbench
This commit aims to address and fix various comments received on the PR: - This includes waiting for the `preferenceService` and the `workspaceService` to be ready before actually using them. - It also includes a minor refactoring of the `openReadme` method to avoid the conversion from URI -> string -> URI. Signed-Off-By: Vlad Arama <vlad.arama@ericsson.com>
This commit removes the `alwaysShowWelcomePage` preference to allow the checkbox to toggle between the `welcomePage` (checked) and `none` (unchecked) states. This is the behavior currently present in vscode. Signed-off-by: Vlad Arama <vlad.arama@ericsson.com>
This commit addresses a few comments: - Move preferences from `@theia/core` to `@theia/getting-started` - Simplify `newUntitledFile` code to reuse the command Signed-off-by: Vlad Arama <vlad.arama@ericsson.com>
This commit addresses review comments by doing the following: - Remove unused injections - Use `NEW_UNTITLED_TEXT_FILE` instead of `NEW_UNTITLED_FILE` - Fix typos and align preference id with VS Code Signed-off-by: Vlad Arama <vlad.arama@ericsson.com>
5befee0
to
c5ae16d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 I confirmed the following workbench.startupEditor
:
Preference | Use-Case | Result |
---|---|---|
welcomePage |
no editors present | the welcome page is opened on startup |
welcomePage |
no editors present (no workspace) | the welcome page is opened on startup |
welcomePage |
editors present | the welcome page is not opened on startup |
none |
all cases | nothing happens on startup besides restoring past views |
newUntitledFile |
no editors present | an untitled text file is opened on startup |
newUntitledFile |
no editors present (no workspace) | an untitled text file is opened on startup |
newUntitledFile |
editors present | no untitled file is opened on startup |
readme |
no editors present | the readme is opened on startup |
readme |
no editors present, no readme present in the workspace | the welcome page is opened as a fallback on startup |
readme |
no editors present (no workspace) | the welcome page is opened as a fallback on startup |
readme |
editors present | no readme is opened on startup |
welcomePageInEmptyWorkbench |
workspace present | no welcome page is opened on startup |
welcomePageInEmptyWorkbench |
no workspace present | the welcome page is opened on startup |
What it does
Fixes: #12754
This PR implements the workbench: startup editor preference. This allows the user to choose which editor is shown on startup when none are restored from the previous session.
Implemented preferences:
none
: no editor will be shown on startup.welcomePage
: the default welcome page will be shown on startup.readme
: it will open the folder's readme file in preview mode.newUntitledFile
: opens an untitled file on startup.welcomePageInEmptyWorkbench
: only opens the welcome page when openingempty workbench.
How to test
Settings
->workbench: startup editor
and select one of the preference to test.Review checklist
Reminder for reviewers