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

Fixed dark mode switch Button: Update DarkModeSwitch #5894

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

Suhas2299
Copy link
Contributor

@Suhas2299 Suhas2299 commented Aug 9, 2024

Issue :

  1. User sets dark theme and closes tab,
  2. Again user visits cypress doc
  3. Now the theme remains dark but button is stucked in light theme

Fix:
The default value is now set from localstorage.

Resolution:
Darkmode switch button now remembers the user set value.

Issue : 
1. User sets dark theme and closes tab,
2. Again user visits cypress doc
3. Now the theme remains dark but button is stucked in light theme
Fix:
The default value is now set from localstorage.
Resolution:
 Darkmode switch button now remembers the user set value
Copy link

netlify bot commented Aug 9, 2024

👷 Deploy request for cypress-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit fb7bb1b

@cypress-app-bot
Copy link
Collaborator

@CLAassistant
Copy link

CLAassistant commented Aug 9, 2024

CLA assistant check
All committers have signed the CLA.

Setting the SetColor in useEffect so that it runs only on clien side.
@Suhas2299 Suhas2299 changed the title Fixed dark mode switch Button: Update DarkModeSwitch.js Fixed dark mode switch Button: Update DarkModeSwitch Aug 9, 2024
@MikeMcC399
Copy link
Contributor

@Suhas2299

Which browser were you having problems with (Browser / browser version / operating system)?

For me with Google Chrome 127.0.6533.100 on Windows 11 and Google Chrome 127.0.6533.9 on Ubuntu 22.04.4 LTS the dark / light mode setting is persistent already.

@Suhas2299
Copy link
Contributor Author

Suhas2299 commented Aug 9, 2024

Hi @MikeMcC399 ,

I am using google chrome on windows 11 Version 127.0.6533.100 (Official Build) (64-bit) i am getting issue on browser PFB :

Steps Followed : Enabled Dark mode >> Close Tab/Browser >> Revisited the document >> Found the doc is in dark mode but the DarkModeSwitch Button is stuck in light mode

image

@MikeMcC399
Copy link
Contributor

@Suhas2299

Thanks for explaining and apologies for my misunderstanding!

I misread the issue and see now the same problem you pointed out. The light / dark mode button should be aligned to the light/dark state of the site.

@Suhas2299
Copy link
Contributor Author

Suhas2299 commented Aug 9, 2024

@MikeMcC399

No worries at all, glad we're on the same page now!
Thanks.

Copy link
Contributor

@elevatebart elevatebart left a comment

Choose a reason for hiding this comment

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

TYTY

@elevatebart elevatebart merged commit 38e0c6b into cypress-io:main Aug 13, 2024
3 checks passed
@MikeMcC399
Copy link
Contributor

@Suhas2299 / @elevatebart

Could you check if this PR has solved this issue in production?

I'm still seeing the switch in light mode when the site is displayed in dark mode.

image

You can get the same effect if you press F5 when the site is in dark mode. The switch changes to light mode whilst the site stays in dark mode.

@Suhas2299
Copy link
Contributor Author

Suhas2299 commented Aug 14, 2024

Hi @MikeMcC399 ,
The Issue works right in local but the issue still persists in the production, @MikeMcC399 / @elevatebart Can you please share your expertise what factors might be affecting the changes in Production?

@MikeMcC399
Copy link
Contributor

@Suhas2299

Thanks for confirming you are also seeing the issue unresolved in production! Unfortunately I don't have the expertise to debug further or to suggest a fix.

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