Skip to content
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

UI to select storage location #48

Open
LeaVerou opened this issue Mar 25, 2020 · 3 comments
Open

UI to select storage location #48

LeaVerou opened this issue Mar 25, 2020 · 3 comments

Comments

@LeaVerou
Copy link
Member

Some apps are basically readers of certain "document" types, and it doesn't make sense for them to be tied to one data source, but each user may want to load their own data source. E.g. any tracker, the pros and cons app, the svg path demo. It would be nice to have a plugin that, when visited with no params it offers UI to select storage location, and then redirects to a URL that includes that storage location. This will also enable non-technical users to use many Mavo apps that right now require fiddling of the URL params to get to use your own storage.

@karger
Copy link
Collaborator

karger commented Mar 26, 2020

This would tremendously expand the range of mavos that can be made. Can the plugin use reflection to determine the different storage plugins that are available so it can let the user choose among them? What information needs to come from each storage plugin so that the storage-chooser UI can be appropriately customized to gather the information the user needs to provide to make use of that plugin?

@LeaVerou
Copy link
Member Author

@karger

Can the plugin use reflection to determine the different storage plugins that are available so it can let the user choose among them?

Definitely, though I see utility in an attribute to customize which ones will actually be selectable (if the attribute is not specified, all loaded backends would be selectable, or all that expose the required information).

What information needs to come from each storage plugin so that the storage-chooser UI can be appropriately customized to gather the information the user needs to provide to make use of that plugin?

That depends on the plugin. E.g. Github requires a username and optionally a repo & file name. Google Drive or Dropbox require one shareable link. It would be nice if this plugin could also create the shareable link in these cases (like the Github backend can), instead of having to create an empty file first. This is a simple matter of programming, the reason these backends don't do it in the first place is that the URL is not predictable, and since you needed to include it in your HTML, there was no point.
UI-wise, icons would be quite nice, but not necessary. Perhaps the plugin can fetch the favicon from the corresponding site.

@LeaVerou
Copy link
Member Author

LeaVerou commented Jul 2, 2021

Some more thoughts on this:

  • Backends should have a create([url]) method that creates a file and returns its storage URL
  • Last selected backend should be stored in localStorage so that we don't need to carry it around in the URL (and non-carefully constructed links could break it). If there is no URL parameter for storage, it is added from the locally stored one (so that we can still share links with the right data store).
  • UI should both show the current data store (if any), and allow you to override it with a URL or create new data.

It's still an open problem how logging in to the same account on a different device opens the same data file you used on that app last (without having to carry the data URL in the URL).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants