Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
49567cb
feat: [Insights] [Release 1] Top Categories - Add a limit filter to s…
TaduJR Jan 22, 2026
4a5fcda
fix: only include limit in search hash when explicitly set
TaduJR Jan 22, 2026
6a8a229
Merge branch 'main' of https://github.com/TaduJR/App into feat-Insigh…
TaduJR Jan 22, 2026
a794ead
chore: run prettier
TaduJR Jan 22, 2026
daafee2
fix: Prevent limit from being dropped when modifying filters or columns
TaduJR Jan 22, 2026
3dfa5af
fix: Add LIMIT to SearchFilterKey type and remove type assertions
TaduJR Jan 22, 2026
c6e2ffc
chore: remove unnecessary comments
TaduJR Jan 23, 2026
3fecb69
test: Add test for comma-separated limit values
TaduJR Jan 23, 2026
8c7cfae
perf: Move getCurrentSearchQueryJSON inside useMemo callback
TaduJR Jan 23, 2026
9de4da9
Merge branch 'main' of https://github.com/TaduJR/App into feat-Insigh…
TaduJR Jan 24, 2026
7f1d1cb
Merge branch 'Expensify:main' into feat-Insights-Release-1-Top-Catego…
TaduJR Jan 26, 2026
bbce881
Merge branch 'main' of https://github.com/TaduJR/App into feat-Insigh…
TaduJR Jan 26, 2026
babe73f
Merge branch 'feat-Insights-Release-1-Top-Categories-Add-a-limit-filt…
TaduJR Jan 26, 2026
e81029b
Merge branch 'Expensify:main' into feat-Insights-Release-1-Top-Catego…
TaduJR Jan 26, 2026
fd3f422
refactor: Move limit to end of query string to match SQL ordering
TaduJR Jan 26, 2026
a4b50b7
test: Assert empty/negated limit is treated as keyword
TaduJR Jan 26, 2026
63b5d3d
Merge branch 'main' of https://github.com/TaduJR/App into feat-Insigh…
TaduJR Jan 26, 2026
e77f294
feat: Add limit filter to search with UI and parser support
TaduJR Jan 26, 2026
e8f7160
refactor: Move limit check into switch statement
TaduJR Jan 26, 2026
551d821
Merge branch 'Expensify:main' into feat-Insights-Release-1-Top-Catego…
TaduJR Jan 26, 2026
e6719af
fix: Translate limit to maximumResults for backend API
TaduJR Jan 26, 2026
b9da647
Merge branch 'feat-Insights-Release-1-Top-Categories-Add-a-limit-filt…
TaduJR Jan 26, 2026
6bc5ee6
Regenerate parser files, merge branch 'main' of github.com:Expensify/…
jasperhuangg Jan 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7076,6 +7076,7 @@ const CONST = {
SORT_ORDER: 'sortOrder',
GROUP_BY: 'groupBy',
COLUMNS: 'columns',
LIMIT: 'limit',
},
SYNTAX_FILTER_KEYS: {
TYPE: 'type',
Expand Down Expand Up @@ -7185,6 +7186,7 @@ const CONST = {
IS: 'is',
REPORT_FIELD: 'report-field',
COLUMNS: 'columns',
LIMIT: 'limit',
},
get SEARCH_USER_FRIENDLY_VALUES_MAP() {
return {
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const SCREENS = {
ADVANCED_FILTERS_WITHDRAWAL_ID_RHP: 'Search_Advanced_Filters_Withdrawal_ID_RHP',
ADVANCED_FILTERS_TAG_RHP: 'Search_Advanced_Filters_Tag_RHP',
ADVANCED_FILTERS_HAS_RHP: 'Search_Advanced_Filters_Has_RHP',
ADVANCED_FILTERS_LIMIT_RHP: 'Search_Advanced_Filters_Limit_RHP',
ADVANCED_FILTERS_FROM_RHP: 'Search_Advanced_Filters_From_RHP',
ADVANCED_FILTERS_TO_RHP: 'Search_Advanced_Filters_To_RHP',
ADVANCED_FILTERS_TITLE_RHP: 'Search_Advanced_Filters_Title_RHP',
Expand Down
5 changes: 3 additions & 2 deletions src/components/Search/SearchPageHeader/SearchFiltersBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,11 @@ function SearchFiltersBar({
updatedFilterFormValues.columns = [];
}

// Preserve the current sortBy and sortOrder from queryJSON when updating filters
// Preserve the current sortBy, sortOrder, and limit from queryJSON when updating filters
let queryString = buildQueryStringFromFilterFormValues(updatedFilterFormValues, {
sortBy: queryJSON.sortBy,
sortOrder: queryJSON.sortOrder,
limit: queryJSON.limit,
});

if (updatedFilterFormValues.groupBy !== searchAdvancedFiltersForm.groupBy) {
Expand All @@ -325,7 +326,7 @@ function SearchFiltersBar({
Navigation.setParams({q: queryString, rawQuery: undefined});
});
},
[searchAdvancedFiltersForm, queryJSON.sortBy, queryJSON.sortOrder],
[searchAdvancedFiltersForm, queryJSON.sortBy, queryJSON.sortOrder, queryJSON.limit],
);

const openAdvancedFilters = useCallback(() => {
Expand Down
5 changes: 4 additions & 1 deletion src/components/Search/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ type SearchTextFilterKeys =
| typeof CONST.SEARCH.SYNTAX_FILTER_KEYS.KEYWORD
| typeof CONST.SEARCH.SYNTAX_FILTER_KEYS.TITLE
| typeof CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_ID
| typeof CONST.SEARCH.SYNTAX_ROOT_KEYS.LIMIT
| ReportFieldTextKey;

type SearchDateFilterKeys =
Expand All @@ -218,7 +219,8 @@ type SearchFilterKey =
| typeof CONST.SEARCH.SYNTAX_ROOT_KEYS.TYPE
| typeof CONST.SEARCH.SYNTAX_ROOT_KEYS.STATUS
| typeof CONST.SEARCH.SYNTAX_ROOT_KEYS.GROUP_BY
| typeof CONST.SEARCH.SYNTAX_ROOT_KEYS.COLUMNS;
| typeof CONST.SEARCH.SYNTAX_ROOT_KEYS.COLUMNS
| typeof CONST.SEARCH.SYNTAX_ROOT_KEYS.LIMIT;

type UserFriendlyKey = ValueOf<typeof CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS>;
type UserFriendlyValue = ValueOf<typeof CONST.SEARCH.SEARCH_USER_FRIENDLY_VALUES_MAP>;
Expand Down Expand Up @@ -249,6 +251,7 @@ type SearchQueryAST = {
policyID?: string[];
rawFilterList?: RawQueryFilter[];
columns?: SearchCustomColumnIds | SearchCustomColumnIds[];
limit?: number;
};

type SearchQueryJSON = {
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useAdvancedSearchFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const typeFiltersKeys = {
CONST.SEARCH.SYNTAX_ROOT_KEYS.GROUP_BY,
CONST.SEARCH.SYNTAX_FILTER_KEYS.GROUP_CURRENCY,
CONST.SEARCH.SYNTAX_FILTER_KEYS.HAS,
CONST.SEARCH.SYNTAX_ROOT_KEYS.LIMIT,
],
[
CONST.SEARCH.SYNTAX_FILTER_KEYS.EXPENSE_TYPE,
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6884,6 +6884,7 @@ Fordere Spesendetails wie Belege und Beschreibungen an, lege Limits und Standard
status: 'Status',
keyword: 'Schlüsselwort',
keywords: 'Schlüsselwörter',
limit: 'Limit',
currency: 'Währung',
completed: 'Abgeschlossen',
amount: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6770,6 +6770,7 @@ const translations = {
status: 'Status',
keyword: 'Keyword',
keywords: 'Keywords',
limit: 'Limit',
currency: 'Currency',
completed: 'Completed',
amount: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6520,6 +6520,7 @@ ${amount} para ${merchant} - ${date}`,
status: 'Estado',
keyword: 'Palabra clave',
keywords: 'Palabras clave',
limit: 'Límite',
currency: 'Divisa',
completed: 'Completadas',
card: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6895,6 +6895,7 @@ Exigez des informations de dépense comme les reçus et les descriptions, défin
status: 'Statut',
keyword: 'Mot-clé',
keywords: 'Mots-clés',
limit: 'Limite',
currency: 'Devise',
completed: 'Terminé',
amount: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6874,6 +6874,7 @@ Richiedi dettagli di spesa come ricevute e descrizioni, imposta limiti e valori
status: 'Stato',
keyword: 'Parola chiave',
keywords: 'Parole chiave',
limit: 'Limite',
currency: 'Valuta',
completed: 'Completato',
amount: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6815,6 +6815,7 @@ ${reportName}
status: 'ステータス',
keyword: 'キーワード',
keywords: 'キーワード',
limit: '制限',
currency: '通貨',
completed: '完了',
amount: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6856,6 +6856,7 @@ Vraag verplichte uitgavedetails zoals bonnetjes en beschrijvingen, stel limieten
status: 'Status',
keyword: 'Trefwoord',
keywords: 'Trefwoorden',
limit: 'Limiet',
currency: 'Valuta',
completed: 'Voltooid',
amount: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6845,6 +6845,7 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
status: 'Status',
keyword: 'Słowo kluczowe',
keywords: 'Słowa kluczowe',
limit: 'Limit',
currency: 'Waluta',
completed: 'Zakończone',
amount: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6847,6 +6847,7 @@ Exija detalhes de despesas como recibos e descrições, defina limites e padrõe
status: 'Status',
keyword: 'Palavra-chave',
keywords: 'Palavras-chave',
limit: 'Limite',
currency: 'Moeda',
completed: 'Concluído',
amount: {
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6696,6 +6696,7 @@ ${reportName}
status: '状态',
keyword: '关键字',
keywords: '关键词',
limit: '限制',
currency: '货币',
completed: '已完成',
amount: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,7 @@ const SearchAdvancedFiltersModalStackNavigator = createModalStackNavigator<Searc
[SCREENS.SEARCH.ADVANCED_FILTERS_IS_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersIsPage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_TAG_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersTagPage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_HAS_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersHasPage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_LIMIT_RHP]: () => require<ReactComponentModule>('../../../../pages/Search/SearchAdvancedFiltersPage/SearchFiltersLimitPage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_FROM_RHP]: () => require<ReactComponentModule>('@pages/Search/SearchAdvancedFiltersPage/SearchFiltersFromPage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_TO_RHP]: () => require<ReactComponentModule>('@pages/Search/SearchAdvancedFiltersPage/SearchFiltersToPage').default,
[SCREENS.SEARCH.ADVANCED_FILTERS_IN_RHP]: () => require<ReactComponentModule>('@pages/Search/SearchAdvancedFiltersPage/SearchFiltersInPage').default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const SEARCH_TO_RHP: Partial<Record<keyof SearchFullscreenNavigatorParamList, st
SCREENS.SEARCH.ADVANCED_FILTERS_IS_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_TAG_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_HAS_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_LIMIT_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_FROM_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_TO_RHP,
SCREENS.SEARCH.ADVANCED_FILTERS_IN_RHP,
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,7 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
[SCREENS.SEARCH.ADVANCED_FILTERS_REIMBURSABLE_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS.getRoute(CONST.SEARCH.SYNTAX_FILTER_KEYS.REIMBURSABLE),
[SCREENS.SEARCH.ADVANCED_FILTERS_WORKSPACE_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS.getRoute(CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.POLICY_ID),
[SCREENS.SEARCH.ADVANCED_FILTERS_HAS_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS.getRoute(CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.HAS),
[SCREENS.SEARCH.ADVANCED_FILTERS_LIMIT_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS.getRoute(CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.LIMIT),
[SCREENS.SEARCH.ADVANCED_FILTERS_PURCHASE_AMOUNT_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS.getRoute(CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.PURCHASE_AMOUNT),
[SCREENS.SEARCH.ADVANCED_FILTERS_PURCHASE_CURRENCY_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS.getRoute(CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.PURCHASE_CURRENCY),
[SCREENS.SEARCH.ADVANCED_FILTERS_ATTENDEE_RHP]: ROUTES.SEARCH_ADVANCED_FILTERS.getRoute(CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.ATTENDEE),
Expand Down
4 changes: 4 additions & 0 deletions src/libs/SearchAutocompleteUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ function filterOutRangesWithCorrectValue(
return userFriendlyColumnList.has(range.value);
case CONST.SEARCH.SYNTAX_FILTER_KEYS.IS:
return isList.includes(range.value);
case CONST.SEARCH.SYNTAX_ROOT_KEYS.LIMIT: {
const num = Number(range.value);
return Number.isInteger(num) && num > 0;
}
default:
return false;
}
Expand Down
Loading
Loading