The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
chore(chat): remove agent and code views nothing renders (CA Z1)
purple6f726cc9a258
diff --git a/src/components/agents/AgentLog.tsx b/src/components/agents/AgentLog.tsxdeleted file mode 100644index bd0ca388..00000000--- a/src/components/agents/AgentLog.tsx+++ /dev/null@@ -1,101 +0,0 @@-import { useEffect, useRef } from 'react'-import { motion, AnimatePresence } from 'framer-motion'-import { ScrollText } from 'lucide-react'-import { ToolCallCard } from './ToolCallCard'-import type { AgentLogEntry } from '../../types/agents'-import { MOTION_S } from '../ui/motion'--// Fuenf Eintragsarten, fuenf Farben. Nur eine davon ist eine Aussage ueber den-// Zustand: `error` ist rot. Die anderen vier sortieren, sie bewerten nicht.-//-// `action` war gelb, und Gelb neben Rot liest sich wie „fast kaputt", dabei ist-// eine Aktion der Normalfall dieses Protokolls. Fuchsia, weil es sich von den-// vier Nachbarn am weitesten unterscheidet: Gedanke und Aktion wechseln sich-// hier im Sekundentakt ab, und genau die zwei muessen beim Scrollen ohne Lesen-// auseinanderfallen. Indigo und Fuchsia tun das, Indigo und Violett nicht.-const typeStyles: Record<AgentLogEntry['type'], { badge: string; bg: string; text: string }> = {- thought: { badge: 'bg-indigo-500/20 text-indigo-300', bg: 'border-l-indigo-500/40', text: 'text-indigo-200' },- action: { badge: 'bg-fuchsia-500/20 text-fuchsia-300', bg: 'border-l-fuchsia-500/40', text: 'text-fuchsia-200' },- observation: { badge: 'bg-green-500/20 text-green-300', bg: 'border-l-green-500/40', text: 'text-green-200' },- error: { badge: 'bg-red-500/20 text-red-300', bg: 'border-l-red-500/40', text: 'text-red-200' },- user_input: { badge: 'bg-blue-500/20 text-blue-300', bg: 'border-l-blue-500/40', text: 'text-blue-200' },-}--const typeLabels: Record<AgentLogEntry['type'], string> = {- thought: 'Thought',- action: 'Action',- observation: 'Result',- error: 'Error',- user_input: 'Goal',-}--function formatTimestamp(ts: number): string {- const d = new Date(ts)- return d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' })-}--interface Props {- entries: AgentLogEntry[]- onApprove?: (toolCallId: string) => void- onReject?: (toolCallId: string) => void-}--export function AgentLog({ entries, onApprove, onReject }: Props) {- const scrollRef = useRef<HTMLDivElement>(null)- const endRef = useRef<HTMLDivElement>(null)-- useEffect(() => {- endRef.current?.scrollIntoView({ behavior: 'smooth' })- }, [entries.length])-- return (- <div className="flex flex-col h-full min-h-0">- <div className="flex items-center gap-1.5 text-[12px] text-gray-400 mb-2 font-medium flex-shrink-0">- <ScrollText size={13} />- Agent Log ({entries.length})- </div>- <div ref={scrollRef} className="flex-1 overflow-y-auto space-y-1.5 min-h-0 scrollbar-thin pr-1">- <AnimatePresence initial={false}>- {entries.map((entry) => {- const style = typeStyles[entry.type]- return (- <motion.div- key={entry.id}- initial={{ opacity: 0, y: 8 }}- animate={{ opacity: 1, y: 0 }}- transition={{ duration: MOTION_S.base }}- className={`border-l-2 ${style.bg} pl-3 py-1.5`}- >- <div className="flex items-center gap-2 mb-0.5">- <span className={`t-micro px-1.5 py-0.5 rounded-full font-medium ${style.badge}`}>- {typeLabels[entry.type]}- </span>- <span className="t-micro text-gray-500">- {formatTimestamp(entry.timestamp)}- </span>- </div>- <div- className={`text-[0.8rem] leading-relaxed whitespace-pre-wrap break-words ${- entry.type === 'observation' ? 'font-mono text-[12px]' : ''- } ${style.text}`}- >- {entry.content}- </div>- {entry.toolCall && entry.toolCall.status === 'pending' && onApprove && onReject && (- <div className="mt-1.5">- <ToolCallCard- toolCall={entry.toolCall}- onApprove={() => onApprove(entry.toolCall!.id)}- onReject={() => onReject(entry.toolCall!.id)}- />- </div>- )}- </motion.div>- )- })}- </AnimatePresence>- <div ref={endRef} />- </div>- </div>- )-}diff --git a/src/components/agents/TaskBreakdown.tsx b/src/components/agents/TaskBreakdown.tsxdeleted file mode 100644index f1a99174..00000000--- a/src/components/agents/TaskBreakdown.tsx+++ /dev/null@@ -1,119 +0,0 @@-import { useState } from 'react'-import { motion, AnimatePresence } from 'framer-motion'-import { Circle, Loader2, CheckCircle2, XCircle, ChevronDown, ChevronRight, Wrench } from 'lucide-react'-import { ToolCallCard } from './ToolCallCard'-import type { AgentTask, TaskStatus } from '../../types/agents'-import { MOTION_S } from '../ui/motion'--function StatusIcon({ status }: { status: TaskStatus }) {- switch (status) {- case 'pending':- return <Circle size={16} className="text-gray-500 flex-shrink-0" />- case 'running':- return <Loader2 size={16} className="text-blue-400 animate-spin flex-shrink-0" />- case 'completed':- return <CheckCircle2 size={16} className="text-green-600 dark:text-green-400 flex-shrink-0" />- case 'failed':- return <XCircle size={16} className="text-red-400 flex-shrink-0" />- case 'skipped':- return <Circle size={16} className="text-gray-600 flex-shrink-0" />- default:- return <Circle size={16} className="text-gray-500 flex-shrink-0" />- }-}--interface Props {- tasks: AgentTask[]-}--export function TaskBreakdown({ tasks }: Props) {- const [expanded, setExpanded] = useState<Set<string>>(new Set())-- const toggle = (taskId: string) => {- setExpanded((prev) => {- const next = new Set(prev)- if (next.has(taskId)) next.delete(taskId)- else next.add(taskId)- return next- })- }-- if (tasks.length === 0) {- return (- <div className="text-[12px] text-gray-500 py-2">- <div className="flex items-center gap-1.5 text-gray-400 mb-2 font-medium">- <Wrench size={13} />- Tasks- </div>- <div className="text-center py-3">No tasks yet. The agent will create them as it works</div>- </div>- )- }-- return (- <div>- <div className="flex items-center gap-1.5 text-[12px] text-gray-400 mb-2 font-medium">- <Wrench size={13} />- Tasks ({tasks.filter((t) => t.status === 'completed').length}/{tasks.length})- </div>- <div className="space-y-1.5">- <AnimatePresence initial={false}>- {tasks.map((task) => (- <motion.div- key={task.id}- initial={{ opacity: 0, height: 0 }}- animate={{ opacity: 1, height: 'auto' }}- exit={{ opacity: 0, height: 0 }}- transition={{ duration: MOTION_S.base }}- >- <div- onClick={() => task.toolCalls.length > 0 && toggle(task.id)}- className={`flex items-start gap-2 p-2 rounded-lg transition-colors text-[0.8rem] ${- task.toolCalls.length > 0 ? 'cursor-pointer hover:bg-white/5' : ''- }`}- >- <StatusIcon status={task.status} />- <div className="flex-1 min-w-0">- <div className={`leading-tight ${task.status === 'completed' ? 'text-gray-400' : 'text-white'}`}>- {task.description}- </div>- {task.reasoning && (- <div className="text-[0.7rem] text-gray-500 mt-0.5 truncate">- {task.reasoning}- </div>- )}- </div>- {task.toolCalls.length > 0 && (- <div className="flex items-center gap-1 t-micro text-gray-500 flex-shrink-0">- <span>{task.toolCalls.length} call{task.toolCalls.length !== 1 ? 's' : ''}</span>- {expanded.has(task.id) ? (- <ChevronDown size={12} />- ) : (- <ChevronRight size={12} />- )}- </div>- )}- </div>-- <AnimatePresence>- {expanded.has(task.id) && (- <motion.div- initial={{ opacity: 0, height: 0 }}- animate={{ opacity: 1, height: 'auto' }}- exit={{ opacity: 0, height: 0 }}- transition={{ duration: MOTION_S.base }}- className="ml-6 space-y-1.5 pb-1"- >- {task.toolCalls.map((tc) => (- <ToolCallCard key={tc.id} toolCall={tc} />- ))}- </motion.div>- )}- </AnimatePresence>- </motion.div>- ))}- </AnimatePresence>- </div>- </div>- )-}diff --git a/src/components/agents/ToolCallCard.tsx b/src/components/agents/ToolCallCard.tsxdeleted file mode 100644index a377239f..00000000--- a/src/components/agents/ToolCallCard.tsx+++ /dev/null@@ -1,111 +0,0 @@-import { motion } from 'framer-motion'-import { Loader2, Check, X } from 'lucide-react'-import { GlowButton } from '../ui/GlowButton'-import type { ToolCall } from '../../types/agents'-import type { ToolArgs } from '../../api/mcp/types'-import { MOTION_S } from '../ui/motion'--interface Props {- toolCall: ToolCall- onApprove?: () => void- onReject?: () => void-}--// Der einzige Aufrufer uebergibt `toolCall.args`, und das IST `ToolArgs`-// (types/agents.ts:45). Die Funktion serialisiert nur — sie greift auf keinen-// einzigen Schluessel zu, `unknown` kostet hier also nichts.-function formatArgs(args: ToolArgs): string {- try {- return JSON.stringify(args, null, 2)- } catch {- return String(args)- }-}--export function ToolCallCard({ toolCall, onApprove, onReject }: Props) {- const isPending = toolCall.status === 'pending'- const isRunning = toolCall.status === 'running' || toolCall.status === 'approved'- const isCompleted = toolCall.status === 'completed'- const isFailed = toolCall.status === 'failed' || toolCall.status === 'rejected'-- return (- <motion.div- initial={{ opacity: 0, scale: 0.97 }}- animate={{ opacity: 1, scale: 1 }}- transition={{ duration: MOTION_S.base }}- className="glass-card rounded-lg p-3 dark:bg-lu-overlay border border-white/5"- >- {/* Tool Name */}- <div className="flex items-center justify-between mb-2">- <span className="text-[0.8rem] font-bold text-white">- {toolCall.tool}- </span>- {isRunning && (- <Loader2 size={14} className="text-blue-400 animate-spin" />- )}- {isCompleted && (- <span className="t-micro text-green-400 bg-green-500/10 px-1.5 py-0.5 rounded-full">- completed- </span>- )}- {isFailed && (- <span className="t-micro text-red-400 bg-red-500/10 px-1.5 py-0.5 rounded-full">- {toolCall.status === 'rejected' ? 'rejected' : 'failed'}- </span>- )}- {/* Die drei Nachbarn oben sind Zustaende des Werkzeugs: laeuft, fertig,- fehlgeschlagen. „awaiting approval" ist keiner davon, sondern eine- Frage an den Nutzer, und stand trotzdem in Gelb zwischen Blau und- Rot. Der Hausakzent sagt „hier bist du dran", ohne einen Defekt zu- behaupten; die Antwort liegt als Approve/Reject direkt darunter. */}- {isPending && (- <span className="t-micro text-lu-accent bg-lu-accent-soft px-1.5 py-0.5 rounded-full">- awaiting approval- </span>- )}- </div>-- {/* Arguments */}- {Object.keys(toolCall.args).length > 0 && (- <pre className="text-[0.7rem] font-mono bg-black/30 rounded-md p-2 mb-2 overflow-x-auto text-gray-300 whitespace-pre-wrap break-words max-h-[120px] overflow-y-auto scrollbar-thin">- {formatArgs(toolCall.args)}- </pre>- )}-- {/* Result (completed) */}- {isCompleted && toolCall.result && (- <pre className="text-[0.7rem] font-mono bg-green-500/5 border border-green-500/10 rounded-md p-2 overflow-x-auto text-green-300 whitespace-pre-wrap break-words max-h-[150px] overflow-y-auto scrollbar-thin">- {toolCall.result}- </pre>- )}-- {/* Error (failed) */}- {isFailed && toolCall.error && (- <pre className="text-[0.7rem] font-mono bg-red-500/5 border border-red-500/10 rounded-md p-2 overflow-x-auto text-red-300 whitespace-pre-wrap break-words max-h-[150px] overflow-y-auto scrollbar-thin">- {toolCall.error}- </pre>- )}-- {/* Duration */}- {toolCall.duration !== undefined && (- <div className="t-micro text-gray-500 mt-1">- {(toolCall.duration / 1000).toFixed(1)}s- </div>- )}-- {/* Approval Buttons */}- {isPending && onApprove && onReject && (- <div className="flex gap-2 mt-2">- <GlowButton onClick={onApprove} className="text-[0.7rem] py-1 px-3 bg-green-500/10 border-green-500/30 text-green-300 hover:bg-green-500/20">- <Check size={12} className="inline mr-1" />- Approve- </GlowButton>- <GlowButton variant="danger" onClick={onReject} className="text-[0.7rem] py-1 px-3">- <X size={12} className="inline mr-1" />- Reject- </GlowButton>- </div>- )}- </motion.div>- )-}diff --git a/src/components/chat/ChatModeTabs.tsx b/src/components/chat/ChatModeTabs.tsxdeleted file mode 100644index 5de52285..00000000--- a/src/components/chat/ChatModeTabs.tsx+++ /dev/null@@ -1,40 +0,0 @@-import { MessageSquare, Code } from 'lucide-react'-import { useCodexStore } from '../../stores/codexStore'-import type { ChatMode } from '../../types/codex'--const TABS: { mode: ChatMode; label: string; icon: typeof Code; disabled?: boolean; tag?: string }[] = [- { mode: 'lu', label: 'LU', icon: MessageSquare },- // 'codex' is the internal mode id; the user-facing label is "Code".- { mode: 'codex', label: 'Code', icon: Code },-]--export function ChatModeTabs() {- const chatMode = useCodexStore((s) => s.chatMode)- const setChatMode = useCodexStore((s) => s.setChatMode)-- return (- <div className="flex items-center gap-0.5 px-2 py-0.5">- {TABS.map(({ mode, label, icon: Icon, disabled, tag }) => {- const isActive = chatMode === mode- return (- <button- key={mode}- onClick={() => !disabled && setChatMode(mode)}- disabled={disabled}- className={`flex items-center gap-1 px-2 py-0.5 rounded text-[0.55rem] font-medium transition-colors ${- isActive- ? 'bg-white/10 text-white border border-white/15'- : disabled- ? 'text-gray-700 cursor-default'- : 'text-gray-500 hover:text-gray-300 hover:bg-white/5 border border-transparent'- }`}- >- <Icon size={9} />- <span>{label}</span>- {tag && <span className="text-[0.45rem] text-gray-600 ml-0.5">{tag}</span>}- </button>- )- })}- </div>- )-}diff --git a/src/components/chat/CodexEventBlock.tsx b/src/components/chat/CodexEventBlock.tsxdeleted file mode 100644index bcc2edc0..00000000--- a/src/components/chat/CodexEventBlock.tsx+++ /dev/null@@ -1,82 +0,0 @@-import { Terminal, FileEdit, Brain, AlertCircle, CheckCircle, ChevronDown } from 'lucide-react'-import { useState, memo } from 'react'-import type { CodexEvent } from '../../types/codex'-import { DiffView } from './DiffView'--interface Props {- event: CodexEvent-}--// memo (audit D2): events are append-only, so every existing block can skip-// re-rendering while the transcript streams.-export const CodexEventBlock = memo(CodexEventBlockImpl)--function CodexEventBlockImpl({ event }: Props) {- const [open, setOpen] = useState(event.type === 'error')-- if (event.type === 'instruction' || event.type === 'done') return null-- const icons = {- file_change: FileEdit,- terminal_output: Terminal,- reasoning: Brain,- error: AlertCircle,- }-- // Vier Ereignisarten, vier Farben. Das ist eine Einteilung, keine Ampel:- // eine Dateiaenderung ist der Normalfall eines Codelaufs und stand trotzdem- // in Gelb, also in der Farbe, die im Rest der App Alarm bedeutete. Violett- // ist gegen die drei Nachbarn in dieser Tabelle geprueft, Gruen gehoert der- // Konsole, Blau dem Denken, Rot dem Fehler.- const colors = {- file_change: 'text-purple-400',- terminal_output: 'text-green-400',- reasoning: 'text-blue-400',- error: 'text-red-400',- }-- const labels = {- file_change: event.filePath || 'File changed',- terminal_output: 'Terminal',- reasoning: 'Thinking',- error: 'Error',- }-- const Icon = icons[event.type as keyof typeof icons] || CheckCircle- const color = colors[event.type as keyof typeof colors] || 'text-gray-400'- const label = labels[event.type as keyof typeof labels] || event.type- const hasDiff = event.type === 'file_change' && Boolean(event.diff)-- return (- <div className="mb-0.5">- <button- onClick={() => setOpen(!open)}- className="flex items-center gap-1.5 py-0.5 text-left hover:opacity-80 transition-opacity w-full"- >- <Icon size={10} className={color} />- <span className={`t-micro ${color}`}>{label}</span>- <ChevronDown size={8} className={`text-gray-600 ml-auto transition-transform ${open ? 'rotate-180' : ''}`} />- </button>-- {open && (- <div className="pl-4 pb-1">- {hasDiff ? (- <DiffView diff={event.diff!} />- ) : (- <pre className={`t-micro leading-relaxed rounded px-2 py-1 overflow-auto scrollbar-thin max-h-[250px] ${- event.type === 'terminal_output'- ? 'bg-black/20 text-green-300/70'- : event.type === 'error'- ? 'bg-red-500/5 text-red-400/80'- : event.type === 'reasoning'- ? 'text-blue-200/40 italic'- : 'bg-white/[0.02] text-gray-400'- }`}>- {event.content}- </pre>- )}- </div>- )}- </div>- )-}