Skip to content

Commit f65fccf

Browse files
committed
Show the Roo provider on the welcome screen
1 parent bf1aafa commit f65fccf

File tree

20 files changed

+110
-9
lines changed

20 files changed

+110
-9
lines changed

src/assets/images/roo.png

3.95 KB
Loading

webview-ui/src/components/welcome/WelcomeView.tsx

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ const WelcomeView = () => {
8383
description: t("welcome:routers.openrouter.description"),
8484
authUrl: getOpenRouterAuthUrl(uriScheme),
8585
},
86+
{
87+
slug: "roo",
88+
name: "Roo Code Cloud",
89+
description: t("welcome:routers.roo.description"),
90+
incentive: t("welcome:routers.roo.incentive"),
91+
authUrl: "#", // Placeholder since onClick handler will prevent default
92+
},
8693
]
8794

8895
// Shuffle providers based on machine ID (will be consistent for the same machine)
@@ -94,9 +101,36 @@ const WelcomeView = () => {
94101
<a
95102
key={index}
96103
href={provider.authUrl}
97-
className="flex-1 border border-vscode-panel-border hover:bg-secondary rounded-md py-3 px-4 mb-2 flex flex-row gap-3 cursor-pointer transition-all no-underline text-inherit"
104+
className="relative flex-1 border border-vscode-panel-border hover:bg-secondary rounded-md py-3 px-4 mb-2 flex flex-row gap-3 cursor-pointer transition-all no-underline text-inherit"
98105
target="_blank"
99-
rel="noopener noreferrer">
106+
rel="noopener noreferrer"
107+
onClick={(e) => {
108+
// Special handling for Roo provider
109+
if (provider.slug === "roo") {
110+
e.preventDefault()
111+
112+
// Set the Roo provider configuration
113+
const rooConfig: ProviderSettings = {
114+
apiProvider: "roo",
115+
}
116+
117+
// Save the Roo provider configuration
118+
vscode.postMessage({
119+
type: "upsertApiConfiguration",
120+
text: currentApiConfigName,
121+
apiConfiguration: rooConfig,
122+
})
123+
124+
// Then trigger cloud sign-in
125+
vscode.postMessage({ type: "rooCloudSignIn" })
126+
}
127+
// For other providers, let the default link behavior work
128+
}}>
129+
{provider.incentive && (
130+
<div className="absolute top-0 right-0 text-xs text-white bg-vscode-badge-background px-2 py-0.5 rounded-bl rounded-tr-md">
131+
{provider.incentive}
132+
</div>
133+
)}
100134
<div className="w-8 h-8 flex-shrink-0">
101135
<img
102136
src={`${imagesBaseUri}/${provider.slug}.png`}
@@ -108,13 +142,8 @@ const WelcomeView = () => {
108142
<div className="text-sm font-medium text-vscode-foreground">
109143
{provider.name}
110144
</div>
111-
<div>
112-
<div className="text-xs text-vscode-descriptionForeground">
113-
{provider.description}
114-
</div>
115-
{provider.incentive && (
116-
<div className="text-xs mt-1">{provider.incentive}</div>
117-
)}
145+
<div className="text-xs text-vscode-descriptionForeground">
146+
{provider.description}
118147
</div>
119148
</div>
120149
</a>

webview-ui/src/i18n/locales/ca/welcome.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/de/welcome.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/en/welcome.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
},
1111
"openrouter": {
1212
"description": "A unified interface for LLMs"
13+
},
14+
"roo": {
15+
"description": "The best free models to get started",
16+
"incentive": "Try Roo out for free"
1317
}
1418
},
1519
"chooseProvider": "To do its magic, Roo needs an API key.",

webview-ui/src/i18n/locales/es/welcome.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/fr/welcome.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/hi/welcome.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/id/welcome.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/it/welcome.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)