Skip to content

Commit 67a3ed8

Browse files
committed
fix(ui): block Form mode switch for template JSON payloads
1 parent 7b3bbed commit 67a3ed8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎ui/src/core/page-components/agent-detail/modals/edit-control/edit-control-content.tsx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,17 @@ const RawEditControlContent = ({
376376
return;
377377
}
378378

379+
// Template payloads cannot be edited in Form mode — they use $param
380+
// bindings that the form editor doesn't understand.
381+
const raw = parsedDefinition as Record<string, unknown>;
382+
if (raw.template != null) {
383+
setDefinitionJsonError(
384+
'Template-backed controls cannot be edited in Form mode. ' +
385+
'Save from JSON to create the control, then edit it to get the parameter form.'
386+
);
387+
return;
388+
}
389+
379390
try {
380391
await validateControlDataAsync({ definition: parsedDefinition });
381392
} catch (error) {

0 commit comments

Comments
 (0)