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

Custom table interface for browsing and installing plugins #10

Closed
simonw opened this issue Sep 10, 2021 · 8 comments
Closed

Custom table interface for browsing and installing plugins #10

simonw opened this issue Sep 10, 2021 · 8 comments

Comments

@simonw
Copy link
Owner

simonw commented Sep 10, 2021

Here's a fun idea: what if the list of plugins you could install was a very lightly customized Datasette table? Would get search and faceting for free, and help people further understand what the tool can be used for.

An in-memory plugins database which is deliberately excluded from the homepage.

Originally posted by @simonw in simonw/datasette-app#74 (comment)

@simonw
Copy link
Owner Author

simonw commented Sep 10, 2021

There are a few pieces to this then.

  • The datasette-app-support plugin should hit this API https://datasette.io/content/plugins.json?_shape=array on startup to fetch the list of available plugins (or maybe it should hit it when the user navigates to the plugins/directory page?)
  • To allow for facet by installed/not-installed it should include information about which plugins are installed in that in-memory database
  • A custom table template should help make that page look a bit like https://datasette.io/plugins
  • Some kind of mechanism by which the app can inject "install this plugin" buttons - but only if the user is authenticated as "root"

@simonw
Copy link
Owner Author

simonw commented Sep 10, 2021

I may borrow the purple button design from https://datasette.io/desktop (a smaller version) for the "install this plugin" buttons.

@simonw
Copy link
Owner Author

simonw commented Sep 10, 2021

Adding a "Desktop compatible" facet would be really useful here - any plugin that depends on configuration (like dogsheep-beta) is currently incompatible with Datasette Desktop, and if you order by number of stars you get a lot of those first: https://datasette.io/plugins?sort=stars

@simonw
Copy link
Owner Author

simonw commented Sep 10, 2021

If it's going to fetch the plugin directory on startup, it needs to survive network errors.

@simonw
Copy link
Owner Author

simonw commented Sep 10, 2021

I want to be able to display the full readme for a plugin but only on-demand, not pre-loaded on startup. So there will probably be some JavaScript that hits https://datasette.io/content/repos.json?_sort=id&full_name__exact=simonw%2Fdatasette-leaflet-geojson&_col=readme_html&_labels=on&_shape=array

@simonw
Copy link
Owner Author

simonw commented Sep 10, 2021

Here's what I have so far:

9_10_21__4_53_PM

@simonw
Copy link
Owner Author

simonw commented Sep 10, 2021

Need to figure out what happens when you click that button - should it show a loading indicator of some sort? Also ideally it would refresh the page once the plugin has finished installing (and the server has restarted) which would update the "currently installed" state on that page.

simonw added a commit that referenced this issue Sep 10, 2021
@simonw
Copy link
Owner Author

simonw commented Sep 11, 2021

This is making the tests fail because the named in-memory database persists between tests in pytest.

simonw added a commit that referenced this issue Sep 11, 2021
simonw added a commit that referenced this issue Sep 11, 2021
@simonw simonw closed this as completed Sep 11, 2021
simonw added a commit to simonw/datasette-app that referenced this issue Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant