From 701ae7c7e7d3284b396eff010b257dfd2d4a5968 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Mon, 23 Mar 2026 09:34:45 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20assistant=20chat=20mobile=20layout=20?= =?UTF-8?q?=E2=80=94=20sidebar=20hidden,=20slide-out=20toggle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chat sidebar was rendering side-by-side on mobile causing squished layout. Now hidden on mobile with a "Chats" toggle button + "+ New" in a compact header bar. Sidebar slides out as an overlay on mobile, auto-closes on chat selection. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/components/assistant/ChatSidebar.tsx | 39 ++++++++++--- frontend/src/pages/AssistantChatPage.tsx | 57 +++++++++++++++---- 2 files changed, 77 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/assistant/ChatSidebar.tsx b/frontend/src/components/assistant/ChatSidebar.tsx index 3776ce53..1d66a93c 100644 --- a/frontend/src/components/assistant/ChatSidebar.tsx +++ b/frontend/src/components/assistant/ChatSidebar.tsx @@ -9,6 +9,8 @@ interface ChatSidebarProps { onNewChat: () => void onDeleteChat: (id: string) => void onTogglePin: (id: string, pinned: boolean) => void + mobileOpen?: boolean + onMobileClose?: () => void } export function ChatSidebar({ @@ -18,19 +20,41 @@ export function ChatSidebar({ onNewChat, onDeleteChat, onTogglePin, + mobileOpen = false, + onMobileClose, }: ChatSidebarProps) { const pinnedChats = chats.filter(c => c.pinned) const unpinnedChats = chats.filter(c => !c.pinned) + const handleSelectChat = (id: string) => { + onSelectChat(id) + onMobileClose?.() + } + + const handleNewChat = () => { + onNewChat() + onMobileClose?.() + } + return ( -
+ <> + {/* Mobile overlay */} + {mobileOpen && ( +
+ )} +
{/* Header */}
+ ) } diff --git a/frontend/src/pages/AssistantChatPage.tsx b/frontend/src/pages/AssistantChatPage.tsx index 0aa6aa92..39590de2 100644 --- a/frontend/src/pages/AssistantChatPage.tsx +++ b/frontend/src/pages/AssistantChatPage.tsx @@ -1,6 +1,6 @@ import { useState, useEffect, useRef, useCallback } from 'react' import { useLocation, useNavigate } from 'react-router-dom' -import { Sparkles, Send, Loader2, Flag } from 'lucide-react' +import { Sparkles, Send, Loader2, Flag, MessageSquare } from 'lucide-react' import { PageMeta } from '@/components/common/PageMeta' import { assistantChatApi } from '@/api/assistantChat' import { analytics } from '@/lib/analytics' @@ -24,6 +24,7 @@ export default function AssistantChatPage() { const [input, setInput] = useState('') const [loading, setLoading] = useState(false) const [showConclude, setShowConclude] = useState(false) + const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false) const messagesEndRef = useRef(null) const inputRef = useRef(null) const prefillHandledRef = useRef(false) @@ -232,22 +233,54 @@ export default function AssistantChatPage() { <>
- {/* Sidebar */} - + {/* Sidebar — hidden on mobile, slide-out via toggle */} +
+ +
+
+ setMobileSidebarOpen(false)} + /> +
{/* Main chat area */}
+ {/* Mobile header with chat history toggle */} +
+ +
+ +
+ {activeChatId ? ( <> {/* Messages */} -
+
{messages.length === 0 && !loading && (
@@ -284,7 +317,7 @@ export default function AssistantChatPage() {
{/* Input */} -
+