From a0184369bb14072d51f495b866841d91a75ca533 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Tue, 5 Nov 2024 18:50:54 -0300 Subject: [PATCH] feat: Change Beta Tag and UI Enhancements for Node Components (#4417) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 📝 (NodeName/index.tsx): Add beta prop to NodeName component for better handling of beta features 📝 (NodeStatus/index.tsx): Import Badge component and add beta badge for beta nodes 📝 (GenericNode/index.tsx): Import Badge component and add beta badge for beta nodes 📝 (nodeToolbarComponent/index.tsx): Add border styling to nodeToolbarComponent for better visual separation 📝 (index.css): Update accent-pink and accent-pink-foreground colors for better contrast --- .../GenericNode/components/NodeName/index.tsx | 3 + .../components/NodeStatus/index.tsx | 107 ++++++++++-------- .../src/CustomNodes/GenericNode/index.tsx | 11 +- .../components/nodeToolbarComponent/index.tsx | 2 +- src/frontend/src/style/index.css | 5 +- 5 files changed, 71 insertions(+), 57 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/NodeName/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/NodeName/index.tsx index 8c4c48d6e..5c784d22c 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/NodeName/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/NodeName/index.tsx @@ -13,6 +13,7 @@ export default function NodeName({ showNode, validationStatus, isOutdated, + beta, }: { display_name?: string; selected: boolean; @@ -20,6 +21,7 @@ export default function NodeName({ showNode: boolean; validationStatus: VertexBuildTypeAPI | null; isOutdated: boolean; + beta: boolean; }) { const [inputName, setInputName] = useState(false); const [nodeName, setNodeName] = useState(display_name); @@ -88,6 +90,7 @@ export default function NodeName({ className={cn( "max-w-44 truncate text-[14px]", validationStatus?.data?.duration && "max-w-36", + validationStatus?.data?.duration && beta && "max-w-20", isOutdated && "max-w-40", !showNode && "max-w-28", )} diff --git a/src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx index 5578dad5a..8ef88ef14 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx @@ -3,6 +3,7 @@ import useIconStatus from "@/CustomNodes/hooks/use-icons-status"; import useUpdateValidationStatus from "@/CustomNodes/hooks/use-update-validation-status"; import useValidationStatusString from "@/CustomNodes/hooks/use-validation-status-string"; import ShadTooltip from "@/components/shadTooltipComponent"; +import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { ICON_STROKE_WIDTH, @@ -187,7 +188,7 @@ export default function NodeStatus({ return ( <> -
+
{isOutdated && !isUserEdited && (