-
Notifications
You must be signed in to change notification settings - Fork 69
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
Feature request: use browser local storage to remember the yaml #91
Comments
That makes sense, thanks for the suggestion. I had a look and it looks like it might be possible with third party components for Streamlit. They all look hacky to various degrees but I will play with them a bit and see if it is feasible. |
what about using a cookie rather than localstore? this third party piece looks a possibility |
That's probably more feasible -- local storage access seems to be async so it is a headache to get it to play well with streamlit widgets. Cookie size limit (4 kb?) shouldn't be much of an issue in practice either, if we use the same encoding scheme as the share URL. That component looks OK, although some forks seem better maintained. I also don't get why they need cookies to be encrypted in public apps, if it is indeed stored in the user's browser? https://github.com/NathanChen198/streamlit-cookies-controller seems a bit better to me on an initial glance. |
I tried a few things over the week, unfortunately I haven't found a solution that works robustly. Neither above component nor https://github.com/Mohamed-512/Extra-Streamlit-Components (which seems very poorly maintained in terms of up to date dependencies, I added some fixes in my own fork) seems to be able to set cookies consistently, nor read them on initial start. At least the method in https://gist.github.com/skannan-maf/f803cddee9cc555ceb62405124d418a3 (that uses unsupported features) can fetch cookies consistently. I'll probably circle back to this in the future, it is a common ask by Streamlit users so a working solution should eventually pop up -- hopefully as an officially supported feature. |
I am tracking streamlit/streamlit#861 to utilize in order to add support for this. |
I frequently tweak my layout and keep track of it with this great tool on the web.
To save a change and later revisit it, I either have to:
Could the option be added to auto-save the current yaml into the browser storage?
This would not lose the state on browser updates
The text was updated successfully, but these errors were encountered: