diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/stateTransition.ts b/apps/ai-game-creator-shell/src/features/ui-editor/stateTransition.ts index 552e64a2b..c4338e0ca 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/stateTransition.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/stateTransition.ts @@ -117,6 +117,9 @@ export function applyUiEditorCommand( const status = command.patch.component_status; if (status !== 'NoProblem') return { ok: false, reason: 'invalid' }; } - node.metadata = { ...node.metadata, ...structuredClone(command.patch) }; + const patch = Object.fromEntries( + Object.entries(command.patch).filter(([, value]) => value !== undefined), + ) as Partial; + node.metadata = { ...node.metadata, ...structuredClone(patch) }; return { ok: true, state: next }; }