4 ms·
User specific state like "dark mode enabled" would probably be better inside localStorage than inside a shareable URL.
by k__ 7y ago
User specific state like "dark mode enabled" would probably be better inside localStorage than inside a shareable URL.
- geocar 7y agoDon't browsers have media queries for things like that? I think some old browsers didn't, so I guess that's why there are all those tacky switches on blogs these days, but I don't usually worry about obsolete things like "made for netscape 4" banners... I also think for an application, I'd much prefer my settings on the server so I can get them again when I'm using another device.
- bobthepanda 7y agoCompatible with everything except IE 11, but in draft: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...
- ultrarunner 7y agoWe have an application that's used outdoors day and night in some cases. The good news is it makes a ton of difference in usability; the bad news is I honestly still have to search for instructions on toggling dark mode on Ubuntu. The switch is a lot simpler.
- geocar 7y agoHey go nuts. Whatever works for you. But if you wanted to use other applications that didn't have such a switch, you might consider looking into a hotkey or an extension. I found this[1] after a quick ddg. Maybe it'll help? [1]: https://extensions.gnome.org/extension/2314/dark-mode-switcher/ https://extensions.gnome.org/extension/2314/dark-mode-switch...
- k__ 7y agoSure, it was just an example. :)
- geocar 7y agoI figured as much, but I feel pretty strongly that every piece of state needs to be accessible to a user or to the server, otherwise you lose control of it and that can war on. I know that for performance reasons, or for privacy reasons, or even for time/effort reasons, that's not always possible, but I'm also always genuinely hopeful that there's some new class of data out there that doesn't fall into that (general) rule.
- hinkley 7y agoDisagree. There are whole classes of UI errors that are only reproducible if you use the same look and feel as the customer. Black text on a black background being reported as data loss or missing functionality, for starters, but there are many others.
- Dylan16807 7y agoThat's useful in the specific case of debugging but as a user it would be pretty awful if all my customization disappeared every time I clicked a link from another user. And you want screen resolution and DPI too for a proper "same look and feel" debugging experience. Which you could always hide in the URL if you want, but you shouldn't act on it by default. Do the same thing with UI settings, if you must. Include them but don't act on them.
- hinkley 7y agoThat can also be achieved by storing that information as user preferences on the backend, and it won’t affect your friends but let’s support people figure out what they need to know.