From da62b69145cac91225c5da43013d0831bee2978c Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 24 Aug 2025 21:53:48 -0500 Subject: [PATCH] Simplify chat UI --- src/components/AIMessageItem.tsx | 94 +++++++------------------ src/components/Shakespeare/ChatPane.tsx | 15 +--- 2 files changed, 30 insertions(+), 79 deletions(-) diff --git a/src/components/AIMessageItem.tsx b/src/components/AIMessageItem.tsx index 7df75d13..44d53ed7 100644 --- a/src/components/AIMessageItem.tsx +++ b/src/components/AIMessageItem.tsx @@ -1,7 +1,6 @@ import { memo, useState } from 'react'; import { Streamdown } from 'streamdown'; -import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; -import { Bot, User, Square, Wrench, Eye, FileText, Edit, Package, PackageMinus, GitCommit } from 'lucide-react'; +import { Square, Wrench, Eye, FileText, Edit, Package, PackageMinus, GitCommit } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { AIMessage } from '@/hooks/useAIChat'; import { cn } from '@/lib/utils'; @@ -9,8 +8,6 @@ import OpenAI from 'openai'; interface AIMessageItemProps { message: AIMessage; - userDisplayName?: string; - userProfileImage?: string; isCurrentlyLoading?: boolean; onStopGeneration?: () => void; toolCall?: OpenAI.Chat.Completions.ChatCompletionMessageToolCall | undefined; // Tool call data passed from the assistant message @@ -18,46 +15,12 @@ interface AIMessageItemProps { export const AIMessageItem = memo(({ message, - userDisplayName = 'You', - userProfileImage, isCurrentlyLoading = false, onStopGeneration, toolCall }: AIMessageItemProps) => { const [isToolExpanded, setIsToolExpanded] = useState(false); - // Get display name based on role - const getDisplayName = () => { - switch (message.role) { - case 'user': - return userDisplayName; - case 'assistant': - return 'Assistant'; - case 'system': - return 'System'; - case 'tool': - return 'Tool'; - default: - return 'Unknown'; - } - }; - - // Get role label for display - const getRoleLabel = () => { - switch (message.role) { - case 'user': - return 'User'; - case 'assistant': - return 'AI'; - case 'system': - return 'System'; - case 'tool': - return 'Tool'; - default: - return message.role; - } - }; - // Get content to display const getContent = () => { if (typeof message.content === 'string') { @@ -161,7 +124,7 @@ export const AIMessageItem = memo(({ const IconComponent = toolInfo.icon; return ( -
{/* ml-11 to align with assistant message content, -mt-2 to make it snug */} +
{/* -mt-2 to make it snug with the previous assistant message */} - )} -
+
+ )}
@@ -388,26 +387,18 @@ BASE_DOMAIN=nostrdeploy.com`); ) : ( -
-
-
- -
-
+
-
- Assistant - AI +