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

Have to click twice to switch from light to dark mode when my browser theme is dark #26004

Open
gabrc52 opened this issue Aug 19, 2023 · 7 comments
Labels
A-Themes-Official Official themes (light, dark) O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@gabrc52
Copy link

gabrc52 commented Aug 19, 2023

Steps to reproduce

  1. Set "default_theme": "light" in config.json
  2. Set your device or browser's theme to dark (instructions are platform-dependent)
  3. Log in with a brand new account
  4. Click on your profile picture
  5. Click on the change theme icon

Edit: This doesn't require a brand new account, just a brand new session.

Outcome

What did you expect?

Theme changes from light to dark

What happened instead?

Theme stays light, and the tooltip says "switch to light mode" when I am already in light mode. I have to click it another time to switch to dark theme and only then does it act as a "toggle theme" button.

See screen recording in next comment.

Operating system

Windows and Linux

Browser information

Firefox 116.0

URL for webapp

matrix.mit.edu (not public)

Application version

Element version: 1.11.39 Olm version: 3.2.14

Can reproduce on develop branch too

Homeserver

matrix-synapse-py3 1.90.0+jammy1

Will you send logs?

Yes

@gabrc52
Copy link
Author

gabrc52 commented Aug 19, 2023

Screen recording of the issue:

Screencast.from.2023-08-18.22-52-43.webm

@gabrc52
Copy link
Author

gabrc52 commented Aug 19, 2023

comment posted on wrong issue accidentally, sorry

@t3chguy
Copy link
Member

t3chguy commented Aug 19, 2023

@gabrc52 did you mean to post that on #26002 instead?

@gabrc52
Copy link
Author

gabrc52 commented Aug 19, 2023

Yes, thank you.

@weeman1337
Copy link
Contributor

@gabrc52 Unfortunately I cannot reproduce your issue. Please update your issue with more information. If we don’t hear back from you in a week, we will close the issue as we need to be able to reproduce it before we can fix it.

I've tried to reproduce with a new account and an existing one with the config setting "default_theme": "light". I did event copy your entire config.json to my environment and it still works. Do you just click on your avatar and then on the theme switcher, or do you do other things first?

@weeman1337 weeman1337 added the X-Needs-Info This issue is blocked awaiting information from the reporter label Aug 22, 2023
@gabrc52
Copy link
Author

gabrc52 commented Aug 29, 2023

Yes, I just click on my avatar and then on the theme switcher. I've noted that this bug only happens when the system or browser theme is dark (i.e. when window.matchMedia('(prefers-color-scheme: dark)').matches is true).

@gabrc52 gabrc52 changed the title Have to click twice to switch from light to dark mode Have to click twice to switch from light to dark mode when my browser theme is dark Aug 29, 2023
@weeman1337 weeman1337 removed X-Needs-Info This issue is blocked awaiting information from the reporter X-Cannot-Reproduce labels Aug 29, 2023
@weeman1337
Copy link
Contributor

Yes, I just click on my avatar and then on the theme switcher. I've noted that this bug only happens when the system or browser theme is dark (i.e. when window.matchMedia('(prefers-color-scheme: dark)').matches is true).

Thank you, I was able to reproduce it with the extra information.

@weeman1337 weeman1337 added S-Minor Impairs non-critical functionality or suitable workarounds exist A-Themes-Official Official themes (light, dark) O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Themes-Official Official themes (light, dark) O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

No branches or pull requests

3 participants