From e4cc5989f606ab1da8047834ebdfb63571b3fefa Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 30 Jan 2026 22:55:12 +0000 Subject: [PATCH] refactor: rebuild AI chat UI from scratch - Clean layout following GroupListViewer patterns - Header (shrink-0) + Messages (flex-1 overflow-y-auto) + Input (shrink-0) - Desktop: resizable sidebar with conversation list - Mobile: Sheet-based sidebar with toggle button - Proper flex containers with min-h-0 for correct height - Improved spacing, sizing, and visual hierarchy - Smaller, compact header with 7px height selectors - MessageSquare icon in conversation list items - Better empty state with Brain icon and clear CTA - Clean separation of concerns (ChatPanel handles messages + input) https://claude.ai/code/session_01HqtD9R33oqfB14Gu1V5wHC --- src/components/AIViewer.tsx | 201 ++++++++++++++++++++---------------- 1 file changed, 112 insertions(+), 89 deletions(-) diff --git a/src/components/AIViewer.tsx b/src/components/AIViewer.tsx index 796af14..4fbf2d8 100644 --- a/src/components/AIViewer.tsx +++ b/src/components/AIViewer.tsx @@ -17,6 +17,7 @@ import { Trash2, Brain, Settings2, + MessageSquare, } from "lucide-react"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; @@ -29,7 +30,6 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import { ScrollArea } from "@/components/ui/scroll-area"; import * as VisuallyHidden from "@radix-ui/react-visually-hidden"; import { useLLMProviders, @@ -61,7 +61,7 @@ function useIsMobile() { } // ───────────────────────────────────────────────────────────── -// Message Component +// Message Bubble // ───────────────────────────────────────────────────────────── const MessageBubble = memo(function MessageBubble({ @@ -71,7 +71,7 @@ const MessageBubble = memo(function MessageBubble({ }) { const isUser = message.role === "user"; - // Don't render empty assistant messages (placeholder while thinking) + // Don't render empty assistant messages if (!isUser && !message.content) { return null; } @@ -184,13 +184,14 @@ const ConversationItem = memo(function ConversationItem({ return (
+
-
{conversation.title}
+
{conversation.title}
{formatTimestamp(conversation.updatedAt / 1000, "relative")}
@@ -198,7 +199,7 @@ const ConversationItem = memo(function ConversationItem({