Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Consider implementing URLs for pages to allow sharing via bookmarks #133

Closed
portante opened this issue Mar 22, 2021 · 4 comments
Closed
Labels
Backlog enhancement New feature or request wontfix This will not be worked on

Comments

@portante
Copy link
Member

Today, the dashboard has a notion of a "session" where the Redux state can be saved to a GraphQL instance under a URL that can be shared. This requires saved state in some database that has to be managed.

Instead, we should consider the principle of not implementing behaviors that are already solved by well accepted / known methods.

If we encode the state of a page as a URL in the browser, and removed the need to save the state in a GraphQL instance, it would allow us to:

  • Leverage existing URL bookmarking mechanisms in the users existing browser
  • Leverage existing URL shortening services that exist today
  • Avoid having to maintain code and infrastructure for saved URLs
  • Avoid issues with logged-in vs not-logged-in users and how to save such state
@aquibbaig
Copy link
Collaborator

Interesting, seems like a good approach to me. I can take this up!!

@aquibbaig
Copy link
Collaborator

@portante @npalaska @dbutenhof What would the server-side do with this "session sharing URL" ?

@dbutenhof
Copy link
Member

dbutenhof commented Mar 29, 2021

We'll need to figure out some way to wrap this sort of thing into the default routing in the index.html to fire up the dashboard code with the right context; however, aside from that, I'm not sure this necessarily should imply any server impact at all.

I've debated internally whether we should think about issuing a read-only authorization token for this; but unless we get into more generic role support I don't think we need it. You can share some encapsulation of the current dashboard state as a URL, via bookmark, email, embedded in a document, and the dashboard can "reconstitute" itself from that link.

At worst, this would be essentially the "saved view" that the dashboard is doing now in GraphQL metadata, but expressed in a generated URL link something like http://server.example.com/dashboard/&saved_view=<long-redux-state-dump>, but it'd be much better to have something that's somewhat meaningful and even editable...

This might be something like http://server.example.com/dashboard?search=fio or http://server.example.com/compare?first=<id1>&second=<id2>, etc. And ideally, this wouldn't just be generated by a "Share" link, but it'd be the "native representation" of the dashboard, so that you can simply click the button to bookmark the current page, or copy and paste from the browser location bar.

@webbnh
Copy link
Member

webbnh commented Mar 29, 2021

As Dave outlined, hopefully the URL in its raw form will not reach the server. The idea is for the URL to contain sufficient information to allow the Dashboard to recreate a view which someone previously saved/shared. Presumably, the Dashboard would make requests to the server in order to render the contents of the requested view, but nothing about the view itself would be saved on the server (or in the Dashboard/browser, or anywhere else other than in the URL).

As Dave said, if we can put it all into the URL, then the view can be saved in a browser bookmark, or it can be pasted into an email or a Google doc, or embedded into a web page, such that anyone can click on it and see what the original author saw (assuming that they have sufficient access to view the data).

@dbutenhof dbutenhof removed this from the v3.1.0 milestone Nov 29, 2021
@portante portante added the wontfix This will not be worked on label Aug 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Backlog enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants