Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(genie): allow genie to sort wishes properly #1013

Merged
merged 5 commits into from
Jul 28, 2018

Conversation

kentcdodds
Copy link
Contributor

One of the cool things about genie is it's sorting algorithm takes into account the user's previous choices. By providing the input value when you make the wish, genie can keep track of what input values lead to which wishes and can optimistically suggest certain wishes as the user's typing.

What kind of change does this PR introduce? Bug Fix

What is the current behavior? genie isn't able to make proper suggestions based on previous wishes made

What is the new behavior? genie will optimistically suggest wishes

Checklist:

  • Documentation N/A
  • Tests
  • Ready to be merged
  • Added myself to contributors table I should probably do this... 😅 But feel free to merge before I get the chance.

One of the cool things about genie is it's sorting algorithm takes into account the user's previous choices. By providing the input value when you make the wish, genie can keep track of what input values lead to which wishes and can optimistically suggest certain wishes as the user's typing.
@kentcdodds
Copy link
Contributor Author

I looked at the deployed version of the PR and it appears that this isn't working still but I don't think sourcemaps are working because I can't debug like I can in the production app. Any ideas?

@kentcdodds
Copy link
Contributor Author

Ah, I've worked it out. The inputValue is set to the selected item in onChange. We'll have to keep track of the input value separately so we know what the inputValue is at the time of the selection.

@kentcdodds
Copy link
Contributor Author

Sweet! It's working!

Next step will be to save genie's options to localstorage whenever a wish is made and then rehydrate genie when the component is mounted...

@kentcdodds
Copy link
Contributor Author

After this the next thing we'll need to do is figure out why the + p keyboard shortcut doesn't seem to open the menu most the time...

@kentcdodds
Copy link
Contributor Author

kentcdodds commented Jul 27, 2018

Sweet, this thing's totally working! So now genie will be able to learn the user's preferred wishes as they type, making the menu more helpful.

This is ready to be merged!

@CompuIves
Copy link
Member

Woooooooow this is greaaaat! Thank you so much @kentcdodds! Merging this in now. Such an improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants