Spaces:
Running

axeronis commited on
Commit
ab96df2
·
1 Parent(s): 3118010

fix: welcome message tenant_id null, heat level color case, smooth scroll everywhere

Browse files
backend/app/api/webhook.py CHANGED
@@ -685,9 +685,11 @@ async def telegram_webhook(
685
  # SAVE to conversation history so AI knows what was said
686
  # Note: Message is already imported at top of file
687
  welcome_msg = Message(
 
688
  conversation_id=conversation.id,
689
  sender_type="ai",
690
- content=welcome_message
 
691
  )
692
  session.add(welcome_msg)
693
  await session.commit()
 
685
  # SAVE to conversation history so AI knows what was said
686
  # Note: Message is already imported at top of file
687
  welcome_msg = Message(
688
+ tenant_id=tenant_id, # Required field!
689
  conversation_id=conversation.id,
690
  sender_type="ai",
691
+ content=welcome_message,
692
+ status=MessageStatus.SENT
693
  )
694
  session.add(welcome_msg)
695
  await session.commit()
frontend/components/ChatWindow.tsx CHANGED
@@ -414,9 +414,11 @@ export function ChatWindow({
414
 
415
  {/* Messages Area */}
416
  <div
417
- className="flex-1 overflow-y-auto px-4 md:px-6 space-y-6 scrollbar-thin scrollbar-thumb-white/10"
418
  style={{
419
  WebkitOverflowScrolling: 'touch',
 
 
420
  }}
421
  >
422
  {/* Top spacer to show content blurring behind header when scrolling */}
 
414
 
415
  {/* Messages Area */}
416
  <div
417
+ className="flex-1 overflow-y-auto px-4 md:px-6 space-y-6 scrollbar-thin scrollbar-thumb-white/10 scroll-smooth"
418
  style={{
419
  WebkitOverflowScrolling: 'touch',
420
+ willChange: 'scroll-position',
421
+ transform: 'translateZ(0)'
422
  }}
423
  >
424
  {/* Top spacer to show content blurring behind header when scrolling */}
frontend/components/LeadsList.tsx CHANGED
@@ -260,9 +260,9 @@ export function LeadsList({
260
 
261
  {/* List Content - with bottom padding for mobile nav */}
262
  <div
263
- className="flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-white/10 p-2 pb-16 md:pb-2 space-y-1"
264
  style={{
265
- willChange: 'transform',
266
  transform: 'translateZ(0)',
267
  WebkitOverflowScrolling: 'touch'
268
  }}
@@ -314,9 +314,13 @@ export function LeadsList({
314
  {/* Heat Level Indicator with Escalation Pulse */}
315
  <div className={cn(
316
  "absolute -top-0.5 -right-0.5 w-3.5 h-3.5 rounded-full border-2 border-[#0D0E18] transition-all",
317
- (!lead.heat_level || lead.heat_level === 'COLD') ? "bg-blue-500" :
318
- lead.heat_level === 'WARM' ? "bg-orange-500" :
319
- "bg-red-500", // HOT
 
 
 
 
320
  // Pulsing ring when needs attention
321
  lead.needs_attention && "animate-pulse ring-2 ring-red-500/60 ring-offset-1 ring-offset-[#0D0E18]"
322
  )} />
 
260
 
261
  {/* List Content - with bottom padding for mobile nav */}
262
  <div
263
+ className="flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-white/10 p-2 pb-16 md:pb-2 space-y-1 scroll-smooth"
264
  style={{
265
+ willChange: 'scroll-position',
266
  transform: 'translateZ(0)',
267
  WebkitOverflowScrolling: 'touch'
268
  }}
 
314
  {/* Heat Level Indicator with Escalation Pulse */}
315
  <div className={cn(
316
  "absolute -top-0.5 -right-0.5 w-3.5 h-3.5 rounded-full border-2 border-[#0D0E18] transition-all",
317
+ (() => {
318
+ const heat = (lead.heat_level || '').toLowerCase()
319
+ if (heat === 'hot') return "bg-red-500"
320
+ if (heat === 'warm') return "bg-orange-500"
321
+ if (heat === 'junk') return "bg-slate-500"
322
+ return "bg-blue-500" // cold or default
323
+ })(),
324
  // Pulsing ring when needs attention
325
  lead.needs_attention && "animate-pulse ring-2 ring-red-500/60 ring-offset-1 ring-offset-[#0D0E18]"
326
  )} />