From c983779dead5a30ab63908c2fd5401dde3e7cc43 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Wed, 1 Apr 2026 13:00:37 +0800 Subject: [PATCH] fix: resolve real-time update issue in tiled view with multiple active sessions --- .../conversation-detail-panel.tsx | 111 ++++++------------ 1 file changed, 37 insertions(+), 74 deletions(-) diff --git a/src/components/conversations/conversation-detail-panel.tsx b/src/components/conversations/conversation-detail-panel.tsx index 5ea1542..b743a30 100644 --- a/src/components/conversations/conversation-detail-panel.tsx +++ b/src/components/conversations/conversation-detail-panel.tsx @@ -1,14 +1,6 @@ "use client" -import { - memo, - Fragment, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from "react" +import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react" import { Plus, RefreshCw, X } from "lucide-react" import { useTranslations } from "next-intl" import { toast } from "sonner" @@ -63,11 +55,6 @@ import { ContextMenuSeparator, ContextMenuTrigger, } from "@/components/ui/context-menu" -import { - ResizableHandle, - ResizablePanel, - ResizablePanelGroup, -} from "@/components/ui/resizable" interface ConversationTabViewProps { tabId: string @@ -1188,68 +1175,44 @@ export function ConversationDetailPanel() { return ( -
- {canTile ? ( - - {tabs.map((tab, index) => { - const active = tab.id === activeTabId - return ( - - {index > 0 && } - -
{ - if (!active) switchTab(tab.id) - }} - > - -
-
-
- ) - })} -
- ) : ( - tabs.map((tab) => { - const active = tab.id === activeTabId - return ( -
+ {tabs.map((tab, index) => { + const active = tab.id === activeTabId + return ( +
0 && "border-l border-border", + active && + "bg-gradient-to-b from-muted/50 to-transparent" + ) + : active ? "h-full" : "absolute inset-0 invisible pointer-events-none" - } - > - -
- ) - }) - )} + )} + onPointerDownCapture={ + canTile && !active ? () => switchTab(tab.id) : undefined + } + > + +
+ ) + })}