Added Browser Assistant Mode #2132
Closed
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.
Add Browser Assistant Mode
Context
This PR adds a new "Browser Assistant Mode" option to the browser settings. When enabled, this mode always uses the latest browser tab for navigation instead of trying to find a tab with the same root domain. This is useful for users who want more predictable browser behavior or need to work with multiple pages from the same domain in separate tabs.
Implementation
The implementation involved several key changes:
Added a new entry in the settings.json file for the browser assistant mode option with appropriate labels and descriptions.
Updated the ExtensionStateContextType interface to include the browserAssistantModeEnabled property and its setter function.
Added a new checkbox UI component in BrowserSettings.tsx for toggling the browser assistant mode.
Modified the BrowserSession.ts file to implement the core functionality:
Updated the ExtensionMessage type to include the "browserAssistantModeEnabled" message type for communication between the webview and extension.
The implementation follows the existing pattern for browser settings, making it consistent with the rest of the codebase. The feature is designed to be opt-in, so it won't affect existing users unless they explicitly enable it.
Screenshots
Note: Actual screenshots would show the browser settings panel before and after the addition of the new "Use browser assistant mode" checkbox option.
How to Test
Important
Adds 'Browser Assistant Mode' to use the latest browser tab for navigation, with settings and UI updates for toggling the feature.
BrowserSession.tswith a check innavigateToUrl().BrowserSettings.tsxto toggle mode.browserAssistantModeEnabledtoExtensionStateContextTypeandExtensionMessage.settings.jsonandExtensionStateContext.tsxfor new mode.BrowserSettings.tsxto include new checkbox.ClineProvider.tsto handle new message typebrowserAssistantModeEnabled.This description was created by
for 56d591b. It will automatically update as commits are pushed.