Skip to content

Reports - Keyword quick filter remains after clicking Reset while on saved search #88074

Closed

Description

@mitarachim

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.60-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #86297
Email or phone of affected tester (no customers): applausetester+sjois22jd3@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Search

Action Performed:

Precondition:

  • Have a saved search with category filter.
  1. Go to staging.new.expensify.com
  2. Go to Reports > Expenses.
  3. Open the saved search with category filter.
  4. Click Filters.
  5. Click Keywords.
  6. Enter anything > click Save.
  7. Click outside the RHP.
  8. Click Keyword quick filter.
  9. Click Reset.

Expected Result:

Keyword quick filter will be removed.

Actual Result:

Keyword quick filter remains after clicking Reset while on saved search.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7131130_1776317797320.18.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    on Apr 16, 2026
  2. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #86297

  3. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 16, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. OSBotify commented on Apr 16, 2026

    @OSBotify
    Contributor

    Investigation Summary: Classification=Frontend bug. Causing PR=#86297 '[Wiring the UI] Revamp search page actions bar' by @bernhardoj (High confidence). Recommendation=REVERT. PR 86297 introduced a significant revamp of the search page actions bar and is the clear cause of this regression. The bug is staging-only (not reproducible in production). Assigned: @bernhardoj (PR author), @aimane-chnaif, @JS00001, @luacmartins (approving reviewers). Labels: Removing DeployBlocker (backend deploy not affected, pure frontend issue). Keeping DeployBlockerCash. Root Cause: PR 86297 introduced useSearchFiltersBar as the new hook for filter chips. When on a saved search: opening Advanced Filters > Keywords > saving writes to Onyx but NOT the URL, then closing the RHP causes useSearchFilterSync to skip re-syncing (intentional guard), leaving Onyx with a keyword that isn't in the URL. When Reset is clicked on the keyword chip, updateFilterForm updates the URL but doesn't atomically clear the Onyx form, so the chip persists.

  6. removed
    DeployBlocker
    on Apr 16, 2026
  7. MelvinBot commented on Apr 16, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    Every filter dropdown popup (TextInputPopup, MultiSelectPopup, SingleSelectPopup, etc.) follows the same pattern in its resetChanges handler: call onChange(resetValue) then closeOverlay(). The problem is that onChange triggers updateFilterForm in useSearchFiltersBar.tsx, which calls close(navigationCallback) from libs/actions/Modal.ts. Since the popover is open, close() calls closeTop(), which invokes the popover's registered close handler -- which is toggleOverlay. Then closeOverlay() also calls toggleOverlay.

    toggleOverlay is a state toggle (setIsOverlayVisible(prev => !prev)), not a "set to false". Calling it twice in the same React batch produces a no-op (true -> false -> true). The popover never closes, onModalDidClose never fires, and the deferred Navigation.setParams callback is orphaned. The URL q param stays unchanged, so the keyword filter persists.

    The call chain:

    1. resetChanges() -> onChange('') -> updateFilterForm({keyword: ''}) -> Modal.close(navCallback) -> closeTop() -> toggleOverlay() (1st: true->false)
    2. closeOverlay() -> toggleOverlay() (2nd: false->true)
    3. React batches both: isOverlayVisible stays true, popover never closes, navigation never fires

    This was introduced by PR #86297 because keyword was not previously shown as a quick filter chip -- it was only accessible through the Advanced Filters RHP. The PR made keyword (and other filters) appear as quick filter chips with inline popover Reset/Apply buttons, exposing this double-toggle bug.

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

    In all filter popup components, remove the closeOverlay() call from resetChanges and applyChanges. The onChange -> updateFilterForm -> Modal.close() path already handles closing the popover via closeTop(). The explicit closeOverlay() is redundant and creates the double-toggle.

    Affected files (all in src/components/Search/FilterDropdowns/):

    • TextInputPopup.tsx (lines 21-29)
    • MultiSelectPopup.tsx (lines 92-100)
    • SingleSelectPopup.tsx (lines 110-118)
    • GroupByPopup.tsx (lines 75-83)
    • InSelectPopup.tsx (lines 162-170)
    • CardSelectPopup.tsx (lines 131-141)
    • UserSelectPopup.tsx (lines 136-145)
    • ReportFieldPopup.tsx (lines 209-233)
    • DateSelectPopup/index.tsx (lines 97-131)
    • AmountPopup.tsx (lines 113-121)

    Alternatively, change closeOverlay from a toggle to an explicit setIsOverlayVisible(false) in DropdownButton.tsx, so calling it multiple times is idempotent. This is a smaller, safer change that fixes the same issue without removing the closeOverlay() calls.

    What alternative solutions did you explore? (Optional)

    The alternative to removing closeOverlay() calls is changing DropdownButton.tsx line 102-110 to provide a dedicated closeOverlay function that calls setIsOverlayVisible(false) instead of reusing toggleOverlay. This is arguably cleaner since closeOverlay semantically means "close", not "toggle", and would prevent any future code from hitting the same double-toggle issue.

    Investigation details

    Key evidence chain:

    • TextInputPopup.tsx:26-29: resetChanges calls onChange('') then closeOverlay()
    • useSearchFiltersBar.tsx:153-181: updateFilterForm merges filter values, builds query string, calls Modal.close(navCallback) where navCallback is Navigation.setParams({q: queryString})
    • Modal.ts:50-61: close() stores the navCallback as onModalClose, then calls closeTop() which invokes the popover's registered close handler
    • BaseModal.tsx:141: Registers onClose via setCloseModal(onClose) when the popover mounts
    • Popover/index.tsx:70-76: Wraps onClose as onCloseWithPopoverContext which calls toggleOverlay
    • DropdownButton.tsx:102-110: toggleOverlay is setIsOverlayVisible(prev => !prev) -- a toggle, not a setter
    • DropdownButton.tsx:144: closeOverlay passed to popup components IS toggleOverlay
    • Modal.ts:63-74: onModalDidClose fires the stored navCallback, but only when the modal actually finishes closing

    The same double-toggle pattern exists in applyChanges across all popup components, meaning Apply buttons are also broken when the popover is registered with the Modal system. Note that UserSelectPopup.applyChanges (line 136-140) happens to call closeOverlay() BEFORE onChange(), which accidentally works correctly because the toggle fires before closeTop runs.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  8. bernhardoj commented on Apr 16, 2026

    @bernhardoj
    Contributor

    This happens on other filters and on prod too.

    The issue here is that, when selecting a filter from the advanced filters page, even though we haven't pressed View results, the filter is already saved to the onyx data. So, when pressing Reset, the search query stays the same, and so does the onyx data.

    web.mp4
  9. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Apr 16, 2026
  10. JS00001 commented on Apr 16, 2026

    @JS00001
    Contributor

    Demoting since this happens on prod

  11. JS00001 commented on Apr 20, 2026

    @JS00001
    Contributor

    @bernhardoj are you working on this one?

  12. bernhardoj commented on Apr 20, 2026

    @bernhardoj
    Contributor

    Nope. I think we can just hold (or close) for the release 2 because this won't happen anymore after we refactor the filters popup.

  13. JS00001 commented on Apr 20, 2026

    @JS00001
    Contributor

    Yeah lets fix this with the filter changes, please make sure we test this

  14. JS00001 commented on Apr 20, 2026

    @JS00001
    Contributor

    Commented on the issue, closing this one

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

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions