Spaces:
Running

axeronis commited on
Commit
ef12a34
·
1 Parent(s): 3f16f9b

fix: Gesture logic - restricted list view to avatar click, enabled full-area swipe in dialogue

Browse files
frontend/app/chats/page.tsx CHANGED
@@ -303,27 +303,6 @@ function ChatsContent() {
303
  )}
304
  </div>
305
 
306
- {/* Swipe to Open Summary Zone (Right Edge) */}
307
- {!isMobileSummaryOpen && !selectedLead && (
308
- <div
309
- className="lg:hidden fixed right-0 top-16 bottom-14 w-6 z-20 cursor-w-resize"
310
- onTouchStart={(e) => {
311
- const startX = e.touches[0].clientX
312
- const handleTouchMove = (moveEvent: TouchEvent) => {
313
- const moveX = moveEvent.touches[0].clientX
314
- if (startX - moveX > 40) { // Swipe left
315
- setIsMobileSummaryOpen(true)
316
- document.removeEventListener('touchmove', handleTouchMove)
317
- }
318
- }
319
- document.addEventListener('touchmove', handleTouchMove)
320
- document.addEventListener('touchend', () => {
321
- document.removeEventListener('touchmove', handleTouchMove)
322
- }, { once: true })
323
- }}
324
- />
325
- )}
326
-
327
  {/* Mobile Drawer for AI Summary */}
328
  <AnimatePresence>
329
  {isMobileSummaryOpen && summaryLead && (
 
303
  )}
304
  </div>
305
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  {/* Mobile Drawer for AI Summary */}
307
  <AnimatePresence>
308
  {isMobileSummaryOpen && summaryLead && (
frontend/components/ChatWindow.tsx CHANGED
@@ -341,7 +341,32 @@ export function ChatWindow({
341
  />
342
 
343
  {/* Messages Area - with extra padding for fixed header/input on mobile */}
344
- <div className="flex-1 overflow-y-auto p-4 md:p-6 pt-16 md:pt-6 pb-24 md:pb-6 space-y-6 bg-[#0D0E18] scrollbar-thin scrollbar-thumb-white/10">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  {isLoading ? (
346
  <div className="flex items-center justify-center h-full">
347
  <Loader2 className="w-8 h-8 animate-spin text-indigo-500" />
@@ -395,27 +420,6 @@ export function ChatWindow({
395
  isSending={isSending}
396
  />
397
 
398
- {/* Swipe to Open Summary Zone (Right Edge) */}
399
- {!isMobileDrawerOpen && (
400
- <div
401
- className="md:hidden fixed right-0 top-16 bottom-14 w-6 z-20 cursor-w-resize"
402
- onTouchStart={(e) => {
403
- const startX = e.touches[0].clientX
404
- const handleTouchMove = (moveEvent: TouchEvent) => {
405
- const moveX = moveEvent.touches[0].clientX
406
- if (startX - moveX > 40) { // Swipe left
407
- setIsMobileDrawerOpen(true)
408
- document.removeEventListener('touchmove', handleTouchMove)
409
- }
410
- }
411
- document.addEventListener('touchmove', handleTouchMove)
412
- document.addEventListener('touchend', () => {
413
- document.removeEventListener('touchmove', handleTouchMove)
414
- }, { once: true })
415
- }}
416
- />
417
- )}
418
-
419
  {/* Mobile Drawer (AI Summary Intelligence) */}
420
  <AnimatePresence>
421
  {isMobileDrawerOpen && lead && (
 
341
  />
342
 
343
  {/* Messages Area - with extra padding for fixed header/input on mobile */}
344
+ <div
345
+ className="flex-1 overflow-y-auto p-4 md:p-6 pt-16 md:pt-6 pb-24 md:pb-6 space-y-6 bg-[#0D0E18] scrollbar-thin scrollbar-thumb-white/10"
346
+ onTouchStart={(e) => {
347
+ if (window.innerWidth >= 768) return
348
+ const startX = e.touches[0].clientX
349
+ const startY = e.touches[0].clientY
350
+
351
+ const handleTouchMove = (moveEvent: TouchEvent) => {
352
+ const moveX = moveEvent.touches[0].clientX
353
+ const moveY = moveEvent.touches[0].clientY
354
+
355
+ // Check if it's horizontal swipe
356
+ if (Math.abs(startX - moveX) > Math.abs(startY - moveY)) {
357
+ if (startX - moveX > 50) { // Swipe left
358
+ setIsMobileDrawerOpen(true)
359
+ document.removeEventListener('touchmove', handleTouchMove)
360
+ }
361
+ }
362
+ }
363
+
364
+ document.addEventListener('touchmove', handleTouchMove)
365
+ document.addEventListener('touchend', () => {
366
+ document.removeEventListener('touchmove', handleTouchMove)
367
+ }, { once: true })
368
+ }}
369
+ >
370
  {isLoading ? (
371
  <div className="flex items-center justify-center h-full">
372
  <Loader2 className="w-8 h-8 animate-spin text-indigo-500" />
 
420
  isSending={isSending}
421
  />
422
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  {/* Mobile Drawer (AI Summary Intelligence) */}
424
  <AnimatePresence>
425
  {isMobileDrawerOpen && lead && (