cldellow / datasette-ui-extras

Add editing UI and other power-user features to Datasette.
Apache License 2.0
12 stars 1 forks source link

better support for wide tables (set a view as default) #7

Closed cldellow closed 1 year ago

cldellow commented 1 year ago

https://github.com/simonw/datasette/issues/596#issuecomment-1238383171

Once you've customized your view, eg https://global-power-plants.datasettes.com/global-power-plants/global-power-plants?_nocol=gppd_idnr&_nocol=other_fuel2&_nocol=owner&_nocol=other_fuel3&_sort_desc=capacity_mw&_nocol=other_fuel1

It'd be neat if you could do two things:

  1. as an end-user, flag it so that going to https://global-power-plants.datasettes.com/global-power-plants/global-power-plants in the future redirected you to that customized view
  2. as the Datasette owner, flag it so that becomes the default view for users

(1) could be done with localStorage if we're willing to be inefficient (we'd load the page; then immediately redirect the user on the client-side); or cookies (but we might be likely to blow through the 4KB limit pretty fast). It would be best to do this with persistent storage. The preference could be linked either to an ephemeral identifier stored in a cookie, or your identity as an actor.

(2) would require persistent storage in the DB, maybe a hidden table

cldellow commented 1 year ago

Heh, I just wontfixed #5, but this might actually be a good tool for that: make it easy to promote interesting slices of your data.

cldellow commented 1 year ago

Realistically, I'm not doing this soon, so closing