diff --git a/ui/src/components/AgentConfigForm.render.test.tsx b/ui/src/components/AgentConfigForm.render.test.tsx index 2e977b1281a..760012f0666 100644 --- a/ui/src/components/AgentConfigForm.render.test.tsx +++ b/ui/src/components/AgentConfigForm.render.test.tsx @@ -398,12 +398,18 @@ describe("AgentConfigForm environment selector", () => { expect(result.container.textContent).toContain("Advanced runtime"); expect(result.container.textContent).toContain("runtime adapter fields"); - expect(runtime?.compareDocumentPosition(environment as Node) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy(); + expect((runtime?.compareDocumentPosition(environment as Node) ?? 0) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy(); expect(runtime?.textContent).not.toContain("Environment variables"); expect(runtime?.textContent).not.toContain("Working directory (deprecated)"); expect(environment?.parentElement?.textContent).toContain("Environment variables"); expect(danger?.textContent).toContain("danger adapter fields"); expect(danger?.textContent).toContain("Working directory (deprecated)"); + expect([...result.container.querySelectorAll("h2")].map((heading) => heading.textContent?.trim())).toEqual([ + "Runtime", + "Environment", + "Schedule & Runs", + "Danger & Legacy", + ]); }); it("keeps an existing non-runnable override visible so it can be cleared", async () => { diff --git a/ui/src/components/AgentConfigForm.tsx b/ui/src/components/AgentConfigForm.tsx index 5dbeee42a59..4ea378f0856 100644 --- a/ui/src/components/AgentConfigForm.tsx +++ b/ui/src/components/AgentConfigForm.tsx @@ -968,6 +968,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) { MAX_TURN_CONTINUATION_MAX_DELAY_SEC, ); const configurationShell = props.configurationShell === true; + const CardSectionHeading = configurationShell ? "h2" : "h3"; const sectionVisible = (section: string) => !props.identityOnly && (!props.visibleConfigurationSections || props.visibleConfigurationSections.has(section)); const advancedRuntimeKeys = [ @@ -1100,7 +1101,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) { {sectionVisible("runtime") &&