Skip to content

Commit 76f6356

Browse files
fix(web): custom text generator endpoints show a monogram with an OpenAI mark
A custom OpenAI-compatible endpoint has no brand, and a server glyph read as an environment. Show its name's monogram in a tile with a small OpenAI mark for the protocol instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 565514f commit 76f6356

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

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

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ServerIcon } from "lucide-react";
21
import { type CSSProperties, memo } from "react";
32

43
import {
@@ -36,7 +35,6 @@ const PROVIDER_ICON_BY_PROVIDER: Partial<Record<ProviderDriverKind, Icon>> = {
3635
[ProviderDriverKind.make("anthropic")]: AnthropicIcon,
3736
[ProviderDriverKind.make("openrouter")]: OpenRouterIcon,
3837
[ProviderDriverKind.make("ollama")]: OllamaIcon,
39-
[ProviderDriverKind.make("openaiCompatible")]: ServerIcon,
4038
};
4139

4240
const PROVIDER_TEXT_COLOR_BY_PROVIDER: Partial<Record<ProviderDriverKind, string>> = {
@@ -103,6 +101,8 @@ export const ProviderInstanceIcon = memo(function ProviderInstanceIcon(props: {
103101
const badgeContent = props.badgeContent ?? "initials";
104102
const iconClassName = cn(props.size === "compact" && "size-3.5", props.iconClassName);
105103
const isAcpRegistry = props.driverKind === "acpRegistry";
104+
// A custom OpenAI-compatible endpoint has no brand: show its name, marked with the protocol.
105+
const isCustomEndpoint = props.driverKind === "openaiCompatible";
106106
const acpRegistryIconUrl = resolveProviderInstanceAcpRegistryIconUrl({
107107
driverKind: props.driverKind,
108108
agentId: props.acpRegistryAgentId,
@@ -124,6 +124,16 @@ export const ProviderInstanceIcon = memo(function ProviderInstanceIcon(props: {
124124
fallbackClassName="size-full"
125125
icon={acpRegistryIconUrl}
126126
/>
127+
) : isCustomEndpoint ? (
128+
<span
129+
className={cn(
130+
"flex size-5 shrink-0 items-center justify-center rounded-md border bg-card text-4xs font-semibold leading-none text-foreground",
131+
iconClassName,
132+
)}
133+
aria-hidden
134+
>
135+
{providerInstanceInitials(props.displayName)}
136+
</span>
127137
) : packageIcon ? (
128138
<ProviderPackageIcon
129139
icon={packageIcon}
@@ -137,7 +147,18 @@ export const ProviderInstanceIcon = memo(function ProviderInstanceIcon(props: {
137147
{providerInstanceInitials(props.displayName)}
138148
</span>
139149
)}
140-
{props.showBadge ? (
150+
{isCustomEndpoint ? (
151+
<span
152+
className={cn(
153+
"pointer-events-none absolute right-[-0.1875rem] bottom-[-0.1875rem] z-10 flex size-3 items-center justify-center rounded-full border bg-card text-foreground shadow-sm",
154+
props.badgeClassName,
155+
)}
156+
style={{ borderColor: indicatorBackground }}
157+
aria-hidden
158+
>
159+
<OpenAI className="size-2" />
160+
</span>
161+
) : props.showBadge ? (
141162
<span
142163
className={cn(
143164
"pointer-events-none absolute right-0 bottom-0 z-10 flex h-3.5 min-w-3.5 items-center justify-center rounded-full border px-0.5 text-4xs font-semibold leading-none shadow-sm",

0 commit comments

Comments
 (0)