App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-11-19] [$175] Add Reset Filter button to Empty State.

Open dubielzyk-expensify opened this issue 3 weeks ago • 21 comments

Problem

Now that our filters are sticky and stays as you navigate between the various views on the Spend screen, It might sometimes be confusing when you have a green (1) and yet you don't understand why it's not showing.

Solution

Where we show the Nothing to show empty state, add a reset filters primary button when the button also appears in the filter bar:

Image

cc @Expensify/design @trjExpensify @JS00001 @JmillsExpensify

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

dubielzyk-expensify avatar Nov 05 '26 01:11 dubielzyk-expensify

Auto-assigning issues to engineers is no longer supported. If you think this issue should receive engineering attention, please raise it in #whatsnext.

melvin-bot[bot] avatar Nov 05 '26 02:11 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 (External)

melvin-bot[bot] avatar Nov 05 '26 02:11 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022118161433080215846

melvin-bot[bot] avatar Nov 05 '26 02:11 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

Filters on the Spend screen are sticky now, so a filter can stay applied while the user moves between views. When the filters match nothing, we show the "Nothing to show" empty state, and the only way to clear them is the small Reset button in the filter bar. Users don't connect the green filter count with the empty list. We want a primary "Reset filters" button in the "Nothing to show" empty state, shown exactly when the Reset button shows in the filter bar.

What is the root cause of that problem?

This is a new feature, so there is no bug. Two things make it necessary:

  • EmptySearchViewContent (src/pages/Search/EmptySearchView.tsx) builds the "Nothing to show" content (search.searchResults.emptyResults) in four places (inaccessible workspace and filtered results for expense-report and expense, plus the chat/default case and the final fallback). None of them has buttons, and the component knows nothing about filter state.
  • The filter bar's reset state lives inside useSearchFiltersBar (src/components/Search/SearchPageHeader/useSearchFiltersBar.tsx):
    const resetFilters = () => {
        if (!currentSearchQueryJSON) {
            return;
        }
        Navigation.setParams({q: buildQueryStringWithResetFilters(currentSearchQueryJSON, currentDefaultSearchQueryJSON), rawQuery: undefined});
        setSearchContext(false);
    };
    ...
    canReset: hasDefaultQuery ? hasFiltersChangedFromDefault(currentSearchQueryJSON, currentDefaultSearchQueryJSON) : filters.length > 0,
    
    The empty state can't use them without copying the logic. A copy would drift and disagree with the bar.

