Skip to content

chore: replace localstorage with cache#1257

Merged
dgarcia360 merged 4 commits intoscylladb:masterfrom
dgarcia360:dark-keep-preference
Oct 21, 2024
Merged

chore: replace localstorage with cache#1257
dgarcia360 merged 4 commits intoscylladb:masterfrom
dgarcia360:dark-keep-preference

Conversation

@dgarcia360
Copy link
Copy Markdown
Collaborator

@dgarcia360 dgarcia360 commented Oct 15, 2024

Closes #1230

Closes #1231

This update switches from using local storage to cookies for storing user preferences across different domains. Additionally, it ensures that system preferences for dark mode are respected.

By definition, cookies are shared between domains, whereas local storage is not.

How to test

Testing locally can be challenging since we don't have two projects using the updated theme. However, you can verify that preferences for the dark theme and the expanded bar are retained across domains using the same theme. You can also manually define the dark theme preference in Chrome using this guide.

To perform this test, ensure you're in incognito mode with a clean cache.

@dgarcia360 dgarcia360 force-pushed the dark-keep-preference branch from de35f0d to 93f6d9d Compare October 18, 2024 15:46
@dgarcia360 dgarcia360 marked this pull request as ready for review October 18, 2024 15:48
@annastuchlik
Copy link
Copy Markdown
Collaborator

Looks good. Let's release this fix and test it on other projects once the conflicts are resolved in this PR.

@dgarcia360 dgarcia360 merged commit 0ca3088 into scylladb:master Oct 21, 2024
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.

Respect system dark theme preference by default Dark theme preference not retained when navigating between documentation sets on different subdomains

2 participants