cldellow / datasette-ui-extras

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

filters: autosuggest filter values #14

Closed cldellow closed 1 year ago

cldellow commented 1 year ago

related to #3 - #3 is about when you have to consult an fkey table for the label, this is about when the raw value is present

https://global-power-plants.datasettes.com/global-power-plants/global-power-plants?_sort=rowid&primary_fuel__exact=Solar&country_long__in=Canada%2C+United+States+of+America

When typing in the filter box, it'd be nice if it auto-suggested options

This might require some storage in order to remember candidate values (running SELECT DISTINCT xxx FROM table is likely slow)

cldellow commented 1 year ago

see also https://github.com/simonw/datasette/issues/1890, which I think I broke by making facets lazy.

cldellow commented 1 year ago

That feature is only available in the 1.0 alpha series, I think. You can see it working here: https://dux-demo.fly.dev/cooking/badges?_sort=id&_dux_show_filters=1&_dux_show_filters=1&_dux_show_filters=1&_dux_show_filters=1

cldellow commented 1 year ago

Hmmmm, that's a lot of _dux_show_filters. Maybe now that we set _dux_show_filters=1, we don't need the hidden input? Fixed in https://github.com/cldellow/datasette-ui-extras/commit/72bfdd111389b1712f91773272ccd426b116322e

cldellow commented 1 year ago

The datalist autosuggest is something, gonna close this. If we do anything, it'll be in the omnibox, as that's most discoverable