News for hackers. Stuff that matters.
Re:Persisting React State in LocalStorage by k__ on Friday February 28, 2020 @01:58PM (#22445301)
User specific state like "dark mode enabled" would probably be better inside localStorage than inside a shareable URL.
Re:Persisting React State in LocalStorage by hinkley on Friday February 28, 2020 @04:38PM (#22446650)
Disagree.

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.

Re:Persisting React State in LocalStorage by Dylan16807 on Saturday February 29, 2020 @01:47AM (#22449322)
That'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.

Re:Persisting React State in LocalStorage by hinkley on Saturday February 29, 2020 @10:25AM (#22450979)
That 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.
Re:Persisting React State in LocalStorage by geocar on Friday February 28, 2020 @03:25PM (#22446002)
Don'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.

Re:Persisting React State in LocalStorage by bobthepanda on Friday February 28, 2020 @03:32PM (#22446062)
Compatible with everything except IE 11, but in draft: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...
Re:Persisting React State in LocalStorage by ultrarunner on Friday February 28, 2020 @03:37PM (#22446111)
We 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.
Re:Persisting React State in LocalStorage by geocar on Friday February 28, 2020 @03:55PM (#22446280)
Hey 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-switch...

Re:Persisting React State in LocalStorage by k__ on Friday February 28, 2020 @04:23PM (#22446499)
Sure, it was just an example. :)
Re:Persisting React State in LocalStorage by geocar on Friday March 06, 2020 @11:30AM (#22504864)
I 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.