From 3a26aac9498a8adc49c1712a8fcd3cd3babc3f68 Mon Sep 17 00:00:00 2001
From: ramnique <30795890+ramnique@users.noreply.github.com>
Date: Wed, 19 Mar 2025 00:17:06 +0530
Subject: [PATCH] relocate mcp tool import btn
---
.../app/lib/components/structured-list.tsx | 23 ++++------
.../[projectId]/workflow/entity_list.tsx | 44 ++++++++++++++++---
.../[projectId]/workflow/workflow_editor.tsx | 14 +++---
3 files changed, 51 insertions(+), 30 deletions(-)
diff --git a/apps/rowboat/app/lib/components/structured-list.tsx b/apps/rowboat/app/lib/components/structured-list.tsx
index f957c98f..5bb9e0f6 100644
--- a/apps/rowboat/app/lib/components/structured-list.tsx
+++ b/apps/rowboat/app/lib/components/structured-list.tsx
@@ -1,31 +1,26 @@
import clsx from "clsx";
import { ActionButton } from "./structured-panel";
-export function SectionHeader({ title, onAdd }: { title: string; onAdd: () => void }) {
+export function SectionHeader({ title, children }: { title: string; children: React.ReactNode }) {
return (
{title}
-
-
- }
- onClick={onAdd}
- >
- Add
-
+
+ {children}
+
);
}
-export function ListItem({
- name,
- isSelected,
- onClick,
+export function ListItem({
+ name,
+ isSelected,
+ onClick,
disabled,
rightElement,
selectedRef,
icon
-}: {
+}: {
name: string;
isSelected: boolean;
onClick: () => void;
diff --git a/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx b/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx
index 278a4bc3..9dca2490 100644
--- a/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx
+++ b/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx
@@ -6,7 +6,7 @@ import { Dropdown, DropdownItem, DropdownTrigger, DropdownMenu } from "@heroui/r
import { useRef, useEffect } from "react";
import { ActionButton, StructuredPanel } from "../../../lib/components/structured-panel";
import clsx from "clsx";
-import { EllipsisVerticalIcon, ImportIcon } from "lucide-react";
+import { EllipsisVerticalIcon, ImportIcon, PlusIcon } from "lucide-react";
import { SectionHeader, ListItem } from "../../../lib/components/structured-list";
interface EntityListProps {
@@ -29,6 +29,7 @@ interface EntityListProps {
onDeleteAgent: (name: string) => void;
onDeleteTool: (name: string) => void;
onDeletePrompt: (name: string) => void;
+ triggerMcpImport: () => void;
}
export function EntityList({
@@ -48,6 +49,7 @@ export function EntityList({
onDeleteAgent,
onDeleteTool,
onDeletePrompt,
+ triggerMcpImport,
}: EntityListProps) {
const selectedRef = useRef(null);
@@ -58,13 +60,20 @@ export function EntityList({
}, [selectedEntity]);
return (
-
{/* Agents Section */}
-
onAddAgent({})} />
+
+ }
+ onClick={() => onAddAgent({})}
+ >
+ Add
+
+
{agents.map((agent, index) => (
onAddTool({})} />
+
+ }
+ onClick={() => onAddTool({})}
+ >
+ Add
+
+ }
+ onClick={triggerMcpImport}
+ >
+ MCP
+
+
+
{tools.map((tool, index) => (
onSelectTool(tool.name)}
selectedRef={selectedEntity?.type === "tool" && selectedEntity.name === tool.name ? selectedRef : undefined}
rightElement={}
- icon={tool.isMcp ? : <>>}
+ icon={tool.isMcp ? : undefined}
/>
))}
{/* Prompts Section */}
- onAddPrompt({})} />
+
+ }
+ onClick={() => onAddPrompt({})}
+ >
+ Add
+
+
{prompts.map((prompt, index) => (
) => {
if (saving.current || saveQueue.current.length === 0) return;
@@ -791,9 +795,6 @@ export function WorkflowEditor({
if (key === 'clipboard') {
handleCopyJSON();
}
- if (key === 'mcp') {
- setIsMcpImportModalOpen(true);
- }
}}
>
Copy as JSON
- }
- >
- MCP: Import tools
-
@@ -901,6 +896,7 @@ export function WorkflowEditor({
onDeleteAgent={handleDeleteAgent}
onDeleteTool={handleDeleteTool}
onDeletePrompt={handleDeletePrompt}
+ triggerMcpImport={triggerMcpImport}
/>