Skip to content

Modes selector improvements #4902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

brunobergher
Copy link

@brunobergher brunobergher commented Jun 19, 2025

Description

Modes are one of RooCode's main differentiators – users who try different modes are much more likely to stick around.
But they can be hard to understand and can go unnoticed, especially as people are just getting started with the product.

This PR aims to improve that by:

  • Highlighting the mode selector for new users until they click it for the first time
  • Redesigning the mode selector to emphasize the list (no search, edit become settings)
  • Bringing in short descriptions to help users choose the right mow (not yet reflected in the marketplace, mind you)

Test Procedure

The majority of the changes are in the UI, so testing is manual.

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Before
image

After
image

Documentation Updates

Does this PR necessitate updates to user-facing documentation?

  • No documentation updates are required.
  • Yes, documentation updates are required. (Please describe what needs to be updated or link to a PR in the docs repository).

Important

Enhances mode selector UI with a new component, state management for new user interactions, and telemetry tracking in TelemetryClient.ts.

  • UI Enhancements:
    • Introduces ModeSelector component in ChatTextArea.tsx to replace SelectDropdown for mode selection.
    • Highlights mode selector for new users until first interaction.
    • Adds descriptions to modes in modes.ts for better user understanding.
  • State Management:
    • Adds hasOpenedModeSelector to globalSettingsSchema in global-settings.ts and ExtensionState in ExtensionMessage.ts.
    • Updates ClineProvider.ts and webviewMessageHandler.ts to manage hasOpenedModeSelector state.
  • Telemetry:
    • Updates TelemetryClient.ts to track mode selector interactions with setPeopleProperty() and getPeopleProperty() methods.

This description was created by Ellipsis for e45d2da. You can customize this summary. It will automatically update as commits are pushed.

@brunobergher brunobergher requested review from mrubens, cte and jr as code owners June 19, 2025 21:33
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. UI/UX UI/UX related or focused labels Jun 19, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 19, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jun 19, 2025
Comment on lines 91 to 94
vscode.postMessage({
type: "switchTab",
tab: "marketplace",
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be nice if we could switch directly to the modes tab of the marketplace. We do something similar for links to settings, where we can deep link to a specific settings screen.

Copy link
Author

Choose a reason for hiding this comment

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

I built a whole thing for this, extending the ExtensionContext and such, but I wasn't too confident of the implementation. I'll take another stab at it, thanks for the pointer.

</div>
</div>
<p className="my-0 text-sm">
Specialized personas that tailor Roo&apos;s behavior.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's internationalize this

Copy link
Author

Choose a reason for hiding this comment

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

I had done it but probably messed up staging my changes, the strings are all in the i18n files already, sorry.

Comment on lines 46 to 66
public setPeopleProperty(propertyName: string, value: any) {
if (TelemetryClient.telemetryEnabled) {
try {
posthog.people.set({ [propertyName]: value })
} catch (_error) {
// Silently fail if there's an error setting a property.
}
}
}

public getPeopleProperty(propertyName: string): any {
if (TelemetryClient.telemetryEnabled) {
try {
return posthog.get_property(propertyName)
} catch (_error) {
// Silently fail if there's an error getting a property.
return null
}
}
return null
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can probably exclude these changes from the PR

Copy link
Author

@brunobergher brunobergher Jun 20, 2025

Choose a reason for hiding this comment

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

This is stupid, sorry 🤦
Remnants from my first attempt at tracking whether the user opened the mode selector

@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 20, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 20, 2025
Copy link
Collaborator

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

This looks really nice!

I left a couple of minor suggestions, also can you take a look at the conflicts so I can move this PR for review?

Thank you!

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Changes Requested] in Roo Code Roadmap Jun 22, 2025

if (TelemetryService.hasInstance()) {
// Determine which setting was changed by comparing objects
const oldPrompt = existingPrompts[message.promptMode] || {}
Copy link
Author

Choose a reason for hiding this comment

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

I don't love the complexity of this logic and the fact it's repeated elsewhere, but this was Roo's insistent suggestion on how to determine the changed setting and I couldn't figure out a different one which didn't lead to much more complex changes (eg one global event per setting change)

Comment on lines +1610 to +1613
// This could be more generic, but keeping it specific for now
if (message.tab === "modes" && TelemetryService.hasInstance()) {
TelemetryService.instance.captureModesViewShown()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I kind of like the idea of a "Tab Shown" event - I might look into replacing this with that quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR - Changes Requested size:XL This PR changes 500-999 lines, ignoring generated files. UI/UX UI/UX related or focused
Projects
Status: PR [Changes Requested]
Development

Successfully merging this pull request may close these issues.

4 participants