From ffdc0019fcfe4b626e1ed94a717c1a14ec33d878 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Thu, 16 Apr 2026 18:03:51 +0800 Subject: [PATCH] fix(ui): replace Codex icon to remove opaque white background The upstream Codex.Color icon from @lobehub/icons renders an SVG with a white background rectangle, which appears as a white square on dark backgrounds. Replace it with a custom CodexColorIcon that renders only the logo path with its original gradient fill, and adjust the viewBox to better fit the content area. --- src/components/agent-icon.tsx | 45 +++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/src/components/agent-icon.tsx b/src/components/agent-icon.tsx index efe271d..e12851e 100644 --- a/src/components/agent-icon.tsx +++ b/src/components/agent-icon.tsx @@ -1,3 +1,5 @@ +import { memo, useId } from "react" + import type { AgentType } from "@/lib/types" import { AGENT_COLORS } from "@/lib/types" import { cn } from "@/lib/utils" @@ -5,7 +7,6 @@ import { cn } from "@/lib/utils" import { ClaudeCode, Cline, - Codex, GeminiCLI, OpenClaw, OpenCode, @@ -16,12 +17,52 @@ interface AgentIconProps { className?: string } +// Codex.Color has a white background rect that shows as a white square on +// dark backgrounds. This component renders only the logo path with its +// gradient, without the opaque background. +const CodexColorIcon = memo(function CodexColorIcon({ + size = "1em", +}: { + size?: string | number +}) { + const id = useId() + return ( + + Codex + + + + + + + + + + ) +}) + // eslint-disable-next-line @typescript-eslint/no-explicit-any type AnyIcon = React.ComponentType const COLOR_ICONS: Partial> = { claude_code: ClaudeCode.Color, - codex: Codex.Color, + codex: CodexColorIcon, gemini: GeminiCLI.Color, open_claw: OpenClaw.Color, }