reasonmethis/docdocgo-core

/share url fragment should be cleared if the shared collection changes

Closed this issue · 6 comments

The title is self explanatory :-) It's not a major issue, but ensure that the user's new collection focus remains intact.

Could you elaborate, as I am not sure I understood that? The shareable URL is emitted as just a string, not a dynamic object.

The shareable URL causes the shared collection to be used, and the shared collection URL query params are visible as expected. But when you switch to another collection the shared collection URL query params are still still visible. If you F5 (refresh) then the collection in focus switches back to the shared collection. I don't think that's desirable. So, suggestion is to clear out the URL query params using st.query_params.clear(). Let me know if that clarifies things?

I am a bit worried that some users would get confused about how to get back to the collection that was shared with them without digging up the link that was originally shared with them if that link gets cleared from the address bar. I am not sure which behavior is more user-friendly. What do you think?

Can you display shared collections in the /db list command, or create a new/db list shared command? The shared link will be in the user's email anyway, so if the url params are cleared IMO it's not an issue.

I have thought more about it and I think you are right - it's better if the URL is cleared. Ideally the URL would reflect the current state as much as possible, so it should probably always have the name of the currently selected collection in it as a query param.

Yes, good idea adjusting the query param as indicated makes things consistent across both sharing and regular use.