feat: add model dropdown with provider logos and tier badges

- Create model catalog (src/shared/domain/models.ts) with 12 models
  from OpenAI, Anthropic, and Google including tier metadata
- Replace free-text model input with custom ModelSelect dropdown
  grouped by provider with colored provider icons (green AI for
  OpenAI, orange A for Anthropic, blue G for Google)
- Show tier badges (premium/standard/fast) on each model option
- Highlight currently selected model with indigo accent
- Update ActivityPanel to show provider icons on model badges
  for visual consistency across the app

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-21 20:05:54 +01:00
co-authored by Copilot
parent 018100a9a8
commit baea491cf2
3 changed files with 177 additions and 6 deletions
+20 -2
View File
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { Activity, Bot, Cpu, Sparkles } from 'lucide-react';
import { Activity, Bot, Sparkles } from 'lucide-react';
import {
buildAgentActivityRows,
@@ -8,9 +8,16 @@ import {
isAgentActivityCompleted,
type SessionActivityState,
} from '@renderer/lib/sessionActivity';
import { inferProvider, type ModelProvider } from '@shared/domain/models';
import type { PatternDefinition } from '@shared/domain/pattern';
import type { SessionRecord } from '@shared/domain/session';
const providerStyles: Record<ModelProvider, { bg: string; text: string; label: string }> = {
openai: { bg: 'bg-emerald-500/15', text: 'text-emerald-400', label: 'AI' },
anthropic: { bg: 'bg-orange-500/15', text: 'text-orange-400', label: 'A' },
google: { bg: 'bg-blue-500/15', text: 'text-blue-400', label: 'G' },
};
function formatModel(model: string): string {
return model.replace(/-/g, '\u2011');
}
@@ -92,7 +99,18 @@ export function ActivityPanel({ activity, pattern, session }: ActivityPanelProps
{agent && (
<div className="mt-1.5 flex flex-wrap items-center gap-1.5">
<span className="inline-flex items-center gap-1 rounded bg-zinc-800 px-1.5 py-0.5 text-[10px] font-medium text-zinc-400">
<Cpu className="size-2.5" />
{(() => {
const prov = inferProvider(agent.model);
if (prov) {
const s = providerStyles[prov];
return (
<span className={`flex size-3.5 items-center justify-center rounded text-[7px] font-bold ${s.bg} ${s.text}`}>
{s.label}
</span>
);
}
return null;
})()}
{formatModel(agent.model)}
</span>
{agent.reasoningEffort && (