google / mesop

Rapidly build AI apps in Python
https://google.github.io/mesop/
Apache License 2.0
5.41k stars 260 forks source link

AI: Dark mode toggle is not remembered per page #957

Open richard-to opened 1 month ago

richard-to commented 1 month ago

Think this is more a limitation of Mesop right now (could do it by passing query param, but kind of ugly), but could be nice if the dark mode toggle could not revert back to the default system choice every time I change the page (if I override the toggle).

wwwillchen commented 1 month ago

Yeah, I noticed this too and I think we should consider having some kind of app-wide settings for dark theme so that the preferences are set across all pages and persisted across navigations. There are ways around it, e.g. query param, passing into state, but they're quite inconvenient.

At the same time, I think there could be usages of app-wide settings like having a static dir for serving assets, e.g. JS, CSS, favicon, images, etc.