Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(frontend): add selecting UI for custom node in new builder (#11091)

Abhimanyu Yadav2d8ab6b7c0c5
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode.tsx
index aa8e85bf84..8ceb3cffbe 100644
--- a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode.tsx
@@ -8,6 +8,7 @@ import { Switch } from "@/components/atoms/Switch/Switch";
import { preprocessInputSchema } from "../processors/input-schema-pre-processor";
import { OutputHandler } from "./OutputHandler";
import { useNodeStore } from "../../../stores/nodeStore";
+import { cn } from "@/lib/utils";
export type CustomNodeData = {
hardcodedValues: {
@@ -22,14 +23,19 @@ export type CustomNodeData = {
export type CustomNode = XYNode<CustomNodeData, "custom">;
export const CustomNode: React.FC<NodeProps<CustomNode>> = React.memo(
- ({ data, id }) => {
+ ({ data, id, selected }) => {
const showAdvanced = useNodeStore(
(state) => state.nodeAdvancedStates[id] || false,
);
const setShowAdvanced = useNodeStore((state) => state.setShowAdvanced);
return (
- <div className="rounded-xl border border-slate-200/60 bg-gradient-to-br from-white to-slate-50/30 shadow-lg shadow-slate-900/5 backdrop-blur-sm">
+ <div
+ className={cn(
+ "rounded-xl border border-slate-200/60 bg-gradient-to-br from-white to-slate-50/30 shadow-lg shadow-slate-900/5 backdrop-blur-sm",
+ selected && "border-2 border-slate-200 shadow-2xl",
+ )}
+ >
{/* Header */}
<div className="flex h-14 items-center justify-center rounded-xl border-b border-slate-200/50 bg-gradient-to-r from-slate-50/80 to-white/90">
<Text