Spaces:
Running
Running
axeronis commited on
Commit ·
d9dfc5e
1
Parent(s): d1dbc46
feat: enable 2-column chat layout for tablets (md+ breakpoint)
Browse files
frontend/app/chats/page.tsx
CHANGED
|
@@ -89,8 +89,8 @@ function ChatsContent() {
|
|
| 89 |
|
| 90 |
// If no valid target found (or ID invalid)
|
| 91 |
if (!targetLead && !selectedLead) {
|
| 92 |
-
// On mobile, DO NOT auto-select the first lead. Show list instead.
|
| 93 |
-
if (
|
| 94 |
targetLead = leads[0]
|
| 95 |
}
|
| 96 |
|
|
@@ -235,10 +235,10 @@ function ChatsContent() {
|
|
| 235 |
{/* Left Column: Leads List */}
|
| 236 |
<div className={cn(
|
| 237 |
"h-full border-r border-white/10 flex flex-col transition-all duration-300 z-10 bg-background shrink-0",
|
| 238 |
-
//
|
| 239 |
-
"
|
| 240 |
-
// Mobile: Full width if no lead selected, else hidden
|
| 241 |
-
selectedLead ? "hidden
|
| 242 |
)}>
|
| 243 |
{/* List Container - Let LeadsList handle internal scrolling */}
|
| 244 |
<div className="flex-1 min-h-0">
|
|
@@ -262,8 +262,8 @@ function ChatsContent() {
|
|
| 262 |
<div className={cn(
|
| 263 |
"flex-1 h-full flex flex-col relative z-10 bg-surface transition-all duration-300",
|
| 264 |
// Mobile: Show only when lead selected
|
| 265 |
-
// Desktop: Always show
|
| 266 |
-
selectedLead ? "flex" : "hidden
|
| 267 |
)}>
|
| 268 |
{selectedLead ? (
|
| 269 |
<ChatWindow
|
|
|
|
| 89 |
|
| 90 |
// If no valid target found (or ID invalid)
|
| 91 |
if (!targetLead && !selectedLead) {
|
| 92 |
+
// On small mobile, DO NOT auto-select the first lead. Show list instead.
|
| 93 |
+
if (window.innerWidth < 768) return
|
| 94 |
targetLead = leads[0]
|
| 95 |
}
|
| 96 |
|
|
|
|
| 235 |
{/* Left Column: Leads List */}
|
| 236 |
<div className={cn(
|
| 237 |
"h-full border-r border-white/10 flex flex-col transition-all duration-300 z-10 bg-background shrink-0",
|
| 238 |
+
// Mobile/Tablet: Width starts from md (768px)
|
| 239 |
+
"md:w-[320px] xl:w-[380px]",
|
| 240 |
+
// Mobile: Full width if no lead selected, else hidden. Tablet/Desktop: Always show.
|
| 241 |
+
selectedLead ? "hidden md:flex" : "w-full flex"
|
| 242 |
)}>
|
| 243 |
{/* List Container - Let LeadsList handle internal scrolling */}
|
| 244 |
<div className="flex-1 min-h-0">
|
|
|
|
| 262 |
<div className={cn(
|
| 263 |
"flex-1 h-full flex flex-col relative z-10 bg-surface transition-all duration-300",
|
| 264 |
// Mobile: Show only when lead selected
|
| 265 |
+
// Tablet/Desktop: Always show
|
| 266 |
+
selectedLead ? "flex" : "hidden md:flex"
|
| 267 |
)}>
|
| 268 |
{selectedLead ? (
|
| 269 |
<ChatWindow
|
frontend/components/ChatWindow/ChatHeader.tsx
CHANGED
|
@@ -39,18 +39,18 @@ export function ChatHeader({
|
|
| 39 |
|
| 40 |
{/* Left: Lead Info */}
|
| 41 |
<div className="flex items-center gap-3 overflow-hidden">
|
| 42 |
-
{/* Back Button (
|
| 43 |
<button
|
| 44 |
onClick={onBack}
|
| 45 |
-
className="
|
| 46 |
>
|
| 47 |
<ArrowLeft className="w-5 h-5" />
|
| 48 |
</button>
|
| 49 |
|
| 50 |
-
{/* Desktop Toggle */}
|
| 51 |
<button
|
| 52 |
onClick={onToggleLeadsList}
|
| 53 |
-
className="hidden
|
| 54 |
title={isLeadsListOpen ? "Скрыть список" : "Показать список"}
|
| 55 |
>
|
| 56 |
{isLeadsListOpen ? <ArrowLeft className="w-5 h-5" /> : <MoreVertical className="w-5 h-5 rotate-90" />}
|
|
@@ -141,10 +141,10 @@ export function ChatHeader({
|
|
| 141 |
</button>
|
| 142 |
</div>
|
| 143 |
|
| 144 |
-
{/* AI Summary Button - Hidden on
|
| 145 |
<button
|
| 146 |
onClick={onOpenMobileDrawer}
|
| 147 |
-
className="
|
| 148 |
title="Посмотреть AI-анализ"
|
| 149 |
>
|
| 150 |
<Brain className="w-5 h-5" />
|
|
|
|
| 39 |
|
| 40 |
{/* Left: Lead Info */}
|
| 41 |
<div className="flex items-center gap-3 overflow-hidden">
|
| 42 |
+
{/* Back Button (Phone only) */}
|
| 43 |
<button
|
| 44 |
onClick={onBack}
|
| 45 |
+
className="md:hidden p-2 -ml-2 text-slate-400 hover:text-white hover:bg-white/10 rounded-full transition-colors"
|
| 46 |
>
|
| 47 |
<ArrowLeft className="w-5 h-5" />
|
| 48 |
</button>
|
| 49 |
|
| 50 |
+
{/* Tablet/Desktop Toggle */}
|
| 51 |
<button
|
| 52 |
onClick={onToggleLeadsList}
|
| 53 |
+
className="hidden md:flex p-2 -ml-2 text-slate-400 hover:text-indigo-400 hover:bg-white/5 rounded-lg transition-all"
|
| 54 |
title={isLeadsListOpen ? "Скрыть список" : "Показать список"}
|
| 55 |
>
|
| 56 |
{isLeadsListOpen ? <ArrowLeft className="w-5 h-5" /> : <MoreVertical className="w-5 h-5 rotate-90" />}
|
|
|
|
| 141 |
</button>
|
| 142 |
</div>
|
| 143 |
|
| 144 |
+
{/* AI Summary Button - Hidden on md+ where ClientCard is visible or layout is dual-col */}
|
| 145 |
<button
|
| 146 |
onClick={onOpenMobileDrawer}
|
| 147 |
+
className="md:hidden p-2 text-slate-400 hover:text-indigo-400 hover:bg-white/5 rounded-lg transition-all"
|
| 148 |
title="Посмотреть AI-анализ"
|
| 149 |
>
|
| 150 |
<Brain className="w-5 h-5" />
|