Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/providers-tab-show-more.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Make "Show more providers" a prominent entry in the Popular providers list and collapse Disabled Providers by default in the Providers settings.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
209 changes: 128 additions & 81 deletions packages/kilo-vscode/webview-ui/src/components/settings/ProvidersTab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Button } from "@kilocode/kilo-ui/button"
import { Card } from "@kilocode/kilo-ui/card"
import { Collapsible } from "@kilocode/kilo-ui/collapsible"
import { useDialog } from "@kilocode/kilo-ui/context/dialog"
import { Icon } from "@kilocode/kilo-ui/icon"
import { ProviderIcon } from "@kilocode/kilo-ui/provider-icon"
import { Select } from "@kilocode/kilo-ui/select"
import { Tag } from "@kilocode/kilo-ui/tag"
Expand Down Expand Up @@ -350,6 +352,7 @@ const ProvidersTab: Component = () => {
gap: "16px",
"min-height": "56px",
padding: "12px 0",
"border-bottom": "1px solid var(--border-weak-base)",
}}
>
<div style={{ display: "flex", "flex-direction": "column", "min-width": 0 }}>
Expand Down Expand Up @@ -385,100 +388,144 @@ const ProvidersTab: Component = () => {
{language.t("common.connect")}
</Button>
</div>
</Card>

{/* View all providers link */}
<div style={{ "margin-top": "16px" }}>
<Button variant="ghost" onClick={() => dialog.show(() => <ProviderSelectDialog />)} style={{ padding: "0" }}>
{language.t("dialog.provider.viewAll")}
</Button>
</div>

{/* Disabled providers */}
<h4 style={{ "margin-top": "24px", "margin-bottom": "8px" }}>{language.t("settings.providers.disabled")}</h4>
<Card>
<div
style={{
"font-size": "var(--kilo-font-size-12)",
color: "var(--text-weak-base, var(--vscode-descriptionForeground))",
"padding-bottom": "8px",
"border-bottom": "1px solid var(--border-weak-base)",
}}
>
{language.t("settings.providers.disabled.description")}
</div>
<div
{/* Show more providers — prominent entry point to the full catalog */}
<button
Comment thread
chrarnoldus marked this conversation as resolved.
Resolved
type="button"
onClick={() => dialog.show(() => <ProviderSelectDialog />)}
style={{
display: "flex",
gap: "8px",
"align-items": "center",
padding: "8px 0",
"border-bottom": disabledProviders().length > 0 ? "1px solid var(--border-weak-base)" : "none",
"justify-content": "space-between",
gap: "16px",
width: "100%",
"min-height": "56px",
padding: "12px 0",
background: "none",
border: "none",
cursor: "pointer",
"text-align": "left",
color: "var(--vscode-foreground)",
font: "inherit",
}}
>
<div style={{ flex: 1 }}>
<Select
options={disabledOptions()}
current={disabled()}
value={(item) => item.value}
label={(item) => item.label}
onSelect={(item) => setDisabled(item)}
variant="secondary"
triggerVariant="settings"
placeholder={language.t("settings.providers.select.placeholder")}
/>
<div style={{ display: "flex", "align-items": "center", gap: "12px", "min-width": 0 }}>
<Icon name="providers" size="small" />
<span
style={{
"font-size": "var(--kilo-font-size-14)",
"font-weight": "500",
}}
>
{language.t("dialog.provider.viewAll")}
</span>
</div>
<Button
variant="secondary"
onClick={() => {
const item = disabled()
if (!item) return
disableProvider(item.value)
setDisabled(undefined)
}}
disabled={!disabled()}
>
{language.t("common.add")}
</Button>
</div>
<For each={disabledProviders()}>
{(id, index) => (
<div
<Icon name="chevron-right" size="small" />
</button>
</Card>

{/* Disabled providers — collapsed by default to keep the focus on active providers */}
<div style={{ "margin-top": "24px" }}>
<Collapsible variant="ghost">
Comment thread
chrarnoldus marked this conversation as resolved.
Resolved
<Collapsible.Trigger>
<span
style={{
display: "flex",
"flex-wrap": "wrap",
"align-items": "center",
"justify-content": "space-between",
gap: "16px",
"min-height": "56px",
padding: "12px 0",
"border-bottom":
index() < disabledProviders().length - 1 ? "1px solid var(--border-weak-base)" : "none",
"font-size": "var(--kilo-font-size-12)",
"font-weight": "500",
color: "var(--text-weak-base, var(--vscode-descriptionForeground))",
}}
>
<div style={{ display: "flex", "align-items": "center", gap: "12px", "min-width": 0 }}>
<ProviderIcon id={providerIcon(id)} width={20} height={20} />
<span
style={{
"font-size": "var(--kilo-font-size-14)",
"font-weight": "500",
color: "var(--vscode-foreground)",
overflow: "hidden",
"text-overflow": "ellipsis",
"white-space": "nowrap",
{language.t("settings.providers.disabled")}
</span>
<Collapsible.Arrow />
</Collapsible.Trigger>
<Collapsible.Content>
<Card style={{ "margin-top": "8px" }}>
<div
style={{
"font-size": "var(--kilo-font-size-12)",
color: "var(--text-weak-base, var(--vscode-descriptionForeground))",
"padding-bottom": "8px",
"border-bottom": "1px solid var(--border-weak-base)",
}}
>
{language.t("settings.providers.disabled.description")}
</div>
<div
style={{
display: "flex",
gap: "8px",
"align-items": "center",
padding: "8px 0",
"border-bottom": disabledProviders().length > 0 ? "1px solid var(--border-weak-base)" : "none",
}}
>
<div style={{ flex: 1 }}>
<Select
options={disabledOptions()}
current={disabled()}
value={(item) => item.value}
label={(item) => item.label}
onSelect={(item) => setDisabled(item)}
variant="secondary"
triggerVariant="settings"
placeholder={language.t("settings.providers.select.placeholder")}
/>
</div>
<Button
variant="secondary"
onClick={() => {
const item = disabled()
if (!item) return
disableProvider(item.value)
setDisabled(undefined)
}}
disabled={!disabled()}
>
{disabledName(id)}
</span>
<Tag>{language.t("settings.providers.disabled")}</Tag>
{language.t("common.add")}
</Button>
</div>
<Button size="large" variant="ghost" onClick={() => enableProvider(index())}>
{language.t("settings.providers.disabled.enable")}
</Button>
</div>
)}
</For>
</Card>
<For each={disabledProviders()}>
{(id, index) => (
<div
style={{
display: "flex",
"flex-wrap": "wrap",
"align-items": "center",
"justify-content": "space-between",
gap: "16px",
"min-height": "56px",
padding: "12px 0",
"border-bottom":
index() < disabledProviders().length - 1 ? "1px solid var(--border-weak-base)" : "none",
}}
>
<div style={{ display: "flex", "align-items": "center", gap: "12px", "min-width": 0 }}>
<ProviderIcon id={providerIcon(id)} width={20} height={20} />
<span
style={{
"font-size": "var(--kilo-font-size-14)",
"font-weight": "500",
color: "var(--vscode-foreground)",
overflow: "hidden",
"text-overflow": "ellipsis",
"white-space": "nowrap",
}}
>
{disabledName(id)}
</span>
<Tag>{language.t("settings.providers.disabled")}</Tag>
</div>
<Button size="large" variant="ghost" onClick={() => enableProvider(index())}>
{language.t("settings.providers.disabled.enable")}
</Button>
</div>
)}
</For>
</Card>
</Collapsible.Content>
</Collapsible>
</div>
</div>
)
}
Expand Down
Loading