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 */}
-
-
-
-
-
+
+
- {isLoading ? (
-
- ) : (
-
- )}
+ {/* Bottom Controls Row */}
+
+ {/* Mobile Chat Mode Toggle */}
+ {mobileChatMode && onMobileChatModeChange && (
+
+
+
+
+ )}
+
+ {/* Model Selector */}
+
+
+
+
+ {/* Send/Stop Button */}
+ {isLoading ? (
+
+ ) : (
+
+ )}
+
diff --git a/src/components/Shakespeare/ChatInput.tsx b/src/components/Shakespeare/ChatInput.tsx
index fe917d4b..3648be0d 100644
--- a/src/components/Shakespeare/ChatInput.tsx
+++ b/src/components/Shakespeare/ChatInput.tsx
@@ -5,8 +5,9 @@ import { Textarea } from '@/components/ui/textarea';
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
import { CircularProgress } from '@/components/ui/circular-progress';
import { FileAttachment } from '@/components/ui/file-attachment';
-import { Square, ArrowUp } from 'lucide-react';
+import { Square, ArrowUp, Hammer, MessageCircle } from 'lucide-react';
import { ModelSelector } from '@/components/ModelSelector';
+import { cn } from '@/lib/utils';
interface ChatInputProps {
isLoading: boolean;
@@ -28,6 +29,9 @@ interface ChatInputProps {
onDragOver: (e: React.DragEvent) => void;
onDragLeave: (e: React.DragEvent) => void;
onDrop: (e: React.DragEvent) => void;
+ /** Mobile chat mode toggle - only shown on mobile when global chat is enabled */
+ mobileChatMode?: 'building' | 'chatting';
+ onMobileChatModeChange?: (mode: 'building' | 'chatting') => void;
}
export const ChatInput = memo(function ChatInput({
@@ -50,6 +54,8 @@ export const ChatInput = memo(function ChatInput({
onDragOver,
onDragLeave,
onDrop,
+ mobileChatMode,
+ onMobileChatModeChange,
}: ChatInputProps) {
const { t } = useTranslation();
const [input, setInput] = useState('');
@@ -167,6 +173,36 @@ export const ChatInput = memo(function ChatInput({
multiple={true}
/>
+ {/* Mobile Chat Mode Toggle - shown on mobile when global chat is enabled */}
+ {mobileChatMode && onMobileChatModeChange && (
+
+
+
+
+ )}
+
{/* Context Usage Wheel */}
{contextUsagePercentage >= 10 && currentModelContextLength && lastInputTokens && lastInputTokens > 0 && (
diff --git a/src/components/Shakespeare/ChatPane.tsx b/src/components/Shakespeare/ChatPane.tsx
index 848e8856..4868d515 100644
--- a/src/components/Shakespeare/ChatPane.tsx
+++ b/src/components/Shakespeare/ChatPane.tsx
@@ -59,6 +59,9 @@ interface ChatPaneProps {
isBuildLoading?: boolean;
consoleError?: ProjectPreviewConsoleError | null;
onDismissConsoleError?: () => void;
+ /** Mobile chat mode toggle - only shown on mobile when global chat is enabled */
+ mobileChatMode?: 'building' | 'chatting';
+ onMobileChatModeChange?: (mode: 'building' | 'chatting') => void;
}
export interface ChatPaneRef {
@@ -74,6 +77,8 @@ export const ChatPane = forwardRef(({
isBuildLoading: externalIsBuildLoading,
consoleError,
onDismissConsoleError,
+ mobileChatMode,
+ onMobileChatModeChange,
}, ref) => {
const { t } = useTranslation();
const [searchParams, setSearchParams] = useSearchParams();
@@ -729,6 +734,8 @@ export const ChatPane = forwardRef(({
onDragOver={handleDragOver}
onDragLeave={handleDragLeave}
onDrop={handleDrop}
+ mobileChatMode={mobileChatMode}
+ onMobileChatModeChange={onMobileChatModeChange}
/>
{/* Onboarding Dialog */}
diff --git a/src/pages/ProjectView.tsx b/src/pages/ProjectView.tsx
index f1282f1b..df79b1f9 100644
--- a/src/pages/ProjectView.tsx
+++ b/src/pages/ProjectView.tsx
@@ -224,63 +224,39 @@ export function ProjectView() {
{mobileView === 'chat' && (
- <>
- {/* Building/Chatting toggle - only show if global chat is enabled */}
- {config.globalChatEnabled !== false && (
-
-
-
-
-
-
- )}
-
- {/* Chat content based on mode */}
-
- {mobileChatMode === 'building' ? (
- project ? (
-
- ) : (
-
-
-
-
-
-
- )
+ /* Chat content based on mode - toggle is inside the compose area */
+
+ {mobileChatMode === 'building' ? (
+ project ? (
+
) : (
-
- )}
-
- >
+
+
+
+
+
+
+ )
+ ) : (
+
+ )}
+
)}
{(mobileView === 'preview' || mobileView === 'code') && (
project ? (