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.

tweak(builder): Node styling (#7763)

Swifty85d895ef77dd
diff --git a/rnd/autogpt_builder/src/components/CustomNode.tsx b/rnd/autogpt_builder/src/components/CustomNode.tsx
index edbbd400ce..3a30709bf3 100644
--- a/rnd/autogpt_builder/src/components/CustomNode.tsx
+++ b/rnd/autogpt_builder/src/components/CustomNode.tsx
@@ -314,11 +314,11 @@ const CustomNode: FC<NodeProps<CustomNodeData>> = ({ data, id }) => {
return (
<div
- className={`custom-node overflow-hidden dark-theme border-4 rounded-xl ${data.status?.toLowerCase() ?? ""}`}
+ className={`custom-node dark-theme border rounded-xl shandow-md bg-white/[.8] ${data.status?.toLowerCase() ?? ""}`}
onMouseEnter={handleHovered}
onMouseLeave={handleMouseLeave}
>
- <div className="mb-2 p-3 bg-gray-300">
+ <div className="mb-2 p-3 bg-gray-300 rounded-t-xl">
<div className="p-3 text-lg font-bold">
{beautifyString(data.blockType?.replace(/Block$/, "") || data.title)}
</div>
@@ -411,7 +411,7 @@ const CustomNode: FC<NodeProps<CustomNodeData>> = ({ data, id }) => {
</p>
</div>
)}
- <div className="flex items-center mt-2.5">
+ <div className="flex items-center pl-4 pb-4 mt-2.5">
<Switch onCheckedChange={toggleOutput} />
<span className="m-1 mr-4">Output</span>
{hasOptionalFields && (
diff --git a/rnd/autogpt_builder/src/components/NodeHandle.tsx b/rnd/autogpt_builder/src/components/NodeHandle.tsx
index b300929f88..0a908cf3ab 100644
--- a/rnd/autogpt_builder/src/components/NodeHandle.tsx
+++ b/rnd/autogpt_builder/src/components/NodeHandle.tsx
@@ -42,7 +42,7 @@ const NodeHandle: FC<HandleProps> = ({
const dot = (
<div
- className={`w-4 h-4 m-1 ${isConnected ? getTypeBgColor(schema.type || "any") : "bg-gray-600"} rounded-full transition-colors duration-100 group-hover:bg-gray-300`}
+ className={`w-4 h-4 m-1 border-2 bg-white ${isConnected ? getTypeBgColor(schema.type || "any") : "border-gray-600"} rounded-full transition-colors duration-100 group-hover:bg-gray-300`}
/>
);
@@ -53,7 +53,7 @@ const NodeHandle: FC<HandleProps> = ({
type="target"
position={Position.Left}
id={keyName}
- className="group -ml-[26px]"
+ className="group -ml-[26px] background-color: white; border: 2px solid black; width: 15px; height: 15px; border-radius: 50%; bottom: -7px; left: 20%;"
>
<div className="pointer-events-none flex items-center">
{dot}
diff --git a/rnd/autogpt_builder/src/components/customnode.css b/rnd/autogpt_builder/src/components/customnode.css
index f1caca0c0d..cde9a89418 100644
--- a/rnd/autogpt_builder/src/components/customnode.css
+++ b/rnd/autogpt_builder/src/components/customnode.css
@@ -1,6 +1,4 @@
.custom-node {
- border: 4px solid #4b5563;
- background: #ffffff;
color: #000000;
width: 500px;
box-sizing: border-box;
diff --git a/rnd/autogpt_builder/src/lib/utils.ts b/rnd/autogpt_builder/src/lib/utils.ts
index 7d7639c5b7..9e369c4f0d 100644
--- a/rnd/autogpt_builder/src/lib/utils.ts
+++ b/rnd/autogpt_builder/src/lib/utils.ts
@@ -36,7 +36,7 @@ export function deepEquals(x: any, y: any): boolean {
/** Get tailwind text color class from type name */
export function getTypeTextColor(type: string | null): string {
- if (type === null) return "bg-gray-500";
+ if (type === null) return "text-gray-500";
return (
{
string: "text-green-500",
@@ -53,23 +53,23 @@ export function getTypeTextColor(type: string | null): string {
/** Get tailwind bg color class from type name */
export function getTypeBgColor(type: string | null): string {
- if (type === null) return "bg-gray-500";
+ if (type === null) return "border-gray-500";
return (
{
- string: "bg-green-500",
- number: "bg-blue-500",
- boolean: "bg-yellow-500",
- object: "bg-purple-500",
- array: "bg-indigo-500",
- null: "bg-gray-500",
- any: "bg-gray-500",
- "": "bg-gray-500",
- }[type] || "bg-gray-500"
+ string: "border-green-500",
+ number: "border-blue-500",
+ boolean: "border-yellow-500",
+ object: "border-purple-500",
+ array: "border-indigo-500",
+ null: "border-gray-500",
+ any: "border-gray-500",
+ "": "border-gray-500",
+ }[type] || "border-gray-500"
);
}
export function getTypeColor(type: string | null): string {
- if (type === null) return "bg-gray-500";
+ if (type === null) return "#6b7280";
return (
{
string: "#22c55e",