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

Autocomplete feature #524

Merged
merged 5 commits into from
Mar 8, 2024
Merged

Autocomplete feature #524

merged 5 commits into from
Mar 8, 2024

Conversation

aliciapaz
Copy link
Collaborator

@aliciapaz aliciapaz commented Mar 1, 2024

Context

User Story:
A feature similar to Google search where a user begins typing in the search box and suggested terms begin appearing underneath. This would help users who might need some prompting on possible search terms or have literacy needs.

What changed

The Tag model was used to fetch suggestions using a pg_search_scope that combines trigram and tsearch.
The front-end behavior is implemented with Stimulus.

How to test it

Go to the homepage and search page, and start typing. Suggestions should appear as you type.

References

ClickUp ticket
Stimulus autocomplete

@aliciapaz aliciapaz self-assigned this Mar 1, 2024
@aliciapaz aliciapaz marked this pull request as ready for review March 4, 2024 22:08
Copy link
Collaborator

@JosueMagnus12 JosueMagnus12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems great in general, I just found some formatting and convention details.

This is a nice to have, but I think it would be cool to perform automatic searches when users click on any suggestion in the list. For now lets go with this first implementation 👍

config/routes.rb Outdated Show resolved Hide resolved
app/views/autocompletes/show.html.erb Outdated Show resolved Hide resolved
app/components/search_bar/component.html.erb Outdated Show resolved Hide resolved
@aliciapaz aliciapaz requested a review from JosueMagnus12 March 7, 2024 21:06
@aliciapaz aliciapaz merged commit d8f44fc into main Mar 8, 2024
2 checks passed
@aliciapaz aliciapaz deleted the feature/autocomplete branch March 8, 2024 18:25
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