Sharing App Views via URL's - Tricky?

We have developers frequently endeavouring to embed page parameters in the URLs so others can share a URL to get to their current view of the app (which can be quite different from the default view).

It’s rather non-trivial getting that to work though, especially for app developers who are not hardcore programmers. It requires identifying the required parameters, managing them on the session state and handling the URL query string. Frequently they’ll run into problems (e.g. Erratic behavior in selectbox when the index parameter is not a constant · Issue #1532 · streamlit/streamlit · GitHub) and always their app code gets messy. More often than we’d like - they’ll avoid the effort of getting parameters to the URL entirely → no sharing capability.

Wondering how y’all handle this?

Some example code and a demo - with a class we’ve started putting together to hide/consolidate some of this machinery.

I just dealt with this issue and it was indeed a struggle. This is heading in the right direction. Is this a third party effort or something that would be part of streamlit core? Adopting any third party effort for something this fundamental is bound to be risky.

This is just an example of some code we are evolving internally at Toyota Research Institute / Woven to improve the situtation. If it helps guide others to finding a way to handle the problem in the short term, great. It’s main purpose though is to generate some discussion and eventually raise it more formally with the streamlit devs once I have some more feedback (internal & external).

Good idea. I liked the idea of a parameter registry. I’ve already encountered this as a blocker in a couple of situations where there is “parameter free for all.” I wanted to implement streamlit-analytics (a useful plugin) but immediately found that it had a conflict with its query parameter usage with hydralit, the multipage app that I already rely on. It would be great if parameters were registered with Streamlit central and given a unique identifier, ideally with a metadata directory of some sort. There’s no good reason for people to keep reinventing the same very similar parameters & functions.