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

Test: detect high contrast and detect OS color scheme #106389

Closed
4 tasks done
aeschli opened this issue Sep 10, 2020 · 2 comments
Closed
4 tasks done

Test: detect high contrast and detect OS color scheme #106389

aeschli opened this issue Sep 10, 2020 · 2 comments

Comments

@aeschli
Copy link
Contributor

aeschli commented Sep 10, 2020

Refs: #105715

Complexity: 3

Create Issue


Test the settings window.autoDetectColorScheme and window.autoDetectHighContrast. They now work on MacOS and in the Web as well.

On the web: High contrast detection is enabled on the latest Edge by default. On Chrome it has to be enabled with chrome://flags, enable Forced colors . light dark mode is enabled on Chrome by default, on Edge it has to be enabled in the Edge settings.

When window.autoDetectHighContrast is enabled (default on), VS Code reacts to high contrast change in the OS. When detected, it uses the theme specified at workbench.preferredHighContrastColorTheme.

When window.autoDetectColorScheme is enabled (default off), VS Code reacts to dark/light mode change in the OS. When detected, it uses the theme specified at workbench.preferredLightColorTheme and workbench.preferredDarkColorTheme

  • Test that VSCode detects the color scheme & hc changes
  • Test that VSCode switches to the preferred theme
  • Test that the workbench.colorTheme setting is changes to the new theme, but only in the user settings
  • Test that changes to the autoDetect settings to the preferred theme settings are honored.
  • Test that when toggling the the autoDetect settings back to off, the theme that was used before is set again. (Note: the last used theme is not remembered across restarts of VSCode)
  • Test that when starting VSCode, any color scheme OS changes that happend while VSCode was closed are detected
  • Test that changing the current theme to a non preferred theme is honored and is only changed back to the preferred theme when there is an actual color scheme OS change detected.
@bpasero
Copy link
Member

bpasero commented Sep 29, 2020

I saw some weird behaviour with restoring the previous configured theme. I was editing my settings (in the file) and removed all of them, including the "window.autoDetectColorScheme": true one. When I saved, my previous theme came back into the settings file. I wonder if we can be more clever and not do this if I change the settings file myself.

@aeschli
Copy link
Contributor Author

aeschli commented Sep 29, 2020

Ubuntu 20.04 supports light/dark mode. Electron detects the scheme on startup, but has a bug that the update event is not working: electron/electron#23861 (comment)
So in VS Code, "window.autoDetectColorScheme": true works on Linux, but only on startup.

@aeschli aeschli removed their assignment Sep 29, 2020
@JacksonKearl JacksonKearl removed their assignment Sep 29, 2020
@deepak1556 deepak1556 removed their assignment Sep 30, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants