Skip to content

Commit 0b5e178

Browse files
committed
New 1-click onboarding flow
1 parent e311f7c commit 0b5e178

File tree

4 files changed

+63
-21
lines changed

4 files changed

+63
-21
lines changed

.changeset/late-chefs-remember.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Update the welcome page to provide 1-click OAuth flows with LLM routers or more advanced configuration with custom providers.

src/core/webview/ClineProvider.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,14 +2648,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
26482648
if (stateValues.apiProvider) {
26492649
apiProvider = stateValues.apiProvider
26502650
} else {
2651-
// Either new user or legacy user that doesn't have the apiProvider stored in state
2652-
// (If they're using OpenRouter or Bedrock, then apiProvider state will exist)
2653-
if (secretValues.apiKey) {
2654-
apiProvider = "anthropic"
2655-
} else {
2656-
// New users should default to openrouter
2657-
apiProvider = "openrouter"
2658-
}
2651+
apiProvider = "anthropic"
26592652
}
26602653

26612654
// Build the apiConfiguration object combining state values and secrets

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

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import { useCallback, useState } from "react"
22
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
3-
3+
import { VSCodeButtonLink } from "../common/VSCodeButtonLink"
44
import { useExtensionState } from "../../context/ExtensionStateContext"
55
import { validateApiConfiguration } from "../../utils/validate"
66
import { vscode } from "../../utils/vscode"
77
import ApiOptions from "../settings/ApiOptions"
88
import { Tab, TabContent } from "../common/Tab"
9-
import { Alert } from "../common/Alert"
109
import { useAppTranslation } from "../../i18n/TranslationContext"
10+
import { getRequestyAuthUrl, getOpenRouterAuthUrl } from "../../oauth/urls"
1111

1212
const WelcomeView = () => {
1313
const { apiConfiguration, currentApiConfigName, setApiConfiguration, uriScheme } = useExtensionState()
1414
const { t } = useAppTranslation()
15-
1615
const [errorMessage, setErrorMessage] = useState<string | undefined>(undefined)
1716

1817
const handleSubmit = useCallback(() => {
@@ -32,19 +31,59 @@ const WelcomeView = () => {
3231
<TabContent className="flex flex-col gap-5">
3332
<h2 className="m-0 p-0">{t("welcome:greeting")}</h2>
3433
<div>{t("welcome:introduction")}</div>
35-
<Alert className="font-bold text-sm">{t("welcome:notice")}</Alert>
36-
<ApiOptions
37-
fromWelcomeView
38-
apiConfiguration={apiConfiguration || {}}
39-
uriScheme={uriScheme}
40-
setApiConfigurationField={(field, value) => setApiConfiguration({ [field]: value })}
41-
errorMessage={errorMessage}
42-
setErrorMessage={setErrorMessage}
43-
/>
34+
<div>{t("welcome:chooseProvider")}</div>
35+
36+
<div className="mb-4">
37+
<h4 className="mt-3 mb-2">{t("welcome:startRouter")}</h4>
38+
39+
<div className="flex gap-4">
40+
<div className="flex-1 border border-vscode-panel-border rounded p-4 flex flex-col items-center">
41+
<VSCodeButtonLink
42+
href={getRequestyAuthUrl(uriScheme)}
43+
className="bg-blue-500 text-white w-16 h-16 flex items-center justify-center rounded mb-2 text-xl font-bold no-underline">
44+
REQ
45+
</VSCodeButtonLink>
46+
<div className="text-center">
47+
<div className="font-bold">Requesty</div>
48+
<div className="text-sm text-vscode-descriptionForeground">
49+
{t("welcome:requestyDescription")}
50+
</div>
51+
52+
<div className="text-sm text-blue-400 font-bold">$1 free credit</div>
53+
</div>
54+
</div>
55+
<div className="flex-1 border border-vscode-panel-border rounded p-4 flex flex-col items-center">
56+
<VSCodeButtonLink
57+
href={getOpenRouterAuthUrl(uriScheme)}
58+
className="bg-blue-500 text-white w-16 h-16 flex items-center justify-center rounded mb-2 text-xl font-bold no-underline">
59+
OR
60+
</VSCodeButtonLink>
61+
<div className="text-center">
62+
<div className="font-bold">OpenRouter</div>
63+
<div className="text-sm text-vscode-descriptionForeground">
64+
{t("welcome:openRouterDescription")}
65+
</div>
66+
</div>
67+
</div>
68+
</div>
69+
70+
<div className="text-center my-4">or</div>
71+
<h4 className="mt-3 mb-2">{t("welcome:startCustom")}</h4>
72+
<ApiOptions
73+
fromWelcomeView
74+
apiConfiguration={apiConfiguration || {}}
75+
uriScheme={uriScheme}
76+
setApiConfigurationField={(field, value) => setApiConfiguration({ [field]: value })}
77+
errorMessage={errorMessage}
78+
setErrorMessage={setErrorMessage}
79+
/>
80+
</div>
4481
</TabContent>
4582
<div className="sticky bottom-0 bg-vscode-sideBar-background p-5">
4683
<div className="flex flex-col gap-1">
47-
<VSCodeButton onClick={handleSubmit}>{t("welcome:start")}</VSCodeButton>
84+
<VSCodeButton onClick={handleSubmit} appearance="primary">
85+
{t("welcome:start")}
86+
</VSCodeButton>
4887
{errorMessage && <div className="text-vscode-errorForeground">{errorMessage}</div>}
4988
</div>
5089
</div>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"introduction": "I can do all kinds of tasks thanks to the latest breakthroughs in agentic coding capabilities and access to tools that let me create & edit files, explore complex projects, use the browser, and execute terminal commands (with your permission, of course). I can even use MCP to create new tools and extend my own capabilities.",
44
"notice": "To get started, this extension needs an API provider.",
55
"start": "Let's go!",
6+
"chooseProvider": "Choose an API provider to get started:",
7+
"requestyDescription": "Your optimized LLM router",
8+
"openRouterDescription": "A unified interface for LLMs",
9+
"startRouter": "Express setup through a Router",
10+
"startCustom": "Bring your own API key",
611
"telemetry": {
712
"title": "Help Improve Roo Code",
813
"anonymousTelemetry": "Send anonymous error and usage data to help us fix bugs and improve the extension. No code, prompts, or personal information is ever sent.",

0 commit comments

Comments
 (0)