What changes do you think we should make in order to solve the problem?

  1. Extract the reset logic into one shared hook so the filter bar and the empty state use the same condition and handler. Add useSearchFiltersReset (src/components/Search/SearchPageHeader/useSearchFiltersReset.ts). It returns {canReset, resetFilters}:

    • resetFilters is the current handler, moved here unchanged: buildQueryStringWithResetFilters + Navigation.setParams + setSearchContext(false).
    • canReset is the current expression, moved here. It reads currentSearchQueryJSON / currentDefaultSearchQueryJSON from useSearchQueryContext(). For queries without a default query (trip/chat), the hook keeps today's "any visible filter chip" rule: it reads ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM and checks mapFiltersFormToLabelValueList(form, currentDefaultSearchQueryFilterKeys, SKIPPED_SEARCH_FILTERS, ...).length > 0. That is the same function and inputs the bar uses today (trip-room statuses included through getFiltersFormWithTripRoomStatuses).
    • useSearchFiltersBar calls useSearchFiltersReset() and returns its canReset / resetFilters in place of its own, so UseSearchFiltersBarResult and SearchFiltersBarWide / SearchFiltersBarNarrow don't change. The bar shows Reset under the same rule as before.
  2. Use it in the empty state. In EmptySearchViewContent, call const {canReset, resetFilters} = useSearchFiltersReset();. Move the repeated "Nothing to show" object into one local builder, so all four places get the button:

    const getNothingToShowContent = (): EmptySearchViewItem => ({
        ...defaultViewItemHeader.folder,
        title: translate('search.searchResults.emptyResults.title'),
        subtitle: translate('search.searchResults.emptyResults.subtitle'),
        buttons: canReset
            ? [
                  {
                      buttonText: translate('search.resetFilters'), // existing "Reset filters" copy
                      buttonAction: resetFilters,
                      buttonVariant: CONST.BUTTON_VARIANT.SUCCESS,
                      sentryLabel: CONST.SENTRY_LABEL.SEARCH.EMPTY_STATE.RESET_FILTERS,
                  },
              ]
            : undefined,
    });
    

    Add RESET_FILTERS: 'Search-EmptyState-ResetFilters' next to the other SENTRY_LABEL.SEARCH.EMPTY_STATE labels. The other empty states (no expenses yet, To-do "fireworks", trips, invoices) stay as they are. They aren't "Nothing to show" and already have their own CTAs.

    Pressing the button runs the same Navigation.setParams as the bar. The query resets to the view's default, the bar's Reset disappears, and since canReset becomes false, the empty-state button disappears with it (or the results load).

  3. Tests

    • tests/unit/hooks/useSearchFiltersBar.test.tsx: keep the existing canReset / resetFilters cases passing. Add a useSearchFiltersReset test for both branches (with and without a default query) and that resetFilters calls Navigation.setParams with the reset query.
    • tests/ui/components/EmptySearchViewTest.tsx: "Nothing to show" with a changed filter shows "Reset filters", and pressing it calls Navigation.setParams with the default query. With default filters it shows no button. The "no expenses yet" state shows no "Reset filters" button.

Manual test plan

  1. Go to Spend > Expenses and add a filter that matches nothing (e.g. merchant zzzz). "Nothing to show" shows a green "Reset filters" button, and the filter bar shows Reset.
  2. Press "Reset filters". The filters return to the view's default, results show, and both buttons disappear.
  3. Switch to Reports with the sticky filter still on and repeat. Same result.
  4. With no extra filters, on a view that returns nothing (e.g. Chats), no "Reset filters" button shows, and the filter bar shows no Reset.
  5. Check wide and narrow layouts (web, mWeb, native) and offline.

What alternative solutions did you explore? (Optional)

  • Call useSearchFiltersBar(queryJSON) directly in EmptySearchView and take canReset / resetFilters. This needs no refactor, but it builds every filter chip and popover only to read a boolean. The small shared hook does less work and still keeps one source of truth.
  • Copy the condition into EmptySearchView (hasFiltersChangedFromDefault(...)). This is simpler, but it breaks the requirement that the two buttons never disagree. The trip/chat fallback branch would also drift.
  • Reuse SearchAdvancedFiltersProvider's shouldShowResetFilters. That is the advanced-filters RHP's draft-form state, not the applied query, so it can differ from the bar.

xomaxie avatar Nov 05 '26 02:11 xomaxie

Problem: Filters on the Spend screen are sticky, so a filter can stay applied while the user moves between views. When the filters match nothing, the "Nothing to show" empty state gives no way out — the only reset is the small Reset button in the filter bar, and users do not connect the green filter count with the empty list.

Root cause: This is a missing feature, not a broken one. EmptySearchViewContent (src/pages/Search/EmptySearchView.tsx) already supports buttons?: EmptyStateButton[] and renders them, but none of the filtered empty-results branches passes a reset button, and the component knows nothing about filter state. The reset condition and handler (canReset, resetFilters — buildQueryStringWithResetFilters + Navigation.setParams + setSearchContext(false)) live only inside useSearchFiltersBar in the search header, so the empty state cannot reuse them without copying the logic.

