feat: add research/search mode toggle with config and feature flag (#779)#782
Merged
NoopDog merged 4 commits intomim-fran-noop/778-ai-epicfrom Feb 21, 2026
Merged
feat: add research/search mode toggle with config and feature flag (#779)#782NoopDog merged 4 commits intomim-fran-noop/778-ai-epicfrom
NoopDog merged 4 commits intomim-fran-noop/778-ai-epicfrom
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a new mode selection feature for the Explore view, allowing users to toggle between "search" and "research" modes. The feature is controlled by either a feature flag ("chat") or a configuration setting (config.ai.enabled). The PR creates a generic, context-based toggle button group provider for managing state, implements a mode-specific provider that wraps it, and integrates the toggle UI into the Explore view's sidebar.
Changes:
- Adds a generic
ToggleButtonGroupProviderfor managing toggle button state via React context - Implements a
ModeProviderthat enables mode toggling based on feature flags or AI configuration - Creates a
ToggleButtonGroupUI component for switching between "research" and "search" modes - Updates the Explore view layout with new styled components and integrates the mode toggle
- Adds comprehensive test coverage for both providers
- Deprecates the old
SidebarToolscomponent - Adds configuration support for AI features in
SiteConfig
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/toggleButtonGroupProvider.test.tsx | Adds comprehensive tests for the generic ToggleButtonGroupProvider |
| tests/modeProvider.test.tsx | Adds comprehensive tests for the ModeProvider with feature flag and config scenarios |
| src/views/ExploreView/search/sidebar/sidebar.styles.ts | Adds styled Stack component for sidebar layout |
| src/views/ExploreView/search/filters/filters.styles.ts | Adds styled Grid component for filter controls layout |
| src/views/ExploreView/mode/types.ts | Defines MODE enum with RESEARCH and SEARCH values |
| src/views/ExploreView/mode/provider/types.ts | Defines type definitions for mode context and provider props |
| src/views/ExploreView/mode/provider/provider.tsx | Implements ModeProvider that conditionally enables mode toggling |
| src/views/ExploreView/mode/provider/hook.ts | Exports useMode hook for consuming mode context |
| src/views/ExploreView/mode/provider/context.ts | Creates ModeContext with React's createContext |
| src/views/ExploreView/mode/constants.ts | Defines FEATURE_FLAG constant for "chat" feature |
| src/views/ExploreView/mode/components/ToggleButtonGroup/toggleButtonGroup.tsx | Implements the ToggleButtonGroup UI component |
| src/views/ExploreView/mode/components/ToggleButtonGroup/toggleButtonGroup.styles.ts | Styles for the ToggleButtonGroup component |
| src/views/ExploreView/mode/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.tsx | Storybook story for visual testing of ToggleButtonGroup |
| src/views/ExploreView/mode/components/ToggleButtonGroup/constants.ts | Configuration for toggle button group props and button definitions |
| src/views/ExploreView/exploreView.tsx | Integrates ModeProvider and ToggleButtonGroup into the Explore view |
| src/tests/testIds.ts | Adds SEARCH_CONTROLS test ID |
| src/config/entities.ts | Adds AiConfig interface and ai property to SiteConfig |
| src/components/common/ToggleButtonGroup/provider/types.ts | Defines generic types for toggle button group context and provider |
| src/components/common/ToggleButtonGroup/provider/provider.tsx | Implements generic ToggleButtonGroupProvider with state management |
| src/components/common/ToggleButtonGroup/provider/hook.ts | Exports useToggleButtonGroup hook |
| src/components/common/ToggleButtonGroup/provider/context.ts | Creates ToggleButtonGroupContext |
| src/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.ts | Deprecates SidebarTools component with proper documentation |
| src/components/Filter/components/SearchAllFilters/searchAllFilters.styles.ts | Adds grid-column styling to make SearchAllFilters span full width |
src/views/ExploreView/mode/components/ToggleButtonGroup/toggleButtonGroup.tsx
Show resolved
Hide resolved
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
NoopDog
approved these changes
Feb 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #779.
This pull request introduces a new mode selection feature ("search" vs. "research") for the Explore view, controlled by a feature flag or configuration. It adds a context-based provider for managing the mode, a toggle button group UI for switching modes, and updates the Explore view layout to accommodate these changes. Additionally, it includes some minor style and test ID updates, and deprecates an old sidebar tools component.
Mode selection and management:
ModeProvidercomponent that supplies mode context ("search" or "research") based on the "chat" feature flag or AI configuration, using aToggleButtonGroupProviderfor state management. (src/views/ExploreView/mode/provider/provider.tsx,src/views/ExploreView/mode/provider/context.ts,src/views/ExploreView/mode/provider/types.ts,src/views/ExploreView/mode/provider/hook.ts,src/views/ExploreView/mode/types.ts,src/views/ExploreView/mode/constants.ts,src/config/entities.ts,src/config/entities.ts) [1] [2] [3] [4] [5] [6] [7] [8]ModeProviderandToggleButtonGroupinto the Explore view, updating the sidebar layout and replacing the deprecatedSidebarToolscomponent. (src/views/ExploreView/exploreView.tsx,src/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.ts) [1] [2] [3] [4] [5] [6]Toggle button group implementation:
src/components/common/ToggleButtonGroup/provider/context.ts,src/components/common/ToggleButtonGroup/provider/hook.ts,src/components/common/ToggleButtonGroup/provider/provider.tsx,src/components/common/ToggleButtonGroup/provider/types.ts) [1] [2] [3] [4]ToggleButtonGroupUI component with storybook stories and custom styles for mode selection. (src/views/ExploreView/mode/components/ToggleButtonGroup/toggleButtonGroup.tsx,src/views/ExploreView/mode/components/ToggleButtonGroup/constants.ts,src/views/ExploreView/mode/components/ToggleButtonGroup/toggleButtonGroup.styles.ts,src/views/ExploreView/mode/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.tsx) [1] [2] [3] [4]Layout and style adjustments:
src/views/ExploreView/search/filters/filters.styles.ts,src/views/ExploreView/search/sidebar/sidebar.styles.ts,src/components/Filter/components/SearchAllFilters/searchAllFilters.styles.ts) [1] [2] [3]Other minor changes:
src/tests/testIds.ts)SidebarToolsstyled component. (src/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.ts)