fix(conversation-detail-panel): keep tab subtree mounted across tile-mode layout switch

This commit is contained in:
xintaofei
2026-04-22 21:25:09 +08:00
parent c11a57921d
commit 8095a75b5f

View File

@@ -1433,13 +1433,21 @@ export function ConversationDetailPanel() {
className="relative h-full min-h-0 overflow-hidden"
onPointerDown={handleContextMenuTriggerPointerDown}
>
{canTile ? (
<ScrollArea x="scroll" y="hidden" className="h-full w-full">
<div className="flex h-full flex-row">{tabElements}</div>
</ScrollArea>
) : (
tabElements
{/* Stable wrapper across canTile flip — otherwise sibling tabs remount and a live streaming response is torn down. */}
<ScrollArea
x={canTile ? "scroll" : "hidden"}
y="hidden"
className="h-full w-full"
>
<div
className={cn(
"relative h-full",
canTile && "flex min-w-full flex-row"
)}
>
{tabElements}
</div>
</ScrollArea>
</div>
</ContextMenuTrigger>
<ContextMenuContent>