Fix:

  1. Extract canReset and resetFilters out of useSearchFiltersBar (src/components/Search/SearchPageHeader/useSearchFiltersBar.tsx:242-259) into one shared hook (e.g. useSearchFiltersReset) that both the filter bar and the empty state consume, so the two can never disagree about when reset is available.
  2. In EmptySearchView, in the filtered empty-results branches only (expense-report / expense / chat / default with filters applied), render a primary "Reset filters" button exactly when canReset is true — the same condition as the filter bar's Reset button.
  3. Wire the button to the shared resetFilters handler unchanged. Do not show it for genuinely empty (unfiltered) states or the inaccessible-workspace state.
  4. Add the button label under search.searchResults.emptyResults in src/languages/en.ts (e.g. resetFilters: 'Reset filters').

Verification: Apply a filter that matches nothing and confirm the empty state shows a primary Reset filters button; tap it and confirm the filters clear and results return; with no filters changed, confirm no button appears; confirm the button's visibility always matches the filter bar's Reset button. Add tests for the shared hook's canReset parity with the bar and for the empty-state button rendering per branch.

khizzcr7 avatar Nov 05 '26 06:11 khizzcr7

Proposal

Please re-state the problem that we are trying to solve in this issue.

Because filters on the Spend screen are sticky across views, users can land on a "Nothing to show" empty state without noticing that active filters in the filter bar are hiding results. Whenever the "Nothing to show" empty state is displayed and the Reset button is visible in the filter bar, we should render a primary "Reset filters" button inside the empty state.

What is the root cause of that problem?

  1. Filter reset state is private to useSearchFiltersBar (src/components/Search/SearchPageHeader/useSearchFiltersBar.tsx:242-260): canReset (hasDefaultQuery ? hasFiltersChangedFromDefault(currentSearchQueryJSON, currentDefaultSearchQueryJSON) : filters.length > 0) and resetFilters (buildQueryStringWithResetFilters + Navigation.setParams + setSearchContext(false)) are computed inside useSearchFiltersBar alongside all filter chip popovers and are not shared with EmptySearchView.
  2. "Nothing to show" branches in EmptySearchView.tsx do not attach a reset button (src/pages/Search/EmptySearchView.tsx): EmptySearchViewContent constructs the "Nothing to show" empty state (search.searchResults.emptyResults.title) in two places:
    • In the switch (type) and fallback branches (lines 285–294 for EXPENSE_REPORT, lines 328–337 for EXPENSE, lines 408–412 for CHAT/default, and lines 420–424 fallback), none of which pass buttons.
    • In the typeMenuItems loop (lines 232–246) for Insights menu items (src/libs/SearchUIUtils.ts:5299-5302), which define emptyState.title: 'search.searchResults.emptyResults.title' without buttons. Because GROUP_CURRENCY, FEED, BANK_ACCOUNT, WITHDRAWAL_STATUS, and WITHDRAWAL_ID are in similarSearchIgnoredFilters (src/libs/SearchQueryUtils.ts:1023-1029), changing those filters on an Insights view keeps similarSearchHash === menuItem.similarSearchHash while canReset becomes true in the filter bar.

