Skip to content

fix(search): clear sub-filter caches when resetting to tab defaults#2900

Merged
gbirman merged 1 commit into
mainfrom
macro-czmf9cJppJV7Evu7LMphi-search-clear-button-does-not-clear-channel-filters
Apr 28, 2026
Merged

fix(search): clear sub-filter caches when resetting to tab defaults#2900
gbirman merged 1 commit into
mainfrom
macro-czmf9cJppJV7Evu7LMphi-search-clear-button-does-not-clear-channel-filters

Conversation

@gbirman
Copy link
Copy Markdown
Contributor

@gbirman gbirman commented Apr 27, 2026

The Clear button reset queryFilters but left the channel/call/email sub-filter caches in localStorage. Adding a new from: filter calls changeIndex('channels') (since the index was deactivated by Clear), which restores the cached channel_ids from localStorage — so the previously-cleared in: filter reappears.

Fix: clear all three sub-filter caches in resetToTabDefaults.

The Clear button reset queryFilters but left the channel/call/email
sub-filter caches in localStorage. When the user re-activated the
channels index (e.g. by setting a new from filter, which calls
changeIndex('channels') if the index is inactive), the cached
channel_ids and sender_ids were merged back in — making it look like
the previous in: filter was never cleared.
@macro-application
Copy link
Copy Markdown

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b99a190d-2507-4a96-b595-71b36a0751f8

📥 Commits

Reviewing files that changed from the base of the PR and between e9a9032 and 6addb56.

📒 Files selected for processing (1)
  • js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved filter reset behavior to properly clear cached data for channel, call, and email sub-filters.

Walkthrough

This PR modifies useFilterRefinements to import cache-reset helpers for channel, call, and email sub-filters. The resetToTabDefaults function now explicitly invalidates these cached sub-filter states by calling the imported helpers within the reset batch operation.

Changes

Cohort / File(s) Summary
Sub-filter cache invalidation during reset
js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
Added imports for channel/call/email cache-reset helpers and integrated cache invalidation into resetToTabDefaults to clear cached sub-filter state when resetting to tab defaults.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with 'fix:' prefix and clearly describes the main change of clearing sub-filter caches during tab reset.
Description check ✅ Passed The description is directly related to the changeset, explaining the bug that was fixed and the solution implemented in the code changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

@gbirman gbirman merged commit 2078a1c into main Apr 28, 2026
24 checks passed
@gbirman gbirman deleted the macro-czmf9cJppJV7Evu7LMphi-search-clear-button-does-not-clear-channel-filters branch April 28, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant