Skip to content

Commit a981ec7

Browse files
better ux around cline provider model selection (RooCodeInc#2694)
* better ux around cline provider model selection * changeset * small styling + naming * Modify recommended models * Fixes --------- Co-authored-by: Saoud Rizwan <[email protected]>
1 parent d8cdd98 commit a981ec7

File tree

4 files changed

+113
-3
lines changed

4 files changed

+113
-3
lines changed

.changeset/grumpy-eyes-refuse.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": minor
3+
---
4+
5+
recommended models ux for cline provider

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import React from "react"
2+
import styled from "styled-components"
3+
4+
export interface FeaturedModelCardProps {
5+
modelId: string
6+
description: string
7+
onClick: () => void
8+
isSelected: boolean
9+
label: string
10+
}
11+
12+
const CardContainer = styled.div<{ isSelected: boolean }>`
13+
padding: 2px 4px;
14+
margin-bottom: 2px;
15+
border-radius: 3px;
16+
border: 1px solid var(--vscode-textLink-foreground);
17+
opacity: ${(props) => (props.isSelected ? 1 : 0.6)};
18+
cursor: pointer;
19+
20+
&:hover {
21+
background-color: var(--vscode-list-hoverBackground);
22+
opacity: 1;
23+
}
24+
`
25+
26+
const ModelHeader = styled.div`
27+
display: flex;
28+
align-items: center;
29+
justify-content: space-between;
30+
`
31+
32+
const ModelName = styled.div`
33+
font-weight: 500;
34+
font-size: 12px;
35+
line-height: 1.2;
36+
`
37+
38+
const Label = styled.span`
39+
font-size: 10px;
40+
color: var(--vscode-textLink-foreground);
41+
text-transform: uppercase;
42+
letter-spacing: 0.5px;
43+
font-weight: 500;
44+
`
45+
46+
const Description = styled.div`
47+
margin-top: 0px;
48+
font-size: 11px;
49+
color: var(--vscode-descriptionForeground);
50+
line-height: 1.2;
51+
`
52+
53+
const FeaturedModelCard: React.FC<FeaturedModelCardProps> = ({ modelId, description, onClick, isSelected, label }) => {
54+
return (
55+
<CardContainer isSelected={isSelected} onClick={onClick}>
56+
<ModelHeader>
57+
<ModelName>{modelId}</ModelName>
58+
<Label>{label}</Label>
59+
</ModelHeader>
60+
<Description>{description}</Description>
61+
</CardContainer>
62+
)
63+
}
64+
65+
export default FeaturedModelCard

webview-ui/src/components/settings/OpenRouterModelPicker.tsx

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,31 @@ import { highlight } from "../history/HistoryView"
1111
import { ModelInfoView, normalizeApiConfiguration } from "./ApiOptions"
1212
import { CODE_BLOCK_BG_COLOR } from "@/components/common/CodeBlock"
1313
import ThinkingBudgetSlider from "./ThinkingBudgetSlider"
14+
import FeaturedModelCard from "./FeaturedModelCard"
1415

1516
export interface OpenRouterModelPickerProps {
1617
isPopup?: boolean
1718
}
1819

20+
// Featured models for Cline provider
21+
const featuredModels = [
22+
{
23+
id: "anthropic/claude-3.7-sonnet",
24+
description: "Leading model for agentic coding",
25+
label: "Best",
26+
},
27+
{
28+
id: "google/gemini-2.5-pro-preview-03-25",
29+
description: "Large 1M context window, great value",
30+
label: "Trending",
31+
},
32+
{
33+
id: "meta-llama/llama-4-maverick",
34+
description: "Efficient performance at lower cost",
35+
label: "New",
36+
},
37+
]
38+
1939
const OpenRouterModelPicker: React.FC<OpenRouterModelPickerProps> = ({ isPopup }) => {
2040
const { apiConfiguration, setApiConfiguration, openRouterModels } = useExtensionState()
2141
const [searchTerm, setSearchTerm] = useState(apiConfiguration?.openRouterModelId || openRouterDefaultModelId)
@@ -147,7 +167,8 @@ const OpenRouterModelPicker: React.FC<OpenRouterModelPickerProps> = ({ isPopup }
147167
const showBudgetSlider = useMemo(() => {
148168
return (
149169
selectedModelId?.toLowerCase().includes("claude-3-7-sonnet") ||
150-
selectedModelId?.toLowerCase().includes("claude-3.7-sonnet")
170+
selectedModelId?.toLowerCase().includes("claude-3.7-sonnet") ||
171+
selectedModelId?.toLowerCase().includes("claude-3.7-sonnet:thinking")
151172
)
152173
}, [selectedModelId])
153174

@@ -165,6 +186,25 @@ const OpenRouterModelPicker: React.FC<OpenRouterModelPickerProps> = ({ isPopup }
165186
<label htmlFor="model-search">
166187
<span style={{ fontWeight: 500 }}>Model</span>
167188
</label>
189+
190+
{apiConfiguration?.apiProvider === "cline" && (
191+
<div style={{ marginBottom: "6px", marginTop: 4 }}>
192+
{featuredModels.map((model) => (
193+
<FeaturedModelCard
194+
key={model.id}
195+
modelId={model.id}
196+
description={model.description}
197+
label={model.label}
198+
isSelected={selectedModelId === model.id}
199+
onClick={() => {
200+
handleModelChange(model.id)
201+
setIsDropdownVisible(false)
202+
}}
203+
/>
204+
))}
205+
</div>
206+
)}
207+
168208
<DropdownWrapper ref={dropdownRef}>
169209
<VSCodeTextField
170210
id="model-search"

0 commit comments

Comments
 (0)