What changes do you think we should make in order to solve the problem?

  1. Extract a shared useSearchFiltersReset hook (src/components/Search/SearchPageHeader/useSearchFiltersReset.ts): Move the canReset and resetFilters logic into a dedicated hook that reads currentSearchQueryJSON, currentDefaultSearchQueryJSON, and currentDefaultSearchQueryFilterKeys from useSearchQueryContext() (and checks mapFiltersFormToLabelValueList on ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM when !hasDefaultQuery), and consume useSearchFiltersReset() in both useSearchFiltersBar and EmptySearchViewContent:

    function useSearchFiltersReset() {
        const [searchAdvancedFiltersForm = getEmptyObject<Partial<SearchAdvancedFiltersForm>>()] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM);
        const {translate, localeCompare, dateFnsLocale} = useLocalize();
        const {convertToDisplayStringWithoutCurrency} = useCurrencyListActions();
        const {currentSearchQueryJSON, currentDefaultSearchQueryJSON, currentDefaultSearchQueryFilterKeys} = useSearchQueryContext();
        const shouldReturnTripRooms = useShouldReturnTripRooms(currentSearchQueryJSON?.type);
    
        const hasDefaultQuery = !!currentDefaultSearchQueryJSON && !!currentSearchQueryJSON;
        const canReset = hasDefaultQuery
            ? hasFiltersChangedFromDefault(currentSearchQueryJSON, currentDefaultSearchQueryJSON)
            : mapFiltersFormToLabelValueList(
                  shouldReturnTripRooms ? getFiltersFormWithTripRoomStatuses(searchAdvancedFiltersForm) : searchAdvancedFiltersForm,
                  currentDefaultSearchQueryFilterKeys,
                  SKIPPED_SEARCH_FILTERS,
                  translate,
                  dateFnsLocale,
                  localeCompare,
                  convertToDisplayStringWithoutCurrency,
              ).length > 0;
    
        const resetFilters = () => {
            if (!currentSearchQueryJSON) {
                return;
            }
            Navigation.setParams({q: buildQueryStringWithResetFilters(currentSearchQueryJSON, currentDefaultSearchQueryJSON), rawQuery: undefined});
            setSearchContext(false);
        };
    
        return {canReset, resetFilters};
    }
    
  2. Add RESET_FILTERS sentry label in src/CONST/index.ts:10512-10517:

    EMPTY_STATE: {
        TAKE_TEST_DRIVE: 'Search-EmptyState-TakeTestDrive',
        CREATE_EXPENSE: 'Search-EmptyState-CreateExpense',
        CREATE_REPORT: 'Search-EmptyState-CreateReport',
        SEND_INVOICE: 'Search-EmptyState-SendInvoice',
        RESET_FILTERS: 'Search-EmptyState-ResetFilters',
    },
    
  3. Render the primary "Reset filters" button in src/pages/Search/EmptySearchView.tsx whenever "Nothing to show" is shown and canReset is true: In EmptySearchViewContent, call const {canReset, resetFilters} = useSearchFiltersReset(); and define a helper for the "Nothing to show" empty state (reusing existing translate('search.resetFilters') from src/languages/en.ts:11010):

    const resetFiltersButton: EmptyStateButton[] | undefined = canReset
        ? [
              {
                  buttonText: translate('search.resetFilters'),
                  buttonAction: resetFilters,
                  buttonVariant: CONST.BUTTON_VARIANT.SUCCESS,
                  sentryLabel: CONST.SENTRY_LABEL.SEARCH.EMPTY_STATE.RESET_FILTERS,
              },
          ]
        : undefined;
    
    const getEmptyResultsContent = (): EmptySearchViewItem => ({
        ...defaultViewItemHeader.folder,
        title: translate('search.searchResults.emptyResults.title'),
        subtitle: translate('search.searchResults.emptyResults.subtitle'),
        buttons: resetFiltersButton,
    });
    

    Use getEmptyResultsContent() across the "Nothing to show" branches (lines 285, 291, 328, 334, 408, 420), and in the typeMenuItems loop (lines 235–243), fall back to resetFiltersButton when menuItem.emptyState.title === 'search.searchResults.emptyResults.title' and !menuItem.emptyState.buttons:

    buttons:
        menuItem.emptyState.buttons?.map((button) => ({
            ...button,
            buttonText: translate(button.buttonText),
        })) ?? (menuItem.emptyState.title === 'search.searchResults.emptyResults.title' ? resetFiltersButton : undefined),
    

What alternative solutions did you explore? (Optional)

  • Calling useSearchFiltersBar directly inside EmptySearchViewContent: Rejected because useSearchFiltersBar instantiates FilterPopup components and loading state for every active chip; extracting useSearchFiltersReset shares the exact same canReset and resetFilters logic without unnecessary work.
  • Only adding buttons to the 4 fallback objects in switch (type): Rejected because Insights views (SearchUIUtils.ts:5299-5302) resolve "Nothing to show" inside the typeMenuItems loop when filters in similarSearchIgnoredFilters (such as groupCurrency or feed) are changed.

