Skip to content

feat: Toggle 'Web Search' on Prompt bar#11781

Open
kashan-samad wants to merge 1 commit intodanny-avila:mainfrom
kashan-samad:feature/toggle-web-search-on-prompt-bar
Open

feat: Toggle 'Web Search' on Prompt bar#11781
kashan-samad wants to merge 1 commit intodanny-avila:mainfrom
kashan-samad:feature/toggle-web-search-on-prompt-bar

Conversation

@kashan-samad
Copy link

Toggle Web Search on Prompt Bar

📋 Summary

This PR adds native web search toggle functionality to the prompt bar, allowing users without authenticated web search permissions to enable/disable web search directly from the chat input area.

🎯 Problem

Users without authenticated web search permissions had no easy way to toggle web search functionality. The web search option was not accessible or visible in the prompt bar, limiting the ability to quickly enable/disable this feature during conversations.

✨ Solution

Implemented a new NativeWebSearch component that provides web search toggle functionality in the prompt bar:

  • Permission-Based Rendering: Component only shows for users without authenticated web search access
  • Conditional Visibility: Displays when web search is enabled or when the toggle is pinned
  • State Management: Uses conversation state as single source of truth for web search status
  • Pin Support: Respects localStorage pin preferences to keep toggle visible when needed
  • Integration: Seamlessly integrates with existing BadgeRow and ToolsDropdown components

📸 Visual Changes

In the prompt bar:

  • A checkbox button with Globe icon appears for users without authenticated web search
  • Users can click to toggle web search on/off for the current conversation
  • Toggle visibility respects both enablement state and pin preferences
  • Visual feedback with purple accent colors when web search is enabled

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Translation update

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

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.

1 participant