Merge pull request #944 from RooVetGit/hide_advanced_openrouter_config_in_welcome_view

Hide advanced openrouter config in the welcome view
This commit is contained in:
Matt Rubens 2025-02-11 14:25:26 -05:00 committed by GitHub
commit 351d461a04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 56 deletions

View file

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

View file

@ -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>
)}

View file

@ -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>
<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>
<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="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>

View file

@ -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
*/