What automated tests can you add to prevent this from re-occurring?

  • In tests/ui/components/EmptySearchViewTest.tsx, add tests verifying that:
    1. When "Nothing to show" is rendered and canReset is true (filters differ from default), the primary "Reset filters" button is visible and pressing it calls Navigation.setParams with the reset query string.
    2. When "Nothing to show" is rendered and canReset is false, no "Reset filters" button is rendered.
    3. Unfiltered empty states ("No expenses yet", "No reports yet", etc.) do not render "Reset filters".

Enes2553 avatar Nov 05 '26 07:11 Enes2553

Proposal for Issue #106053 — Add Reset Filter button to Empty State ($175)

Please re-state the problem that we are trying to solve in this issue

Filters on the Spend screen are now sticky across views. When active filters match nothing, the user sees a "Nothing to show" empty state, but the only way to clear filters is the small "Reset" button in the filter bar. Users don't connect the green filter count badge with the empty list. We need a primary "Reset filters" button inside the empty state, shown exactly when the Reset button is also visible in the filter bar (i.e. when canReset is true).

What is the root cause of that problem?

This is a missing feature, not a bug. EmptySearchViewContent in src/pages/Search/EmptySearchView.tsx already supports a buttons?: EmptyStateButton[] prop on its content items and renders them via GenericEmptyStateComponent. However:

  1. None of the filtered empty-results branches (CHAT/default case at line 407-414, the "no results" branches in EXPENSE_REPORT at line 289-294, EXPENSE at line 332-337) passes a reset button.
  2. EmptySearchViewContent does not call useSearchFiltersBar, so it has no access to canReset or resetFilters.
  3. The canReset logic (from useSearchFiltersBar.tsx line 257) determines whether filters differ from defaults — exactly the condition described in the issue.

What changes do you think we should make in code to solve the problem?

  1. Call useSearchFiltersBar(queryJSON) inside EmptySearchViewContent to get canReset and resetFilters.

  2. When canReset is true AND the content has no existing buttons (i.e. the "Nothing to show" empty states that currently lack a reset), add a "Reset filters" primary button to the content's buttons array.

  3. The button should use CONST.BUTTON_VARIANT.SUCCESS (primary) to match the design mockup, and include a sentryLabel following the Sentry labeling convention.

Code change in src/pages/Search/EmptySearchView.tsx:

// Inside EmptySearchViewContent, after existing hooks:
const {canReset, resetFilters} = useSearchFiltersBar(queryJSON);

// After content is determined (after line 416, before the fallback):
if (content && canReset) {
    const resetButton: EmptyStateButton = {
        buttonText: translate('search.searchResults.resetFilters'),
        sentryLabel: CONST.SENTRY_LABEL.SEARCH.EMPTY_STATE.RESET_FILTERS,
        buttonAction: resetFilters,
        buttonVariant: CONST.BUTTON_VARIANT.SUCCESS,
    };
    content.buttons = [...(content.buttons ?? []), resetButton];
}

