Skip to content

Conversation

@brunobergher
Copy link
Collaborator

@brunobergher brunobergher commented Aug 30, 2025

Adds environment URL indicator pill to AccountView component to help engineers identify non-production environments.

📝 Description

This PR introduces a visual indicator in the Account view that displays the current Roo Code Cloud API URL when it differs from the production URL. This enhancement helps developers and engineers quickly identify when they're working with staging, development, or local environments.

image

Behavior

  • Production (https://app.roocode.com): No pill displayed
  • Staging/Dev (e.g., https://staging.roocode.com): Pill displayed with URL
  • Local (e.g., http://localhost:3000): Pill displayed with URL
  • Undefined: No pill displayed

🧪 Testing

Added 4 new test cases to ensure proper functionality:

  1. Pill is hidden when pointing to production
  2. Pill is visible when pointing to non-production environments
  3. Pill displays correctly for both authenticated and non-authenticated users
  4. Pill is hidden when cloudApiUrl is undefined

All tests passing: ✅ 8/8 tests in AccountView.spec.tsx

✅ Checklist

  • Code follows the project's style guidelines
  • Self-review of code completed
  • Tests added and passing
  • No console errors or warnings
  • Feature works as expected in different scenarios
  • Uses existing VSCode theme variables for consistent styling

🚀 Impact

  • User Impact: Minimal - only visible to engineers working with non-production environments
  • Performance: Negligible - simple conditional rendering
  • Accessibility: Maintains existing accessibility standards

Important

Adds a URL indicator pill in CloudView to display non-production cloudApiUrl, with tests and i18n updates.

  • Behavior:
    • Adds a URL indicator pill in CloudView to show non-production cloudApiUrl.
    • Pill is hidden for production URL (https://app.roocode.com) and when cloudApiUrl is undefined.
    • Pill is visible for staging, development, or local URLs.
  • Testing:
    • Adds tests in CloudView.spec.tsx to verify pill visibility for different cloudApiUrl values and authentication states.
  • i18n:
    • Updates translation files to include cloudUrlPillLabel for multiple languages.

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

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Enhancement New feature or request labels Aug 30, 2025
{cloudApiUrl && cloudApiUrl !== "https://app.roocode.com" && (
<div className="mt-6 flex justify-center">
<div className="inline-flex items-center px-3 py-1 gap-1 rounded-full bg-vscode-badge-background/50 text-vscode-badge-foreground text-xs">
<span className="text-vscode-foreground/75">Roo Code Cloud URL: </span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of hardcoding the pill label, please use the translation function (e.g. t('account:cloudUrlPillLabel')) for 'Roo Code Cloud URL:' so it's translatable instead of a hardcoded string.

Suggested change
<span className="text-vscode-foreground/75">Roo Code Cloud URL: </span>
<span className="text-vscode-foreground/75">{t('account:cloudUrlPillLabel')}</span>

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

<div className="mt-6 flex justify-center">
<div className="inline-flex items-center px-3 py-1 gap-1 rounded-full bg-vscode-badge-background/50 text-vscode-badge-foreground text-xs">
<span className="text-vscode-foreground/75">Roo Code Cloud URL: </span>
<a href="{cloudApiUrl}">{cloudApiUrl}</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Typographical issue: The href attribute is written as href="{cloudApiUrl}", which treats the curly braces as literal text. In JSX, you should use interpolation without quotes, e.g., , to correctly embed the variable.

Suggested change
<a href="{cloudApiUrl}">{cloudApiUrl}</a>
<a href={cloudApiUrl}>{cloudApiUrl}</a>

</div>
</>
)}
{cloudApiUrl && cloudApiUrl !== "https://app.roocode.com" && (
Copy link
Member

Choose a reason for hiding this comment

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

I think it might be a good idea to make the URL a constant so it's easier to change if necessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

💯

Copy link
Contributor

@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.

Thank you for your contribution! I've reviewed the changes and found an issue that needs attention. The feature is well-implemented with good test coverage, but there's a critical syntax error in the href attribute that prevents the link from working correctly.

<div className="mt-6 flex justify-center">
<div className="inline-flex items-center px-3 py-1 gap-1 rounded-full bg-vscode-badge-background/50 text-vscode-badge-foreground text-xs">
<span className="text-vscode-foreground/75">Roo Code Cloud URL: </span>
<a href="{cloudApiUrl}">{cloudApiUrl}</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a syntax error here - the href attribute has quotes around the curly braces which will render literally as "{cloudApiUrl}" instead of the actual URL value.

Copy link
Member

Choose a reason for hiding this comment

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

This is still an issue

<div className="mt-6 flex justify-center">
<div className="inline-flex items-center px-3 py-1 gap-1 rounded-full bg-vscode-badge-background/50 text-vscode-badge-foreground text-xs">
<span className="text-vscode-foreground/75">Roo Code Cloud URL: </span>
<a href="{cloudApiUrl}">{cloudApiUrl}</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this link intended to be clickable? If so, you might want to consider using the vscode.postMessage with openExternal type (similar to handleVisitCloudWebsite on line 55) to properly open the URL. Otherwise, if it's just for display, you could remove the anchor tag entirely.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 30, 2025
@brunobergher
Copy link
Collaborator Author

@roomote-agent incorporate all of the PR feedback you see here

@roomote
Copy link
Contributor

roomote bot commented Aug 30, 2025

Hi @brunobergher! I see the PR feedback and will incorporate all the suggested changes:

  1. Fix the href syntax error (remove quotes around curly braces)
  2. Add translation support for the "Roo Code Cloud URL:" label
  3. Extract the production URL as a constant
  4. Consider implementing proper link handling with vscode.postMessage

Working on these changes now!

@roomote
Copy link
Contributor

roomote bot commented Aug 30, 2025

Hi @brunobergher! ✅ All PR feedback has been successfully incorporated:

Changes Made:

  1. Fixed href syntax error - Removed quotes around curly braces in the href attribute (changed from href="{cloudApiUrl}" to href={cloudApiUrl})
  2. Added translation support - Created cloudUrlPillLabel translation key and added it to all 18 locale files
  3. Extracted production URL as constant - Created PRODUCTION_CLOUD_URL constant for better maintainability
  4. Implemented proper link handling - Replaced anchor tag with a button that uses vscode.postMessage with openExternal for proper URL opening

Test Results:

  • ✅ All 8 AccountView tests passing
  • ✅ Translation check passing (all locales updated)
  • ✅ Linting and type checking passing
  • ✅ Unit tests passing on both Ubuntu and Windows

The integration test failure appears to be unrelated to these changes. All the critical checks related to the PR feedback are now passing!

@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 30, 2025
daniel-lxs

This comment was marked as outdated.

daniel-lxs

This comment was marked as off-topic.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 30, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Draft / In Progress] in Roo Code Roadmap Aug 30, 2025
@daniel-lxs daniel-lxs moved this from PR [Draft / In Progress] to PR [Changes Requested] in Roo Code Roadmap Aug 30, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review PR - Changes Requested and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. PR - Needs Preliminary Review labels Aug 30, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 31, 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 lgtm This PR has been approved by a maintainer PR - Needs Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants