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.
fix(frontend): prune empty values from node inputs and fix object editor connection detection (#11507)
Abhimanyu Yadavf98793704638
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/stores/nodeStore.ts b/autogpt_platform/frontend/src/app/(platform)/build/stores/nodeStore.tsindex a8101434f4..dc9963194a 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/stores/nodeStore.ts+++ b/autogpt_platform/frontend/src/app/(platform)/build/stores/nodeStore.ts@@ -12,6 +12,7 @@ import { NodeExecutionResult } from "@/app/api/__generated__/models/nodeExecutioimport { useHistoryStore } from "./historyStore";import { useEdgeStore } from "./edgeStore";import { BlockUIType } from "../components/types";+import { pruneEmptyValues } from "@/lib/utils";// Minimum movement (in pixels) required before logging position change to history// Prevents spamming history with small movements when clicking on inputs inside blocks@@ -201,7 +202,7 @@ export const useNodeStore = create<NodeStore>((set, get) => ({return {id: node.id,block_id: node.data.block_id,- input_default: node.data.hardcodedValues,+ input_default: pruneEmptyValues(node.data.hardcodedValues),metadata: {position: node.position,...(node.data.metadata?.customized_name !== undefined && {diff --git a/autogpt_platform/frontend/src/components/renderers/input-renderer/widgets/ObjectEditorWidget/ObjectEditorWidget.tsx b/autogpt_platform/frontend/src/components/renderers/input-renderer/widgets/ObjectEditorWidget/ObjectEditorWidget.tsxindex 97f8afb31c..80d504421d 100644--- a/autogpt_platform/frontend/src/components/renderers/input-renderer/widgets/ObjectEditorWidget/ObjectEditorWidget.tsx+++ b/autogpt_platform/frontend/src/components/renderers/input-renderer/widgets/ObjectEditorWidget/ObjectEditorWidget.tsx@@ -34,7 +34,6 @@ export const ObjectEditor = React.forwardRef<HTMLDivElement, ObjectEditorProps>(disabled = false,className,nodeId,- fieldKey,},ref,) => {@@ -101,12 +100,12 @@ export const ObjectEditor = React.forwardRef<HTMLDivElement, ObjectEditorProps>(id={parentFieldId}>{Object.entries(value).map(([key, propertyValue], idx) => {- const isDynamicPropertyConnected = isInputConnected(nodeId, fieldKey);const handleId = generateHandleId(parentFieldId,[key],HandleIdType.KEY_VALUE,);+ const isDynamicPropertyConnected = isInputConnected(nodeId, handleId);return (<div key={idx} className="flex flex-col gap-2">