Spaces:
Sleeping
Sleeping
axeronis commited on
Commit ·
c950923
1
Parent(s): 8e4a89e
fix: Chats layout scroll, heat icon, robust sorting
Browse filesFiles changed (2)
186 unmodified lines187188189190191192193194186 unmodified lines// Mobile: Full width if no lead selected, else hiddenselectedLead ? "hidden md:flex" : "w-full flex")}>{/* Scrollable Container for List */}<div className="flex-1 overflow-y-auto custom-scrollbar"><LeadsListleads={leads}isLoading={leadsLoading}186 unmodified lines187188189190191192193194186 unmodified lines// Mobile: Full width if no lead selected, else hiddenselectedLead ? "hidden md:flex" : "w-full flex")}>{/* List Container - Let LeadsList handle internal scrolling */}<div className="flex-1 min-h-0"><LeadsListleads={leads}isLoading={leadsLoading}
81 unmodified lines8283848586878889909192939474 unmodified lines16917017117217317417517690 unmodified lines26726826927027127227327481 unmodified lines// Hottest first (HOT at top, then WARM, then COLD)const heatOrder: Record<string, number> = { 'HOT': 0, 'WARM': 1, 'COLD': 2 }result = [...result].sort((a, b) =>(heatOrder[a.heat_level || 'COLD'] || 2) - (heatOrder[b.heat_level || 'COLD'] || 2))} else if (activeTab === 'whatsapp') {// Coldest first (COLD at top, then WARM, then HOT)const heatOrder: Record<string, number> = { 'COLD': 0, 'WARM': 1, 'HOT': 2 }result = [...result].sort((a, b) =>(heatOrder[a.heat_level || 'COLD'] || 0) - (heatOrder[b.heat_level || 'COLD'] || 0))}74 unmodified lines)}<div className="flex flex-col h-full bg-[#0D0E18] border-r border-white/10">{/* Header & Search - STICKY */}<div className="sticky top-0 z-10 p-3 border-b border-white/10 space-y-2 flex-shrink-0 bg-[#0D0E18]"><h2 className="text-lg font-bold text-white tracking-tight">{t('chats.title')}</h2>{/* Search */}90 unmodified lines{/* Online/Status Indicator */}<div className={cn("absolute bottom-0 right-0 w-3 h-3 rounded-full border-2 border-[#0D0E18]",lead.heat_level === 'HOT' ? "bg-red-500" : "bg-green-500")} /></div><div className="flex-1 min-w-0">81 unmodified lines8283848586878889909192939474 unmodified lines16917017117217317417517690 unmodified lines26726826927027127227327427527627727827928028128228328428581 unmodified lines// Hottest first (HOT at top, then WARM, then COLD)const heatOrder: Record<string, number> = { 'HOT': 0, 'WARM': 1, 'COLD': 2 }result = [...result].sort((a, b) =>(heatOrder[(a.heat_level || 'COLD').toUpperCase()] ?? 2) - (heatOrder[(b.heat_level || 'COLD').toUpperCase()] ?? 2))} else if (activeTab === 'whatsapp') {// Coldest first (COLD at top, then WARM, then HOT)const heatOrder: Record<string, number> = { 'COLD': 0, 'WARM': 1, 'HOT': 2 }result = [...result].sort((a, b) =>(heatOrder[(a.heat_level || 'COLD').toUpperCase()] ?? 0) - (heatOrder[(b.heat_level || 'COLD').toUpperCase()] ?? 0))}74 unmodified lines)}<div className="flex flex-col h-full bg-[#0D0E18] border-r border-white/10">{/* Header & Search - Fixed at top via flex parent */}<div className="p-3 border-b border-white/10 space-y-2 flex-shrink-0 bg-[#0D0E18] z-10"><h2 className="text-lg font-bold text-white tracking-tight">{t('chats.title')}</h2>{/* Search */}90 unmodified lines{/* Online/Status Indicator */}<div className={cn("absolute bottom-0 right-0 w-3 h-3 rounded-full border-2 border-[#0D0E18]",lead.heat_level === 'HOT' ? "bg-red-500" :lead.heat_level === 'WARM' ? "bg-orange-500" : "bg-green-500")} />{/* Heat Icon Indicator - visual cue next to avatar */}{(lead.heat_level === 'HOT' || lead.heat_level === 'WARM') && (<div className="absolute -top-1 -right-1 bg-[#0D0E18] rounded-full p-0.5 border border-white/10"><Flame className={cn("w-3 h-3",lead.heat_level === 'HOT' ? "text-red-500 fill-red-500" : "text-orange-500 fill-orange-500")} /></div>)}</div><div className="flex-1 min-w-0">
frontend/app/chats/page.tsx+2-2
frontend/components/LeadsList.tsx+16-5