coregis / cbf-programs-map-2023

Rebranding and other updates to the Raise Your Hand Texas Programs Map
GNU General Public License v3.0
0 stars 0 forks source link

Free text search #30

Closed eldang closed 8 months ago

eldang commented 9 months ago

This gets us 2/3 of the way on #13 and I think it's probably wise for me to stop here. It adds a free text entry box for zooming to ISDs, which responds as soon as enough of an ISD's name has been typed to get a unique match.

It does not yet present the user with a set of autocomplete options, but I'm not so sure that's important now having played with this a bit.

I've tried to write this in such a way that if there's a later request for an ESCs free text search it'll be easy to adapt.

The input needs styling.

The code changes here should be orthogonal enough from #28 that either can be merged independently of the other.

coregis commented 9 months ago

It does not yet present the user with a set of autocomplete options, but I'm not so sure that's important now having played with this a bit.

This free text entry feature is really cool! It does feel a little black-boxy to me, especially the way it zooms-to-district as soon as there is only one option that fits the free text. I also think it might be possible that a person knows only a portion of the district name they're searching for, and without any suggestions/options they might just be stuck with a partial name and no guidance about what to do next. So, how much effort is it to add this functionality? Specifically, I'm wondering if you are able to make the free text entry box do 2 things:

  1. Generate a list of options
  2. Require the user to click on a selection before zooming, so there is no ambiguity about where and when the map will take them there
eldang commented 8 months ago

@coregis this makes sense to me. I was talking to @nein09 about this and we think it'll make sense for her to do most of the next part, since it's mostly UI work and the quality of that will be what determines how much anyone uses this feature.

@nein09 some notes for when you pick this up:

nein09 commented 8 months ago

I found a goofy little thing that pretty much does what we want: https://tom-select.js.org/. If you're okay with using a third-party solution, and you like how it looks, I think I can do a little cleanup in here, and call this good.

coregis commented 8 months ago

I found a goofy little thing that pretty much does what we want: https://tom-select.js.org/. If you're okay with using a third-party solution, and you like how it looks, I think I can do a little cleanup in here, and call this good.

This is working really well and I am 100% fine with using a third-party solution! I think all we have left is to switch from ESC City to Region Number then we can stick a fork in this

eldang commented 8 months ago

This is working nicely, so I'm going to resolve the merge conflict and then merge it, before starting #31 .

One thought though: should we give the user any more of a prompt that they can type in the School Districts box? I think it's easy to miss that it's anything other than a dropdown menu.

eldang commented 8 months ago

OK, merge conflicts sorted.