diff --git a/.github/pr-assets/pr-agent-flavor-icons-before.jpg b/.github/pr-assets/pr-agent-flavor-icons-before.jpg new file mode 100644 index 00000000..86f6e347 Binary files /dev/null and b/.github/pr-assets/pr-agent-flavor-icons-before.jpg differ diff --git a/.github/pr-assets/pr-agent-flavor-icons-claude.jpg b/.github/pr-assets/pr-agent-flavor-icons-claude.jpg new file mode 100644 index 00000000..9ddbd866 Binary files /dev/null and b/.github/pr-assets/pr-agent-flavor-icons-claude.jpg differ diff --git a/.github/pr-assets/pr-agent-flavor-icons-codex.jpg b/.github/pr-assets/pr-agent-flavor-icons-codex.jpg new file mode 100644 index 00000000..0e6b82cb Binary files /dev/null and b/.github/pr-assets/pr-agent-flavor-icons-codex.jpg differ diff --git a/web/src/components/AgentFlavorIcon.tsx b/web/src/components/AgentFlavorIcon.tsx new file mode 100644 index 00000000..b88f2518 --- /dev/null +++ b/web/src/components/AgentFlavorIcon.tsx @@ -0,0 +1,45 @@ +const FLAVOR_BADGES: Record = { + claude: { + label: 'Cl', + colors: 'bg-[#d97706] text-white', + }, + codex: { + label: 'Cx', + colors: 'bg-[#111827] text-white', + }, + cursor: { + label: 'Cu', + colors: 'bg-[#0f766e] text-white', + }, + gemini: { + label: 'Gm', + colors: 'bg-[#2563eb] text-white', + }, + kimi: { + label: 'Km', + colors: 'bg-[#7c3aed] text-white', + }, + opencode: { + label: 'Op', + colors: 'bg-[#15803d] text-white', + }, +} + +const UNKNOWN_FLAVOR_BADGE = { + label: 'Un', + colors: 'bg-[var(--app-secondary-bg)] text-[var(--app-hint)]', +} + +export function AgentFlavorIcon({ flavor, className }: { flavor?: string | null; className?: string }) { + const normalized = (flavor ?? '').trim().toLowerCase() + const badge = FLAVOR_BADGES[normalized] ?? UNKNOWN_FLAVOR_BADGE + + return ( + + ) +} diff --git a/web/src/components/SessionHeader.tsx b/web/src/components/SessionHeader.tsx index 046b11e3..67071d61 100644 --- a/web/src/components/SessionHeader.tsx +++ b/web/src/components/SessionHeader.tsx @@ -8,6 +8,7 @@ import { RenameSessionDialog } from '@/components/RenameSessionDialog' import { ConfirmDialog } from '@/components/ui/ConfirmDialog' import { getSessionModelLabel } from '@/lib/sessionModelLabel' import { useTranslation } from '@/lib/use-translation' +import { AgentFlavorIcon } from '@/components/AgentFlavorIcon' function getSessionTitle(session: Session): string { if (session.metadata?.name) { @@ -162,7 +163,7 @@ export function SessionHeader(props: {
- + {session.metadata?.flavor?.trim() || 'unknown'} {modelLabel ? ( diff --git a/web/src/components/SessionList.tsx b/web/src/components/SessionList.tsx index 2e77a545..ebf51a9d 100644 --- a/web/src/components/SessionList.tsx +++ b/web/src/components/SessionList.tsx @@ -11,6 +11,7 @@ import { CopyIcon, CheckIcon } from '@/components/icons' import { cn } from '@/lib/utils' import { useTranslation } from '@/lib/use-translation' import { DEFAULT_SESSION_PREVIEW_LIMIT, useSessionPreviewLimit } from '@/hooks/useSessionPreviewLimit' +import { AgentFlavorIcon } from '@/components/AgentFlavorIcon' type SessionGroup = { key: string @@ -481,45 +482,6 @@ function SessionListSearch(props: { ) } -const FLAVOR_BADGES: Record = { - claude: { - label: 'Cl', - colors: 'bg-[#d97706] text-white', - }, - codex: { - label: 'Cx', - colors: 'bg-[#111827] text-white', - }, - cursor: { - label: 'Cu', - colors: 'bg-[#0f766e] text-white', - }, - gemini: { - label: 'Gm', - colors: 'bg-[#2563eb] text-white', - }, - kimi: { - label: 'Km', - colors: 'bg-[#7c3aed] text-white', - }, - opencode: { - label: 'Op', - colors: 'bg-[#15803d] text-white', - }, -} - -function FlavorIcon({ flavor, className }: { flavor?: string | null; className?: string }) { - const badge = FLAVOR_BADGES[(flavor ?? 'claude').trim().toLowerCase()] ?? FLAVOR_BADGES.claude - return ( - - ) -} - function MachineIcon(props: { className?: string }) { return (
- +
{sessionName}