From ed512c5d64daf40619e49848cc7f0c96bb3e3953 Mon Sep 17 00:00:00 2001 From: MK Fain Date: Wed, 3 Dec 2025 22:06:51 -0600 Subject: [PATCH] refactor(mobile): move Building/Chatting toggle into compose box - Remove toggle tabs from top of mobile chat pane - Add pill-style toggle button inside the compose area (similar to Lovable's UI) - Toggle shows Building (hammer icon) and Chatting (message icon) modes - Toggle appears in both ChatInput and GlobalChatPane embedded mode - Maintains consistent styling with rounded-full bg-muted design --- src/components/GlobalChatPane.tsx | 99 +++++++++++++++++------- src/components/Shakespeare/ChatInput.tsx | 38 ++++++++- src/components/Shakespeare/ChatPane.tsx | 7 ++ src/pages/ProjectView.tsx | 88 ++++++++------------- 4 files changed, 147 insertions(+), 85 deletions(-) diff --git a/src/components/GlobalChatPane.tsx b/src/components/GlobalChatPane.tsx index 1e68ff45..5a248b40 100644 --- a/src/components/GlobalChatPane.tsx +++ b/src/components/GlobalChatPane.tsx @@ -1,7 +1,7 @@ import { useState, useRef, useEffect, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation } from 'react-router-dom'; -import { X, Trash2, Copy, Check, ChevronDown, ArrowUp, Square, Loader2 } from 'lucide-react'; +import { X, Trash2, Copy, Check, ChevronDown, ArrowUp, Square, Loader2, Hammer, MessageCircle } from 'lucide-react'; import { Streamdown } from 'streamdown'; import { Button } from '@/components/ui/button'; import { Textarea } from '@/components/ui/textarea'; @@ -83,9 +83,12 @@ function ChatMessage({ message }: { message: GlobalChatMessage }) { interface GlobalChatPaneProps { /** When true, renders inline without fixed positioning (for embedding in ProjectView) */ embedded?: boolean; + /** Mobile chat mode toggle - only used in embedded mode */ + mobileChatMode?: 'building' | 'chatting'; + onMobileChatModeChange?: (mode: 'building' | 'chatting') => void; } -export function GlobalChatPane({ embedded = false }: GlobalChatPaneProps) { +export function GlobalChatPane({ embedded = false, mobileChatMode, onMobileChatModeChange }: GlobalChatPaneProps) { const { t } = useTranslation(); const { messages, @@ -272,17 +275,8 @@ export function GlobalChatPane({ embedded = false }: GlobalChatPaneProps) { )} {/* Input */} -
-
- -
-
+
+