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

Automatically suggest & autocomplete tags in StyledInputTags component #5523

Closed
SudharakaP opened this issue May 4, 2022 · 3 comments · Fixed by opencollective/opencollective-frontend#8571

Comments

@SudharakaP
Copy link
Member

SudharakaP commented May 4, 2022

This was suggested at, #4764 (comment)

Currently when creating a new tag the user won't be notified if there's similar tags. For example if the user misses that we have a tag called open source they might create another tag called open-source or openSource etc which result in duplicate tags.

Ideally we should search for existing tags when the user types on the tag creation input and then show similar tags (partial matches, ignoring punctuation and accents) and let the user choose that tag if they wish.

We already have the TagStatsCollectionQuery on the API side so what we need to do is,

  • Whenever the user types something on the tag creation input we query the tags based on that term and show all the tags that is returned in the tag dropdown.

cc: @Betree

@SudharakaP SudharakaP added this to 📅 To do in Search Experience Redesign via automation May 4, 2022
@gustavlrsn gustavlrsn added this to the FY23Q1C1 milestone Jan 13, 2023
@gustavlrsn gustavlrsn changed the title Automatically search for tags when typing a new tag in, StyledInputTags component Automatically search & suggest tags when typing a new tag in, StyledInputTags component Jan 16, 2023
@gustavlrsn
Copy link
Member

Updating the title for the issue to also include suggested tags (based on popularity) before typing something in and starting to filter down, something like this:

image

@gustavlrsn gustavlrsn changed the title Automatically search & suggest tags when typing a new tag in, StyledInputTags component Automatically suggest & autocomplete tags in StyledInputTags component Jan 16, 2023
@gustavlrsn
Copy link
Member

To make this query performant, I'm thinking we want to use a Materialized view that returns tags sorted by their count. The current TagStatsCollectionQuery is looking through all Collective's to unnest tags, a quite expensive query to do in an autocomplete field.

@BenJam BenJam removed this from the FY23Q1C1 milestone Jan 16, 2023
@Betree
Copy link
Member

Betree commented Jan 16, 2023

Sounds like a very good use case for materialized views, especially since we really don't need fresh data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment