Browse Source

Merge pull request #944 from RooVetGit/hide_advanced_openrouter_config_in_welcome_view

Hide advanced openrouter config in the welcome view
Matt Rubens 11 months ago
parent
commit
351d461a04

+ 5 - 0
.changeset/polite-lizards-rhyme.md

@@ -0,0 +1,5 @@
+---
+"roo-cline": patch
+---
+
+Hide advanced openrouter config in the welcome view

+ 38 - 41
webview-ui/src/components/settings/ApiOptions.tsx

@@ -355,30 +355,6 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
 							</VSCodeButtonLink>
 						</p>
 					)}
-					<Checkbox
-						checked={openRouterBaseUrlSelected}
-						onChange={(checked: boolean) => {
-							setOpenRouterBaseUrlSelected(checked)
-							if (!checked) {
-								handleInputChange("openRouterBaseUrl")({
-									target: {
-										value: "",
-									},
-								})
-							}
-						}}>
-						Use custom base URL
-					</Checkbox>
-
-					{openRouterBaseUrlSelected && (
-						<VSCodeTextField
-							value={apiConfiguration?.openRouterBaseUrl || ""}
-							style={{ width: "100%", marginTop: 3 }}
-							type="url"
-							onBlur={handleInputChange("openRouterBaseUrl")}
-							placeholder="Default: https://openrouter.ai/api/v1"
-						/>
-					)}
 					<p
 						style={{
 							fontSize: "12px",
@@ -386,24 +362,45 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage, fromWelcomeView }: A
 							color: "var(--vscode-descriptionForeground)",
 						}}>
 						This key is stored locally and only used to make API requests from this extension.{" "}
-						{/* {!apiConfiguration?.openRouterApiKey && (
-							<span style={{ color: "var(--vscode-charts-green)" }}>
-								(<span style={{ fontWeight: 500 }}>Note:</span> OpenRouter is recommended for high rate
-								limits, prompt caching, and wider selection of models.)
-							</span>
-						)} */}
 					</p>
-					<Checkbox
-						checked={apiConfiguration?.openRouterUseMiddleOutTransform || false}
-						onChange={(checked: boolean) => {
-							handleInputChange("openRouterUseMiddleOutTransform")({
-								target: { value: checked },
-							})
-						}}>
-						Compress prompts and message chains to the context size (
-						<a href="https://openrouter.ai/docs/transforms">OpenRouter Transforms</a>)
-					</Checkbox>
-					<br />
+					{!fromWelcomeView && (
+						<>
+							<Checkbox
+								checked={openRouterBaseUrlSelected}
+								onChange={(checked: boolean) => {
+									setOpenRouterBaseUrlSelected(checked)
+									if (!checked) {
+										handleInputChange("openRouterBaseUrl")({
+											target: {
+												value: "",
+											},
+										})
+									}
+								}}>
+								Use custom base URL
+							</Checkbox>
+
+							{openRouterBaseUrlSelected && (
+								<VSCodeTextField
+									value={apiConfiguration?.openRouterBaseUrl || ""}
+									style={{ width: "100%", marginTop: 3 }}
+									type="url"
+									onBlur={handleInputChange("openRouterBaseUrl")}
+									placeholder="Default: https://openrouter.ai/api/v1"
+								/>
+							)}
+							<Checkbox
+								checked={apiConfiguration?.openRouterUseMiddleOutTransform || false}
+								onChange={(checked: boolean) => {
+									handleInputChange("openRouterUseMiddleOutTransform")({
+										target: { value: checked },
+									})
+								}}>
+								Compress prompts and message chains to the context size (
+								<a href="https://openrouter.ai/docs/transforms">OpenRouter Transforms</a>)
+							</Checkbox>
+						</>
+					)}
 				</div>
 			)}
 

+ 20 - 17
webview-ui/src/components/welcome/WelcomeView.tsx

@@ -21,23 +21,26 @@ const WelcomeView = () => {
 	}
 
 	return (
-		<div style={{ position: "fixed", top: 0, left: 0, right: 0, bottom: 0, padding: "0 20px" }}>
-			<h2>Hi, I'm Roo!</h2>
-			<p>
-				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.
-			</p>
-
-			<b>To get started, this extension needs an API provider.</b>
-
-			<div style={{ marginTop: "10px" }}>
-				<ApiOptions fromWelcomeView />
-				<div style={{ display: "flex", flexDirection: "column", gap: "5px" }}>
-					<VSCodeButton onClick={handleSubmit} style={{ marginTop: "3px" }}>
-						Let's go!
-					</VSCodeButton>
+		<div className="flex flex-col min-h-screen px-0 pb-5">
+			<div className="flex-grow">
+				<h2>Hi, I'm Roo!</h2>
+				<p>
+					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.
+				</p>
+
+				<b>To get started, this extension needs an API provider.</b>
+
+				<div className="mt-3">
+					<ApiOptions fromWelcomeView />
+				</div>
+			</div>
+
+			<div className="sticky bottom-0 bg-[var(--vscode-editor-background)] py-3">
+				<div className="flex flex-col gap-1.5">
+					<VSCodeButton onClick={handleSubmit}>Let's go!</VSCodeButton>
 					{errorMessage && <span className="text-destructive">{errorMessage}</span>}
 				</div>
 			</div>

+ 5 - 0
webview-ui/src/index.css

@@ -319,6 +319,11 @@ vscode-dropdown::part(listbox) {
 	max-height: unset !important;
 }
 
+.vscrui-checkbox svg {
+	min-width: 16px;
+	min-height: 16px;
+}
+
 /**
  * @shadcn/ui Overrides / Hacks
  */