Skip to content

fix(actions): persist source selection when toggling search tool in ActionsPopover#8750

Open
Subash-Mohan wants to merge 1 commit intomainfrom
fix-action-enable-persistance
Open

fix(actions): persist source selection when toggling search tool in ActionsPopover#8750
Subash-Mohan wants to merge 1 commit intomainfrom
fix-action-enable-persistance

Conversation

@Subash-Mohan
Copy link
Contributor

@Subash-Mohan Subash-Mohan commented Feb 25, 2026

Description

  • Fixed source selection not persisting to localStorage when toggling the search tool on/off in the ActionsPopover

How Has This Been Tested?

Tested by first disabling all the sources; at that point, the internal search tool was disabled. When I enabled the tool and refreshed the page, it stays enabled. Previously, it went back to a disabled state again.

Additional Options

  • [Optional] Please cherry-pick this PR to the latest release version.
  • [Optional] Override Linear Check

Summary by cubic

Persist source selection when toggling the search tool in ActionsPopover, so the tool’s state and selected sources survive page reloads. Fixes the regression where the search tool reverted to disabled after refresh.

  • Bug Fixes
    • Use enableSources(...) and baseDisableAllSources(...) to write changes to localStorage.
    • On enable: restore previous sources or enable all; on disable: save current sources, then disable all.

Written for commit 07b3662. Summary will update on new commits.

@Subash-Mohan Subash-Mohan requested a review from a team as a code owner February 25, 2026 08:15
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

Fixed a bug where source selection wasn't persisting to localStorage when toggling the search tool on/off in the ActionsPopover. The fix replaces direct state mutations with persistence-aware functions:

  • Changed setSelectedSources() to enableSources() when re-enabling sources
  • Changed setSelectedSources([]) to baseDisableAllSources() when disabling all sources

These functions internally call persistSourcePreferencesState(), ensuring that the user's source selection is saved to localStorage and persists across page refreshes.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a straightforward bug fix that replaces direct state mutations with the correct persistence-aware functions. The fix is well-contained, uses existing, tested functions (enableSources, baseDisableAllSources), and directly addresses the issue described in the PR description. No new logic is introduced, and the change follows the existing patterns in the codebase.
  • No files require special attention

Important Files Changed

Filename Overview
web/src/refresh-components/popovers/ActionsPopover/index.tsx Fixed source selection persistence when toggling search tool - replaced direct state mutations with localStorage-aware functions

Last reviewed commit: 07b3662

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@github-actions
Copy link
Contributor

🖼️ Visual Regression Report

Project Changed Added Removed Unchanged Report
admin 34 0 0 75 View Report
exclusive 0 0 0 8 ✅ No changes

Copy link
Contributor

@Danelegend Danelegend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been tested with multiple and various scenarios?
ie. Suppose we have 2 internal sources hooked up. Select 1, press disable all, press enable all and expect that one to come up again.

Likewise, you should be able to disable internal search, refresh and see it come back again.

Reason for asking is a feel like there was a scenario where this approach didn't work. But it could have just been a skill issue on me.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants