Merge branch 'main-fix'
This commit is contained in:
@@ -1,14 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import {
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react"
|
||||||
memo,
|
|
||||||
Fragment,
|
|
||||||
useCallback,
|
|
||||||
useEffect,
|
|
||||||
useMemo,
|
|
||||||
useRef,
|
|
||||||
useState,
|
|
||||||
} from "react"
|
|
||||||
import { Plus, RefreshCw, X } from "lucide-react"
|
import { Plus, RefreshCw, X } from "lucide-react"
|
||||||
import { useTranslations } from "next-intl"
|
import { useTranslations } from "next-intl"
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner"
|
||||||
@@ -63,11 +55,6 @@ import {
|
|||||||
ContextMenuSeparator,
|
ContextMenuSeparator,
|
||||||
ContextMenuTrigger,
|
ContextMenuTrigger,
|
||||||
} from "@/components/ui/context-menu"
|
} from "@/components/ui/context-menu"
|
||||||
import {
|
|
||||||
ResizableHandle,
|
|
||||||
ResizablePanel,
|
|
||||||
ResizablePanelGroup,
|
|
||||||
} from "@/components/ui/resizable"
|
|
||||||
|
|
||||||
interface ConversationTabViewProps {
|
interface ConversationTabViewProps {
|
||||||
tabId: string
|
tabId: string
|
||||||
@@ -1205,68 +1192,44 @@ export function ConversationDetailPanel() {
|
|||||||
return (
|
return (
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<ContextMenuTrigger asChild>
|
<ContextMenuTrigger asChild>
|
||||||
<div className="relative h-full min-h-0 overflow-hidden">
|
<div
|
||||||
{canTile ? (
|
className={cn(
|
||||||
<ResizablePanelGroup direction="horizontal">
|
"relative h-full min-h-0 overflow-hidden",
|
||||||
{tabs.map((tab, index) => {
|
canTile && "flex flex-row"
|
||||||
const active = tab.id === activeTabId
|
)}
|
||||||
return (
|
>
|
||||||
<Fragment key={tab.id}>
|
{tabs.map((tab, index) => {
|
||||||
{index > 0 && <ResizableHandle withHandle />}
|
const active = tab.id === activeTabId
|
||||||
<ResizablePanel
|
return (
|
||||||
id={`tile-${tab.id}`}
|
<div
|
||||||
order={index}
|
key={tab.id}
|
||||||
minSize={15}
|
className={cn(
|
||||||
>
|
canTile
|
||||||
<div
|
? cn(
|
||||||
className={cn(
|
"relative h-full min-w-[200px] flex-1 overflow-hidden",
|
||||||
"h-full",
|
index > 0 && "border-l border-border",
|
||||||
active
|
active &&
|
||||||
? "bg-gradient-to-b from-muted/50 to-transparent"
|
"bg-gradient-to-b from-muted/50 to-transparent"
|
||||||
: ""
|
)
|
||||||
)}
|
: active
|
||||||
onPointerDownCapture={() => {
|
|
||||||
if (!active) switchTab(tab.id)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ConversationTabView
|
|
||||||
tabId={tab.id}
|
|
||||||
conversationId={tab.conversationId}
|
|
||||||
agentType={tab.agentType}
|
|
||||||
workingDir={tab.workingDir ?? folder?.path}
|
|
||||||
isActive={active}
|
|
||||||
reloadSignal={reloadByTabId[tab.id] ?? 0}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</ResizablePanel>
|
|
||||||
</Fragment>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
</ResizablePanelGroup>
|
|
||||||
) : (
|
|
||||||
tabs.map((tab) => {
|
|
||||||
const active = tab.id === activeTabId
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={tab.id}
|
|
||||||
className={
|
|
||||||
active
|
|
||||||
? "h-full"
|
? "h-full"
|
||||||
: "absolute inset-0 invisible pointer-events-none"
|
: "absolute inset-0 invisible pointer-events-none"
|
||||||
}
|
)}
|
||||||
>
|
onPointerDownCapture={
|
||||||
<ConversationTabView
|
canTile && !active ? () => switchTab(tab.id) : undefined
|
||||||
tabId={tab.id}
|
}
|
||||||
conversationId={tab.conversationId}
|
>
|
||||||
agentType={tab.agentType}
|
<ConversationTabView
|
||||||
workingDir={tab.workingDir ?? folder?.path}
|
tabId={tab.id}
|
||||||
isActive={active}
|
conversationId={tab.conversationId}
|
||||||
reloadSignal={reloadByTabId[tab.id] ?? 0}
|
agentType={tab.agentType}
|
||||||
/>
|
workingDir={tab.workingDir ?? folder?.path}
|
||||||
</div>
|
isActive={active}
|
||||||
)
|
reloadSignal={reloadByTabId[tab.id] ?? 0}
|
||||||
})
|
/>
|
||||||
)}
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</ContextMenuTrigger>
|
</ContextMenuTrigger>
|
||||||
<ContextMenuContent>
|
<ContextMenuContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user