Skip to content

Commit 2c47987

Browse files
fix(web): manage text generators under Providers, with real icons
Text generators were added from Settings → Threads, far from where people configure other model connections, and the picker showed their initials. They now get their own section on Settings → Providers next to Usage providers (hidden under a provider allow-list, which turns them off), and the picker shows the Claude mark for Anthropic and a neutral glyph for OpenAI-compatible endpoints instead of initials. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c1316b9 commit 2c47987

6 files changed

Lines changed: 88 additions & 71 deletions

File tree

‎apps/web/src/components/chat/ProviderInstanceIcon.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { SparklesIcon } from "lucide-react";
12
import { type CSSProperties, memo } from "react";
23

34
import {
@@ -22,12 +23,16 @@ const PROVIDER_ICON_BY_PROVIDER: Partial<Record<ProviderDriverKind, Icon>> = {
2223
[ProviderDriverKind.make("codex")]: OpenAI,
2324
[ProviderDriverKind.make("claudeAgent")]: ClaudeAI,
2425
[ProviderDriverKind.make("antigravity")]: AntigravityIcon,
26+
// Text generator kinds: the compatible kind also serves OpenRouter and local servers, so no brand.
27+
[ProviderDriverKind.make("anthropic")]: ClaudeAI,
28+
[ProviderDriverKind.make("openaiCompatible")]: SparklesIcon,
2529
};
2630

2731
const PROVIDER_TEXT_COLOR_BY_PROVIDER: Partial<Record<ProviderDriverKind, string>> = {
2832
[ProviderDriverKind.make("codex")]: "text-black dark:text-white",
2933
[ProviderDriverKind.make("claudeAgent")]: "text-[#d97757]",
3034
[ProviderDriverKind.make("antigravity")]: "text-[#5b87bf]",
35+
[ProviderDriverKind.make("anthropic")]: "text-[#d97757]",
3136
};
3237

3338
export function providerTextColor(driverKind: ProviderDriverKind): {

‎apps/web/src/components/settings/ProviderSettingsPanel.tsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ import { ExpandableText } from "./ExpandableText";
9696
import { IntervalSecondsField } from "./IntervalSecondsField";
9797
import { ProviderInstanceCard } from "./ProviderInstanceCard";
9898
import { useSecretSources } from "./SecretSourceInput";
99+
import { TextGeneratorsSettings } from "./TextGeneratorsSettings";
99100
import { UsageProviderSettings } from "./UsageProviderSettings";
100101
import { ProviderSetupSection, readAntigravityAuthMethod } from "./ProviderSetupSection";
101102
import { ProviderAuthenticationSection } from "./ProviderAuthenticationSection";
@@ -1092,6 +1093,17 @@ export function EnvironmentProviderSettings({
10921093
readOnly={readOnly}
10931094
/>
10941095

1096+
{/* The server drops text generators under a provider allow-list. */}
1097+
{managedPolicy?.limits?.providers?.allowedDrivers === undefined ? (
1098+
<TextGeneratorsSettings
1099+
key={`text-generators:${environmentId}`}
1100+
environmentId={environmentId}
1101+
environmentLabel={environmentLabel}
1102+
providers={serverProviders}
1103+
readOnly={readOnly}
1104+
/>
1105+
) : null}
1106+
10951107
<SettingsSection title="Advanced">
10961108
<SettingsRow
10971109
id={searchableSetting("provider-health-check-interval").id}

‎apps/web/src/components/settings/SettingsPanels.tsx‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ import {
6969
selectsPlanAgent,
7070
} from "../../modelSelection";
7171
import { useTextGenerationTargets } from "../../textGenerators";
72-
import { TextGeneratorsSettings } from "./TextGeneratorsSettings";
7372
import { ensureLocalApi, readLocalApi } from "../../localApi";
7473
import { isMacPlatform } from "../../lib/utils";
7574
import { useEnvironmentProviders, useEnvironments } from "../../state/environments";
@@ -1764,7 +1763,7 @@ export function ThreadsSettingsPanel() {
17641763
serverScoped
17651764
settingKeys={["textGenerationModelSelection"]}
17661765
{...searchableSetting("text-generation-model")}
1767-
description="Used for thread titles and other generated text on connected devices with this provider. Source control can override it."
1766+
description="Used for thread titles and other generated text on connected devices with this provider. Source control can override it. Add a model API as a text generator in Providers."
17681767
resetAction={
17691768
hasServerTargets && isTextGenerationModelDirty ? (
17701769
<SettingResetButton
@@ -1862,14 +1861,6 @@ export function ThreadsSettingsPanel() {
18621861
)
18631862
}
18641863
/>
1865-
{!isProjectScope && environment ? (
1866-
<TextGeneratorsSettings
1867-
key={environment.environmentId}
1868-
environmentId={environment.environmentId}
1869-
environmentLabel={environment.label}
1870-
providers={serverProviders}
1871-
/>
1872-
) : null}
18731864
<AdvancedSettings
18741865
targetIds={[
18751866
searchableSetting("thread-title-instructions").id,

‎apps/web/src/components/settings/TextGeneratorsSettings.tsx‎

Lines changed: 60 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../
4444
import { Switch } from "../ui/switch";
4545
import { SecretSourceInput, useSecretSources } from "./SecretSourceInput";
4646
import { searchableSetting } from "./settingsSearch";
47-
import { SettingsRow } from "./settingsLayout";
47+
import { SettingsRow, SettingsSection } from "./settingsLayout";
4848

4949
const decodeTextGenerator = Schema.decodeUnknownOption(TextGeneratorConfig);
5050

@@ -60,10 +60,12 @@ export function TextGeneratorsSettings({
6060
environmentId,
6161
environmentLabel,
6262
providers,
63+
readOnly,
6364
}: {
6465
readonly environmentId: EnvironmentId;
6566
readonly environmentLabel: string;
6667
readonly providers: ReadonlyArray<ServerProvider>;
68+
readonly readOnly: boolean;
6769
}) {
6870
const settings = useEnvironmentSettings(environmentId);
6971
const updateSettings = useUpdateEnvironmentSettings(environmentId);
@@ -76,58 +78,67 @@ export function TextGeneratorsSettings({
7678

7779
return (
7880
<>
79-
<SettingsRow
80-
serverScoped
81+
<SettingsSection
8182
{...searchableSetting("text-generators")}
82-
description="Model APIs that can write titles, commit messages, and other text, but can't run agents."
83-
control={
84-
<Button size="xs" variant="outline" onClick={() => setEditing("new")}>
85-
<PlusIcon className="size-3" aria-hidden />
86-
Add
87-
</Button>
83+
headerAction={
84+
!readOnly ? (
85+
<Button size="xs" variant="outline" onClick={() => setEditing("new")}>
86+
<PlusIcon className="size-3" aria-hidden />
87+
Add API
88+
</Button>
89+
) : null
8890
}
89-
/>
90-
{generators.map(([id, config]) => {
91-
const name = textGeneratorDisplayName(config);
92-
return (
91+
>
92+
{generators.length === 0 ? (
9393
<SettingsRow
94-
key={id}
95-
serverScoped
96-
title={name}
97-
description={
98-
<span className="break-all">
99-
{KIND_LABELS[config.kind]} · {config.baseUrl}
100-
</span>
101-
}
102-
control={
103-
<div className="flex items-center gap-1.5">
104-
<Button
105-
size="icon-xs"
106-
variant="ghost"
107-
aria-label={`Refresh ${name} models`}
108-
disabled={!config.enabled}
109-
onClick={() => refreshTextGeneratorModels(environmentId, id)}
110-
>
111-
<RefreshCwIcon aria-hidden />
112-
</Button>
113-
<Button size="xs" variant="ghost" onClick={() => setEditing({ id, config })}>
114-
Edit
115-
</Button>
116-
<Button size="xs" variant="ghost" onClick={() => setRemoving(id)}>
117-
Remove
118-
</Button>
119-
<Switch
120-
checked={config.enabled}
121-
onCheckedChange={(enabled) =>
122-
updateSettings({ textGenerators: { [id]: { ...config, enabled } } })
123-
}
124-
aria-label={`Enable ${name}`}
125-
/>
126-
</div>
127-
}
94+
title="No text generators configured."
95+
description="Model APIs that write titles, commit messages, and other text, but can't run agents."
12896
/>
129-
);
130-
})}
97+
) : null}
98+
{generators.map(([id, config]) => {
99+
const name = textGeneratorDisplayName(config);
100+
return (
101+
<SettingsRow
102+
key={id}
103+
title={name}
104+
description={
105+
<span className="break-all">
106+
{KIND_LABELS[config.kind]}
107+
{config.enabled ? "" : " · Disabled"} · {config.baseUrl}
108+
</span>
109+
}
110+
control={
111+
readOnly ? null : (
112+
<div className="flex items-center gap-1.5">
113+
<Button
114+
size="icon-xs"
115+
variant="ghost"
116+
aria-label={`Refresh ${name} models`}
117+
disabled={!config.enabled}
118+
onClick={() => refreshTextGeneratorModels(environmentId, id)}
119+
>
120+
<RefreshCwIcon aria-hidden />
121+
</Button>
122+
<Button size="xs" variant="ghost" onClick={() => setEditing({ id, config })}>
123+
Edit
124+
</Button>
125+
<Button size="xs" variant="ghost" onClick={() => setRemoving(id)}>
126+
Remove
127+
</Button>
128+
<Switch
129+
checked={config.enabled}
130+
onCheckedChange={(enabled) =>
131+
updateSettings({ textGenerators: { [id]: { ...config, enabled } } })
132+
}
133+
aria-label={`Enable ${name}`}
134+
/>
135+
</div>
136+
)
137+
}
138+
/>
139+
);
140+
})}
141+
</SettingsSection>
131142
{editing !== null ? (
132143
<TextGeneratorDialog
133144
environmentId={environmentId}

‎apps/web/src/components/settings/settingsSearch.ts‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -811,16 +811,6 @@ export const SETTINGS_SEARCH_ITEMS = [
811811
scope: "project-defaults",
812812
searchTerms: ["generated thread titles source control content default provider"],
813813
},
814-
{
815-
id: "text-generators",
816-
title: "Text generators",
817-
to: "/settings/threads",
818-
scope: "environment-defaults",
819-
searchTerms: [
820-
"model api key openai openrouter anthropic ollama lm studio openai-compatible base url add remove refresh models",
821-
],
822-
environmentOnly: true,
823-
},
824814
{
825815
id: "thread-title-instructions",
826816
title: "Thread title instructions",
@@ -954,6 +944,15 @@ export const SETTINGS_SEARCH_ITEMS = [
954944
],
955945
providerSettingsOnly: true,
956946
},
947+
{
948+
id: "text-generators",
949+
title: "Text generators",
950+
to: "/settings/providers",
951+
searchTerms: [
952+
"model api key openai openrouter anthropic ollama lm studio openai-compatible base url text generation titles commit messages add remove refresh models",
953+
],
954+
providerSettingsOnly: true,
955+
},
957956
{
958957
id: "provider-health-check-interval",
959958
title: "Health check interval",

‎docs/user/text-generation.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ that only writes text. It is usually faster and costs fewer tokens.
1111

1212
## Add a text generator
1313

14-
In **Settings → Threads → Text generation**, choose **Add** next to **Text generators** and pick a
15-
service:
14+
In **Settings → Providers**, choose **Add API** next to **Text generators** and pick a service:
1615

1716
- **OpenAI** or **Anthropic**, with an API key.
1817
- **OpenRouter**, with an OpenRouter key, to use any model it serves.

0 commit comments

Comments
 (0)