This approach:

  • Only shows the button when filters are active and resetable (matching the filter bar's Reset button visibility)
  • Works across all empty state types (expenses, reports, invoices, chat, etc.)
  • Uses the existing EmptyStateButton type and rendering pipeline
  • Doesn't duplicate the reset logic — reuses useSearchFiltersBar which is already used by the filter bar

What specific scenarios should be covered by automated tests?

  • Empty state shows "Reset filters" button when canReset is true
  • Empty state does NOT show "Reset filters" button when canReset is false (no filters applied)
  • Clicking the button calls resetFilters (which resets the query params)
  • Existing buttons (Create Expense, Take Test Drive, etc.) still appear alongside the reset button

What alternative solutions did you explore?

  1. Pass canReset and resetFilters as props from Search/index.tsx — rejected because it adds prop drilling through two components and useSearchFiltersBar is a hook meant to be called where needed (it reads from Onyx via its own useOnyx calls internally).

  2. Add the reset button only to specific empty state branches — rejected because the issue says "where we show the 'Nothing to show' empty state", which applies across all data types, not just one. The generic approach ensures consistency.

PR

PR will be linked here once created.

vanshshah11 avatar Nov 05 '26 09:11 vanshshah11

@ahmedGaber93 — I am interested in the paid implementation of this $175 task, but need to clarify a testing prerequisite before submitting a formal implementation proposal or starting work.

I reviewed EmptySearchView.tsx and useSearchFiltersBar.tsx at 66bbc52c006bb7f8e808adcde3e1e524294acbb7. The existing reset preserves the view's default query through buildQueryStringWithResetFilters, clears rawQuery, and calls setSearchContext(false). The empty-results branches currently have no corresponding action. A scoped implementation should reuse that same applied-query reset contract, rather than introduce a second definition of “reset,” and leave the distinct onboarding, trip and celebratory empty states unchanged. I would specifically check saved-search/default-query behavior, absence of a current query, and visibility parity with the header, not just that a button renders.

I see the existing proposals and am not claiming priority or submitting a duplicate patch. Is the implementation still available to a new contributor, and is there an approved arrangement in which I provide the implementation plus reproducible unit/web checks while a designated reviewer performs the required native-platform verification? I do not currently have confirmed macOS/iOS test access, and I will not claim to meet the all-platform requirement without an agreed, legitimate testing arrangement. The account owner's Upwork verification would also need to be confirmed before a formal application/hire.

This is a non-binding availability/qualification inquiry, not a claim of assignment, completion or payment eligibility. No application tests have been run and no PR has been opened. AI assistance was used for the source review and this message.

xmejl avatar Nov 05 '26 12:11 xmejl

@ahmedGaber93 wanna handle this one w/ melvin?

JS00001 avatar Nov 05 '26 12:11 JS00001

@MelvinBot Implement this.

ahmedGaber93 avatar Nov 05 '26 18:11 ahmedGaber93

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a user applies filters on the Reports / Search page that produce zero results ("Nothing to show"), they currently have to look up into the filter bar header to find and click "Reset filters". We want to display a primary "Reset filters" button directly inside the "Nothing to show" empty state whenever active filters can be reset.

What is the root cause of that problem?

In src/pages/Search/EmptySearchView.tsx, EmptySearchViewContent constructs the default "Nothing to show" empty state (title: translate('search.searchResults.emptyResults.title'), subtitle: translate('search.searchResults.emptyResults.subtitle')) without passing any buttons array when no specific saved-search empty state matches. Meanwhile, the logic that determines whether non-default filters are active (hasResetFilters) and resets them (resetFilters) is encapsulated inside src/components/Search/SearchPageHeader/useSearchFiltersBar.tsx (lines 285–326) and is not shared with EmptySearchView.

What changes do you think we should make in order to solve the problem?

  1. Extract the hasResetFilters computation and resetFilters callback from src/components/Search/SearchPageHeader/useSearchFiltersBar.tsx into a reusable hook (or reuse useSearchFiltersBar / a dedicated useSearchResetFilters(queryJSON) hook in src/components/Search/SearchPageHeader/useSearchResetFilters.ts that both useSearchFiltersBar and EmptySearchView call).
  2. In src/pages/Search/EmptySearchView.tsx inside EmptySearchViewContent, invoke const {hasResetFilters, resetFilters} = useSearchResetFilters(queryJSON) (or read from useSearchFiltersBar).
  3. For all "Nothing to show" (search.searchResults.emptyResults) branches in EmptySearchViewContent (such as custom queries or filtered views with active resettable filters where buttons is not already populated), conditionally include buttons: hasResetFilters ? [{buttonText: translate('search.resetFilters'), buttonAction: resetFilters, success: true}] : undefined.
  4. Update tests/unit/EmptySearchViewTest.tsx to verify that the "Reset filters" button appears in the empty state when filters are applied and triggers resetFilters when pressed.

What alternative solutions did you explore? (Optional)

We considered always showing "Reset filters" on every "Nothing to show" empty state regardless of whether additional filters are active, but matching the existing hasResetFilters condition ensures the button only appears when resetting filters would actually change the query.

jeffrey-graham avatar Nov 07 '26 04:11 jeffrey-graham

📣 @jeffrey-graham! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Nov 07 '26 04:11 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When filters are applied on the Spend screen resulting in no matching transactions, the screen displays a "Nothing to show" empty state, which can be confusing because the user might not realize filters are hiding their items.

What is the root cause of that problem?

The empty state view (EmptyStateComponent) on the Spend screen currently displays static empty text and does not inspect the active filter state to conditionally present an actionable "Reset filters" button.

What changes do you think we should make in order to solve the problem?

  1. Pass the active filter count / state into the Spend empty state container.
  2. When active filters are present (filter count > 0), render a primary "Reset filters" button below the empty state illustration/description.
  3. Connect the button's onPress callback to the existing filter reset action (clearAllFilters), restoring the unfiltered view and matching the filter bar button.
  4. Add unit and visual tests for the Spend empty state with active filters vs. truly empty workspaces.

What alternative solutions did you explore? (Optional)

Only relying on the filter bar reset button. Adding the primary button directly inside the empty state canvas is significantly more intuitive and aligns with standard UX practices as requested by the design team.

TassioSales avatar Nov 08 '26 18:11 TassioSales

@ahmedGaber93

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.36-0 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/106136

If no regressions arise, payment will be issued on 2026-11-19. :confetti_ball:

The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

melvin-bot[bot] avatar Nov 12 '26 08:11 melvin-bot[bot]

@ahmedGaber93 Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Nov 12 '26 21:11 melvin-bot[bot]

Contributor+ Checklist:

  • [x] [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to the comment on the PR: N/A. new feature. Link to the comment on the Issue: N/A. new feature.

  • [x] [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion: N/A.

  • [x] [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal

Precondition:

Test:

  1. Go to Spend > Expenses
  2. Add a filter that matches nothing (e.g. Merchant contains zzzz)
  3. Verify the "Nothing to show" empty state shows a green "Reset filters" button
  4. Verify the filter bar also shows "Reset"
  5. Tap "Reset filters" in the empty state
  6. Verify filters return to defaults, expenses are shown, and both reset buttons disappear

Do we agree 👍 or 👎

ahmedGaber93 avatar Nov 16 '26 22:11 ahmedGaber93

The linked issue above, https://github.com/Expensify/App/issues/106588, is not a regression and was closed as expected behavior https://github.com/Expensify/App/issues/106588#issuecomment-6809408150

ahmedGaber93 avatar Nov 16 '26 22:11 ahmedGaber93

Triggered auto assignment to @mallenexpensify (Awaiting Payment)

Payment Summary

Resolving PRs:

  • https://github.com/Expensify/App/pull/106136

  • Reviewer: @ahmedGaber93 owed $175 via NewDot

BugZero Checklist (@mallenexpensify)

  • [ ] I have confirmed assignees, roles, and Upwork contracts look correct
  • [ ] I have paid out Upwork contracts / manual NewDot requests
  • [ ] [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon

Claude posting on behalf of Matt:

Ready. Job price: $175 (standard, no Help Wanted, assigned 2026-11-05).

  • ahmedGaber93 (C+): 100%, via NewDot

QA asked about 106588. It closed as expected behavior: no regression.

Next: press Caps+Y, then pay.

Evidence
  • C+ checklist, 7 steps: comment.
  • PR 106136: by MelvinBot, merged 2026-11-10, production 2026-11-12, approved by ahmedGaber93 and JS00001. No revert.
  • Test videos: C+ 5/5.

PAYPREP v1

mallenexpensify avatar Nov 20 '26 01:11 mallenexpensify