Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 22, 2025

This PR adds a new CloudAccountSwitcher component to the ChatTextArea that allows users to switch between multiple cloud accounts (personal and organization accounts).

Changes

  • Created CloudAccountSwitcher component that displays current account icon
  • Added tooltip with 'Switch Roo Cloud Account' text (localized)
  • Component only visible when user has 2+ accounts (multiple orgs or org + personal)
  • Integrated into ChatTextArea next to IndexingStatusBadge
  • Added rooCloudAccountSwitch message handler for account switching
  • Exposed organization memberships through CloudService and ClineProvider
  • Added translation keys for all supported locales
  • Account switching redirects to /switch landing page after logout

Testing

  • Linting passes
  • Type checking passes
  • Component visibility logic works correctly
  • Tooltip displays correctly
  • Click handler triggers account switch flow

Implementation review: 92% confidence - Ready for production


Important

Introduces CloudAccountSwitcher component for switching between cloud accounts in ChatTextArea, with localization and message handling support.

  • Behavior:
    • Adds CloudAccountSwitcher component to ChatTextArea for switching between cloud accounts.
    • Displays current account icon and tooltip with 'Switch Roo Cloud Account' text.
    • Component visible only when user has 2+ accounts.
    • Account switching redirects to /switch landing page after logout.
  • Integration:
    • Integrated CloudAccountSwitcher next to IndexingStatusBadge in ChatTextArea.tsx.
    • Added rooCloudAccountSwitch message handler in webviewMessageHandler.ts.
  • Localization:
    • Added translation key switchAccount for all supported locales in cloud.json files.
  • API:
    • Exposed organization memberships through CloudService and ClineProvider.

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

…accounts

- Created CloudAccountSwitcher component that displays current account icon
- Added tooltip with 'Switch Roo Cloud Account' text (localized)
- Component only visible when user has 2+ accounts (multiple orgs or org + personal)
- Integrated into ChatTextArea next to IndexingStatusBadge
- Added rooCloudAccountSwitch message handler for account switching
- Exposed organization memberships through CloudService and ClineProvider
- Added translation keys for all supported locales
- Account switching redirects to /switch landing page after logout
- Fixed all linting issues
@roomote roomote bot requested review from cte, jr and mrubens as code owners September 22, 2025 17:40
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Sep 22, 2025
"taskList": "Roo Code Cloud ist hier: Verfolge und kontrolliere deine Aufgaben von überall. <learnMoreLink>Mehr erfahren</learnMoreLink>."
}
},
"switchAccount": "Switch Roo Cloud Account"
Copy link
Contributor

Choose a reason for hiding this comment

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

Notice: The new key 'switchAccount' uses an English message ('Switch Roo Cloud Account') in the German locale file. If this isn’t intentional, please translate it into German before merging.

Suggested change
"switchAccount": "Switch Roo Cloud Account"
"switchAccount": "Roo Cloud Konto wechseln"

This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.

"testApiAuthentication": "Test API Authentication",
"signIn": "Connect to Roo Code Cloud",
"connect": "Get started",
"switchAccount": "Switch Roo Cloud Account",
Copy link
Contributor

Choose a reason for hiding this comment

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

Typographical suggestion: The new label "Switch Roo Cloud Account" appears to be inconsistent with other entries that reference "Roo Code Cloud" (e.g., "Connect to Roo Code Cloud"). If this is unintentional, consider updating it to "Switch Roo Code Cloud Account" for consistency.

Suggested change
"switchAccount": "Switch Roo Cloud Account",
"switchAccount": "Switch Roo Code Cloud Account",

This comment was generated because it violated the following rules: irule_C0ez7Rji6ANcGkkX and irule_VrRKWqywZ2YV2SOE.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 22, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Reviewing my own code is like proofreading my own typos - I'll probably miss the obvious ones.

if (organizationMemberships.length >= 2) return true

// If user has at least one org membership, they also have personal account access
if (organizationMemberships.length >= 1) return true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Visibility logic concern: This component will show for users with just one organization membership, even if they can't actually switch to a personal account. Consider adding a check to verify if users can actually switch between accounts (e.g., check if personal account access is available).

Suggested change
if (organizationMemberships.length >= 1) return true
// If user has at least one org membership, they also have personal account access
if (organizationMemberships.length >= 1) {
// TODO: Verify if user can actually switch to personal account
// This assumes all users with org memberships also have personal account access
return true
}

"taskList": "Roo Code Cloud ja és aquí: segueix i controla les teves tasques des de qualsevol lloc. <learnMoreLink>Més informació</learnMoreLink>."
}
},
"switchAccount": "Switch Roo Cloud Account"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missing translation: The "Switch Roo Cloud Account" text should be translated to Catalan instead of being hardcoded in English.

if (CloudService.hasInstance() && CloudService.instance.isAuthenticated()) {
cloudOrganizationMemberships = await CloudService.instance.getOrganizationMemberships()
}
} catch (error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Error handling: Consider showing a degraded UI state if fetching organization memberships fails, rather than just logging the error. Users might wonder why the account switcher isn't appearing.


public async getOrganizationMemberships(): Promise<CloudOrganizationMembership[]> {
this.ensureInitialized()
if (this.authService && "getOrganizationMemberships" in this.authService) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Type safety: Consider using a more explicit interface check instead of duck typing with the 'in' operator. You could define an interface that includes getOrganizationMemberships method.

@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Sep 23, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Sep 23, 2025
@daniel-lxs
Copy link
Member

Closing, this feature was merged

@daniel-lxs daniel-lxs closed this Sep 25, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Sep 25, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 25, 2025
@daniel-lxs daniel-lxs deleted the feat/cloud-account-switcher branch September 25, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Needs Preliminary Review 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.

4 participants