dcramer / peated

https://peated.com
Apache License 2.0
63 stars 13 forks source link

Add suggestions for bottle details on AddBottle #144

Closed dcramer closed 3 months ago

dcramer commented 7 months ago

There are various things we can auto fill in our prioritize in ranking in the add bottle flow. Its a bit overkill, but given the importance of this flow it feels worth it. This is likely best done by sending a request to an endpoint on every field change.

For example, you select "The Scotch Malt Whisky Society" as the brand, which is the first field. We can then suggest the bottler to be the same.

You then enter the cask #, not only can we suggest the name format (e.g. we could show similar bottles from a brand to help you), but in SMWS' case we can actually suggest the distiller.

Likely the endpoint returns two types of suggestions:

dcramer commented 5 months ago

Rethinking this a bit now...

I think a better approach is to think of this as a forced normalization solution.

That is, you submit bottle create/update, and we either show (or dont) what your input is going to transform into. Its like address normalization.

The suggestions are still valuable, like suggesting the most likely matches for e.g. a distiller if you select a brand. Those howerver we can implement as a weight bias in each selection endpoint.

In addition to doing this in the UI for the bottle normalization, we'll also utilize that exact same code to normalize the result in the API itself.

dcramer commented 3 months ago

I'm calling this good as suggestions are a complicated UX. Instead we just force normalize + theres a button to fetch from the generative helper.