Skip to content

Conversation

@afshawnlotfi
Copy link
Contributor

@afshawnlotfi afshawnlotfi commented Mar 31, 2025

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:

  1. Added a new entry in the settings.json file for the browser assistant mode option with appropriate labels and descriptions.

  2. Updated the ExtensionStateContextType interface to include the browserAssistantModeEnabled property and its setter function.

  3. Added a new checkbox UI component in BrowserSettings.tsx for toggling the browser assistant mode.

  4. Modified the BrowserSession.ts file to implement the core functionality:

    • Added a check for browserAssistantModeEnabled in the navigateToUrl method
    • When enabled, it always uses the latest tab (last in the array) instead of looking for a tab with the same root domain
    • Updated the navigation logic to work with the assistant mode
  5. 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

before after
Before- Browser settings without the assistant mode option image - Browser settings with the new assistant mode checkbox

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

  1. Open the Roo Code extension in VS Code
  2. Click on the settings icon to open the settings panel
  3. Navigate to the "Browser / Computer Use" section
  4. Enable the "Browser tool" option if not already enabled
  5. You should see the new "Use browser assistant mode" checkbox
  6. Test with the option disabled (default):
    • Launch a browser with a URL (e.g., https://example.com)
    • Then try to navigate to a different domain (e.g., https://github.com)
    • Roo should open a new tab for the different domain
    • If you navigate back to example.com, it should reuse the first tab
  7. Test with the option enabled:
    • Enable the "Use browser assistant mode" checkbox
    • Launch a browser with a URL (e.g., https://example.com)
    • Then try to navigate to the same domain (e.g., https://example.com/about)
    • Roo should always use the latest tab instead of looking for a tab with the same domain

Important

Adds 'Browser Assistant Mode' to use the latest browser tab for navigation, with settings and UI updates for toggling the feature.

  • Behavior:
    • Adds 'Browser Assistant Mode' to settings, using the latest tab for navigation instead of matching root domain.
    • Implemented in BrowserSession.ts with a check in navigateToUrl().
    • New checkbox in BrowserSettings.tsx to toggle mode.
  • Settings and State:
    • Adds browserAssistantModeEnabled to ExtensionStateContextType and ExtensionMessage.
    • Updates settings.json and ExtensionStateContext.tsx for new mode.
  • UI and Localization:
    • Updates BrowserSettings.tsx to include new checkbox.
    • Adds localization strings for new mode in multiple language files.
  • Misc:
    • Updates ClineProvider.ts to handle new message type browserAssistantModeEnabled.

This description was created by Ellipsis for 56d591b. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Mar 31, 2025

⚠️ No Changeset found

Latest commit: 353cc8a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Mar 31, 2025
@afshawnlotfi afshawnlotfi force-pushed the browser-assistant-mode branch from 18b1526 to 56d591b Compare March 31, 2025 02:45
@hannesrudolph hannesrudolph moved this from New to Issue [In Progress] in Roo Code Roadmap Apr 1, 2025
@hannesrudolph
Copy link
Collaborator

Holding until Can.Nuri chips in to complete the assistant aspect.

@hannesrudolph hannesrudolph marked this pull request as draft April 1, 2025 03:44
@benzntech
Copy link
Contributor

I'm using a remote development setup (Code will be on server) to debug my local chrome browser. Does browser tool usually work okay in the browser in that kind of situation?

@hannesrudolph hannesrudolph added the Issue - In Progress Someone is actively working on this. Should link to a PR soon. label Apr 22, 2025
@hannesrudolph hannesrudolph moved this from Issue [In Progress] to PR [Pre Approval Review] in Roo Code Roadmap May 8, 2025
@hannesrudolph hannesrudolph moved this from PR [Pre Approval Review] to PR [Draft/WIP] in Roo Code Roadmap May 10, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Draft/WIP] in Roo Code Roadmap May 20, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft/WIP] to Done in Roo Code Roadmap May 22, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft/WIP] to Done in Roo Code Roadmap May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue - In Progress Someone is actively working on this. Should link to a PR soon. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants