From fc174d8692de9f4fa9ebd01605e46f17fc9e768a Mon Sep 17 00:00:00 2001 From: xintaofei Date: Wed, 22 Apr 2026 01:20:21 +0800 Subject: [PATCH] refactor(conversation): add horizontal scrollbar and min width to tiled tabs --- .../conversation-detail-panel.tsx | 77 ++++++++++--------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/src/components/conversations/conversation-detail-panel.tsx b/src/components/conversations/conversation-detail-panel.tsx index 152709e..1a09997 100644 --- a/src/components/conversations/conversation-detail-panel.tsx +++ b/src/components/conversations/conversation-detail-panel.tsx @@ -35,6 +35,7 @@ import { MessageListView } from "@/components/message/message-list-view" import { ConversationShell } from "@/components/chat/conversation-shell" import { AgentSelector } from "@/components/chat/agent-selector" import { ChatInput } from "@/components/chat/chat-input" +import { ScrollArea } from "@/components/ui/scroll-area" import { acpFork, createConversation, @@ -1393,48 +1394,52 @@ export function ConversationDetailPanel() { return null } + const tabElements = 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 + } + > + +
+ ) + }) + 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 - } - > - -
- ) - })} + {canTile ? ( + +
{tabElements}
+
+ ) : ( + tabElements + )}