Skip to content

Commit 8051efe

Browse files
mountinycursoragent
andcommitted
fix: restore code comments in useAutocompleteSuggestions hook
Preserve two explanatory comments from the original SearchAutocompleteList that were dropped during the hook extraction, as flagged by reviewer. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 08eb7bd commit 8051efe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/hooks/useAutocompleteSuggestions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ function useAutocompleteSuggestions({
213213
}));
214214
}
215215
case CONST.SEARCH.SYNTAX_FILTER_KEYS.IN: {
216+
// If autocompleteValue is empty or just whitespace and we have already completed keys,
217+
// return empty array to hide suggestion list (consistent with group-by behavior)
216218
if (!autocompleteValue.trim() && alreadyAutocompletedKeys.size > 0) {
217219
return [];
218220
}
@@ -338,6 +340,8 @@ function useAutocompleteSuggestions({
338340
}));
339341
}
340342
case CONST.SEARCH.SYNTAX_FILTER_KEYS.FEED: {
343+
// We don't want to show the "Expensify Card" feeds in the autocomplete suggestion list as they don't have real "Statements"
344+
// Thus passing an empty object to the `allCards` parameter.
341345
const feedAutoCompleteList = Object.values(getCardFeedsForDisplay(allFeeds, {}, translate, feedKeysWithCards));
342346
const filteredFeeds = feedAutoCompleteList
343347
.filter((feed) => feed.name.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.has(feed.name.toLowerCase()))

0 commit comments

Comments
 (0)