-
Notifications
You must be signed in to change notification settings - Fork 918
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
Color mode preference #5337
base: master
Are you sure you want to change the base?
Color mode preference #5337
Conversation
9c6d95c
to
4edcaa4
Compare
If it's in the user preferences it should be stored in the database not in cookies. |
4edcaa4
to
8176bc1
Compare
But should it be in user preferences? |
And if stored in the database, should it be in |
8176bc1
to
af06e41
Compare
I don't think this preference mashup between local and database storage is a great idea. But if logged-in users have the preference synchronized and non-logged-in users have the color and language (editor choice seems pointless for non-logged-in users) stored in the cookies it could be interesting. Or just decuple the local settings from the synced ones. |
By making the setting available to other apps I meant iD of course. Its color scheme preferably should match the entire site, that means it has to know somehow whether to use Now let's suppose we don't use iD embedded in the osm-website. We'll run it from https://ideditor-release.netlify.app/, It can still read the setting in the api, but the reason to apply it is gone because iD is no longer embedded. Then maybe it's better to pass it as a startup parameter through
In this case we wouldn't need to worry how exactly we store the setting. |
How would not logged-in users change this setting? |
At first they they wouldn't be able to, like with languages. Whether this will work depends on how disruptive is whatever they run instead of the native dark mode, whether it will prevent them from logging in for their preferences to take effect. |
A quick implementation of auto/light scheme switch for those who want to stay on the light scheme even when their browser says they want the dark one.
Its on the
/preferences
page but it's not actually a preference stored in theUser
model. It's stored in a cookie. The question is do we want to store it in a cookie? Maybe we do because what browser reports as a preferred scheme is per browser, not per user, then perhaps its override should also be per browser. And it will be easier to extend the availability of this option to anonymous users. It is kind of available already, if they know how to edit cookies.