covid-vaccine-spotter icon indicating copy to clipboard operation
covid-vaccine-spotter copied to clipboard

Improve error message when you enter a zip code that can't be found

Open GUI opened this issue 3 years ago • 1 comments

With the addition of ZIP code search, I've heard from one user that I think was rightfully confused that they couldn't search for zip codes in other states and get any results. I think in the error message when a ZIP code isn't found in your state, we could provide better guidance on this and maybe point towards the other states.

This could also perhaps be made better by improving the overall navigation so it's more obvious how to switch between states: https://github.com/GUI/covid-vaccine-spotter/issues/52

There's maybe a broader issue here of whether or not the state-centric search makes sense, but I'm sort of in favor of keeping it that way for the purposes of this tool. I'm doing a sort of dumb client-side ZIP code lookup so I don't have to pay for geocoding services, and while loading an entire state's worth of zip codes is semi-okay (still a bit big), loading the entire US would probably be too much. And given the state-centric nature of vaccinations, I think this state-based approach mostly makes sense, it's maybe just less convenient if you're helping friends in other states and needing to swap between states.

GUI avatar Mar 09 '21 00:03 GUI

I think I have an idea for doing this fairly efficiently. US Zip Codes generally follow a pattern. Since you're wanting to keep this client side, we could send a payload of zip code prefixes associated with each state. Then, when the user enters a zip code, the first three digits they enter are cross-referenced to this data. If it is found that the zip code belongs to another state, the can automatically be redirected to the proper state's page. Then, the results for this zip code will be displayed.

The zip code prefixes I mentioned are easily viewable at https://en.wikipedia.org/wiki/List_of_ZIP_Code_prefixes.

If this sounds like a good approach, I would be happy to work on contributing this!

patrickdemers6 avatar Mar 19 '21 15:03 patrickdemers6