feat: integrate ScrollArea component for improved node menu scrolling
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useEffect, useMemo, useRef } from "react"
|
||||
|
||||
import { ScrollArea } from "@/components/ui/scroll-area"
|
||||
import type { AIWorkflowNodeSpec } from "@/lib/api/admin"
|
||||
import { WorkflowNodeIcon } from "./workflow-node-icon"
|
||||
|
||||
@@ -70,7 +71,8 @@ export function WorkflowPortNodeMenu({
|
||||
<div className="border-b border-slate-100 px-3 pb-2 pt-1 text-xs font-medium text-slate-500">
|
||||
添加节点
|
||||
</div>
|
||||
<div className="max-h-80 overflow-y-auto p-1.5">
|
||||
<ScrollArea className="h-80 max-h-[min(20rem,calc(100vh-8rem))]">
|
||||
<div className="p-1.5">
|
||||
{insertableNodeSpecs.map((spec) => (
|
||||
<button
|
||||
key={spec.type}
|
||||
@@ -95,6 +97,7 @@ export function WorkflowPortNodeMenu({
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user