From 496dd7d94701990f60024f36c51ec13cb92fd312 Mon Sep 17 00:00:00 2001 From: Gabriel Mechali Date: Wed, 4 Dec 2024 19:08:59 -0500 Subject: [PATCH] Minor tweaks (#4764) Stops triggering autocomplete for "the", and uses the location icon when spaces at the start and end are the only difference between the current query and matched query. --- server/routes/shared_api/autocomplete/helpers.py | 2 +- .../js/components/nl_search_bar/auto_complete_suggestions.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/routes/shared_api/autocomplete/helpers.py b/server/routes/shared_api/autocomplete/helpers.py index 6231da1245..668da7f2b6 100644 --- a/server/routes/shared_api/autocomplete/helpers.py +++ b/server/routes/shared_api/autocomplete/helpers.py @@ -57,7 +57,7 @@ 'place_dcid': 'asia' }] + TWO_WORD_CUSTOM_PLACES SKIP_AUTOCOMPLETE_TRIGGER = [ - "tell", "me", "show", "about", "which", "what", "when", "how" + "tell", "me", "show", "about", "which", "what", "when", "how", "the" ] # Exceptions for the 3 letter trigger rule. These queries can trigger on only two letters. diff --git a/static/js/components/nl_search_bar/auto_complete_suggestions.tsx b/static/js/components/nl_search_bar/auto_complete_suggestions.tsx index 2b0725e0c3..73b55b2715 100644 --- a/static/js/components/nl_search_bar/auto_complete_suggestions.tsx +++ b/static/js/components/nl_search_bar/auto_complete_suggestions.tsx @@ -41,7 +41,7 @@ export function AutoCompleteSuggestions( const [triggered, setTriggered] = useState(false); function getIcon(query: string, matched_query: string): string { - if (query == matched_query) { + if (query.trim() == matched_query.trim()) { return "location_on"; } return "search";