-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add CloudAccountSwitcher component for switching between cloud accounts #8221
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
Conversation
…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
| "taskList": "Roo Code Cloud ist hier: Verfolge und kontrolliere deine Aufgaben von überall. <learnMoreLink>Mehr erfahren</learnMoreLink>." | ||
| } | ||
| }, | ||
| "switchAccount": "Switch Roo Cloud Account" |
There was a problem hiding this comment.
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.
| "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", |
There was a problem hiding this comment.
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.
| "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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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).
| 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" |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
|
Closing, this feature was merged |
This PR adds a new CloudAccountSwitcher component to the ChatTextArea that allows users to switch between multiple cloud accounts (personal and organization accounts).
Changes
Testing
Implementation review: 92% confidence - Ready for production
Important
Introduces
CloudAccountSwitchercomponent for switching between cloud accounts inChatTextArea, with localization and message handling support.CloudAccountSwitchercomponent toChatTextAreafor switching between cloud accounts./switchlanding page after logout.CloudAccountSwitchernext toIndexingStatusBadgeinChatTextArea.tsx.rooCloudAccountSwitchmessage handler inwebviewMessageHandler.ts.switchAccountfor all supported locales incloud.jsonfiles.CloudServiceandClineProvider.This description was created by
for 2ccdf60. You can customize this summary. It will automatically update as commits are pushed.