bin icon indicating copy to clipboard operation
bin copied to clipboard

It's hard to find the wanted file type in the list

Open Tofee opened this issue 1 year ago • 1 comments

When I do a paste, and want to select the file type, the ordering of the list is not intuitive: the first 10 entries or so are a mystery to me, then the rest looks like it's sorted by the extension, but that extension is never shown.

So we end up looking for a bash highlighting near the "B", but no, it's near the "S" words, between SCSS and... "Highlight non-printable".

I would suggest to either:

  • show the extension first, so that the sorting is obvious
  • provide a search field (there is already a space between "Paste" and the list, maybe it could fit there?)
  • if only the alias is shown, actually sort by the alias string (so Bourne would be in the Bs)

Also, not related but nice-to-have, applying the selected highlight to the current text would be, well, nice.

Tofee avatar Oct 22 '23 09:10 Tofee

Looking at some solutions out there, I found this nice snippet:

https://github.com/madeindjs/select_option_filters/blob/master/selectOptionFilter.js#L1-L33

Which can be used here by calling add_filter('ext') I tried it, and by adding near the end of the function a simple option.hidden = option.disabled; we get a nice working filter:

Maybe I can even try and PR something, though I'm not sure how to do the CSS part.

Tofee avatar Oct 22 '23 10:10 Tofee