Skip to content

use lightweight mode by default when vscode is running from web browsers - #1780

Merged
testforstephen merged 1 commit into
redhat-developer:masterfrom
Eskibear:reduce-notification
Feb 1, 2021
Merged

testforstephen merged 1 commit into
redhat-developer:masterfrom
Eskibear:reduce-notification

Conversation

@Eskibear

Copy link
Copy Markdown
Contributor

The purpose is to reduce pop-up notifications.
Here we remove the notification, and by default only launches LS in lightweight mode if vscode is running from a web browser. It's based on the hypothesis that when users open vscode on a web browser they mainly want to browse code or do simple editing.

@fbricon

fbricon commented Jan 27, 2021

Copy link
Copy Markdown
Collaborator

@rgrunber make sure this change doesn't break the Che/Theia integration

@rgrunber rgrunber assigned rgrunber and unassigned rgrunber Jan 27, 2021
@rgrunber
rgrunber requested review from fbricon and rgrunber January 27, 2021 14:31

@rgrunber rgrunber left a comment •

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.

This definitely affects Theia. env.uiKind is '2' (UIKind.Web) so the various prompts are skipped. Perhaps env.appName may need to be used to further narrow this down ?

@Eskibear

Copy link
Copy Markdown
Contributor Author

I just tested some scenarios on VS Code, below are possible values I found:

  • env.uiKind
    • 1 for desktop
    • 2 for web
  • env.appName
    • Visual Studio Code
    • Visual Studio Code - Insiders
  • env.remoteName
    • wsl when using Remote-WSL
    • ssh-remote when using Remote-SSH
    • codespaces when using GitHub Codespaces

So yes, we can check env.appName if you want to keep this notification in Che/Theia. Furthermore, with env.remoteName we actually have the potential to optimize for different scenarios.

@akaroml

akaroml commented Jan 28, 2021

Copy link
Copy Markdown
Contributor

I may suggest env.uiKind === "web" && env.appName.contains("Visual Studio Code")

@Eskibear
Eskibear force-pushed the reduce-notification branch from 0622d48 to 586dbce Compare January 29, 2021 04:55
@Eskibear
Eskibear force-pushed the reduce-notification branch from 586dbce to fa4f5f1 Compare January 29, 2021 04:57
@Eskibear

Copy link
Copy Markdown
Contributor Author

OK, I've updated the PR to check both env.uiKind and env.appName

@rgrunber rgrunber left a comment

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.

Looks fine to me. I can confirm Theia is excluded.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants