diff --git a/src/components/FloatingChatButton.tsx b/src/components/FloatingChatButton.tsx
index 90c58007..6bd109e8 100644
--- a/src/components/FloatingChatButton.tsx
+++ b/src/components/FloatingChatButton.tsx
@@ -4,12 +4,14 @@ import { MessageCircle, X } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { useGlobalChat } from '@/hooks/useGlobalChat';
import { useAppContext } from '@/hooks/useAppContext';
+import { useIsMobile } from '@/hooks/useIsMobile';
import { cn } from '@/lib/utils';
export function FloatingChatButton() {
const { isOpen, setIsOpen, hasUnread } = useGlobalChat();
const { config } = useAppContext();
const location = useLocation();
+ const isMobile = useIsMobile();
const [isHovered, setIsHovered] = useState(false);
const [isHiddenTemporarily, setIsHiddenTemporarily] = useState(false);
@@ -28,6 +30,12 @@ export function FloatingChatButton() {
return null;
}
+ // On mobile, only show on home screen (/ or /giftcard)
+ const isHomePage = location.pathname === '/' || location.pathname === '/giftcard';
+ if (isMobile && !isHomePage) {
+ return null;
+ }
+
// Don't render if temporarily hidden
if (isHiddenTemporarily) {
return null;
diff --git a/src/components/GlobalChatPane.tsx b/src/components/GlobalChatPane.tsx
index 7fa59de5..1e68ff45 100644
--- a/src/components/GlobalChatPane.tsx
+++ b/src/components/GlobalChatPane.tsx
@@ -80,7 +80,12 @@ function ChatMessage({ message }: { message: GlobalChatMessage }) {
);
}
-export function GlobalChatPane() {
+interface GlobalChatPaneProps {
+ /** When true, renders inline without fixed positioning (for embedding in ProjectView) */
+ embedded?: boolean;
+}
+
+export function GlobalChatPane({ embedded = false }: GlobalChatPaneProps) {
const { t } = useTranslation();
const {
messages,
@@ -188,18 +193,132 @@ export function GlobalChatPane() {
}
}, [handleSend, isMobile]);
- // Don't render if disabled or not open
- if (config.globalChatEnabled === false || !isOpen) {
+ // For non-embedded mode: Don't render if disabled or not open
+ if (!embedded && (config.globalChatEnabled === false || !isOpen)) {
return null;
}
- // Don't render on settings pages
- if (location.pathname.startsWith('/settings')) {
+ // For non-embedded mode: Don't render on settings pages
+ if (!embedded && location.pathname.startsWith('/settings')) {
return null;
}
const hasProviders = settings.providers.length > 0;
+ // Embedded mode: Render inline without fixed positioning
+ if (embedded) {
+ return (
+
+ {/* Header */}
+
+
{t('globalChat')}
+
+ {messages.length > 0 && (
+
+
+
+
+ {t('clearChat')}
+
+ )}
+
+
+
+ {/* Messages */}
+
+ {messages.length === 0 ? (
+
+
+
{t('globalChatWelcome')}
+
{t('globalChatDescription')}
+
+
+ ) : (
+ messages.map((message) => (
+
+ ))
+ )}
+
+ {isLoading && messages[messages.length - 1]?.role !== 'assistant' && (
+
+ )}
+
+
+ {/* Scroll to bottom button */}
+ {showScrollToBottom && (
+
+ )}
+
+ {/* Input */}
+
+
+ );
+ }
+
// Mobile: Full screen drawer from bottom
if (isMobile) {
return (
diff --git a/src/locales/en.json b/src/locales/en.json
index d93ef144..f0d888c8 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -542,5 +542,7 @@
"globalChatEnabled": "Floating Chat Button",
"globalChatEnabledDescription": "Show a floating chat button for quick AI conversations",
"globalChatSystemPrompt": "Chat System Prompt",
- "globalChatSystemPromptDescription": "Custom system prompt for the floating chat assistant"
+ "globalChatSystemPromptDescription": "Custom system prompt for the floating chat assistant",
+ "building": "Building",
+ "chatting": "Chatting"
}
diff --git a/src/locales/ha.json b/src/locales/ha.json
index 87eff953..c6c773fb 100644
--- a/src/locales/ha.json
+++ b/src/locales/ha.json
@@ -443,5 +443,7 @@
"globalChatEnabled": "Maballin Tattaunawa Mai Yawo",
"globalChatEnabledDescription": "Nuna maballin tattaunawa mai yawo don saurin tattaunawa da AI",
"globalChatSystemPrompt": "Jagorar Tsarin Tattaunawa",
- "globalChatSystemPromptDescription": "Jagorar tsarin da aka keɓe don mataimakin tattaunawa mai yawo"
+ "globalChatSystemPromptDescription": "Jagorar tsarin da aka keɓe don mataimakin tattaunawa mai yawo",
+ "building": "Ginawa",
+ "chatting": "Tattaunawa"
}
diff --git a/src/locales/ig.json b/src/locales/ig.json
index 5bba5af2..c219647e 100644
--- a/src/locales/ig.json
+++ b/src/locales/ig.json
@@ -440,5 +440,7 @@
"globalChatEnabled": "Bọtịnụ Nkata Na-epupụta",
"globalChatEnabledDescription": "Gosi bọtịnụ nkata na-epupụta maka nkata AI ngwa ngwa",
"globalChatSystemPrompt": "Usoro Nkata",
- "globalChatSystemPromptDescription": "Usoro nke gị maka onye enyemaka nkata na-epupụta"
+ "globalChatSystemPromptDescription": "Usoro nke gị maka onye enyemaka nkata na-epupụta",
+ "building": "Nrụpụta",
+ "chatting": "Nkwurịta"
}
diff --git a/src/locales/pt.json b/src/locales/pt.json
index a12b8444..6cb318f7 100644
--- a/src/locales/pt.json
+++ b/src/locales/pt.json
@@ -452,5 +452,7 @@
"globalChatEnabled": "Botão de Chat Flutuante",
"globalChatEnabledDescription": "Mostrar um botão de chat flutuante para conversas rápidas com IA",
"globalChatSystemPrompt": "Prompt do Sistema do Chat",
- "globalChatSystemPromptDescription": "Prompt do sistema personalizado para o assistente de chat flutuante"
+ "globalChatSystemPromptDescription": "Prompt do sistema personalizado para o assistente de chat flutuante",
+ "building": "Construindo",
+ "chatting": "Conversando"
}
diff --git a/src/locales/yo.json b/src/locales/yo.json
index 8bd093d0..2739137f 100644
--- a/src/locales/yo.json
+++ b/src/locales/yo.json
@@ -440,5 +440,7 @@
"globalChatEnabled": "Bọtini Ibanisọrọ Ti O N Lọ",
"globalChatEnabledDescription": "Fi bọtini ibanisọrọ ti o n lọ han fun ibaraẹnisọrọ AI ni iyara",
"globalChatSystemPrompt": "Itọsọna Eto Ibanisọrọ",
- "globalChatSystemPromptDescription": "Itọsọna eto aṣa fun oluranlọwọ ibanisọrọ ti o n lọ"
+ "globalChatSystemPromptDescription": "Itọsọna eto aṣa fun oluranlọwọ ibanisọrọ ti o n lọ",
+ "building": "Kíkọ́",
+ "chatting": "Sísọ̀rọ̀"
}
diff --git a/src/locales/zh.json b/src/locales/zh.json
index 0704d49f..69232122 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -452,5 +452,7 @@
"globalChatEnabled": "浮动聊天按钮",
"globalChatEnabledDescription": "显示浮动聊天按钮以便快速AI对话",
"globalChatSystemPrompt": "聊天系统提示",
- "globalChatSystemPromptDescription": "浮动聊天助手的自定义系统提示"
+ "globalChatSystemPromptDescription": "浮动聊天助手的自定义系统提示",
+ "building": "构建",
+ "chatting": "聊天"
}
diff --git a/src/pages/ProjectView.tsx b/src/pages/ProjectView.tsx
index 3abc4939..f1282f1b 100644
--- a/src/pages/ProjectView.tsx
+++ b/src/pages/ProjectView.tsx
@@ -20,6 +20,8 @@ import { useBuildProject } from '@/hooks/useBuildProject';
import { useIsProjectPreviewable } from '@/hooks/useIsProjectPreviewable';
import { useConsoleError } from '@/hooks/useConsoleError';
import { useAutoBuild } from '@/hooks/useAutoBuild';
+import { GlobalChatPane } from '@/components/GlobalChatPane';
+import { useAppContext } from '@/hooks/useAppContext';
export function ProjectView() {
const { projectId } = useParams<{ projectId: string }>();
@@ -28,6 +30,7 @@ export function ProjectView() {
const [isLoading, setIsLoading] = useState(true);
const [activeTab, setActiveTab] = useState<'preview' | 'code'>('preview');
const [mobileView, setMobileView] = useState<'chat' | 'preview' | 'code'>('chat');
+ const [mobileChatMode, setMobileChatMode] = useState<'building' | 'chatting'>('building');
const [isAILoading, setIsAILoading] = useState(false);
const [isProjectDetailsOpen, setIsProjectDetailsOpen] = useState(false);
@@ -38,6 +41,7 @@ export function ProjectView() {
const chatPaneRef = useRef(null);
const navigate = useNavigate();
const isMobile = useIsMobile();
+ const { config } = useAppContext();
const [isSidebarVisible, setIsSidebarVisible] = useState(!isMobile);
@@ -218,28 +222,65 @@ export function ProjectView() {
)}
-
+
{mobileView === 'chat' && (
- project ? (
-
- ) : (
-
-
-
-
-
+ <>
+ {/* Building/Chatting toggle - only show if global chat is enabled */}
+ {config.globalChatEnabled !== false && (
+
+
+
+
+
+
+ )}
+
+ {/* Chat content based on mode */}
+
+ {mobileChatMode === 'building' ? (
+ project ? (
+
+ ) : (
+
+
+
+
+
+
+ )
+ ) : (
+
+ )}
- )
+ >
)}
{(mobileView === 'preview' || mobileView === 'code') && (
project ? (