fix(site/src/pages/AgentsPage): reset provider form after create (#23975)

Previously, after creating a provider config in the agents provider
editor, the Save changes button stayed enabled for the lifetime of the
mounted form. The form kept the pre-create local baseline, so the
freshly-saved values still looked dirty.

Key `ProviderForm` by provider config identity so React remounts the
form when a config is created and re-establishes the pristine state from
the saved provider values.
This commit is contained in:
Ethan
2026-04-08 00:32:36 +10:00
committed by GitHub
parent 684f21740d
commit 76a2cb1af5
@@ -462,6 +462,9 @@ export const CreateAndUpdateProvider: Story = {
await waitFor(() => {
expect(args.onCreateProvider).toHaveBeenCalledTimes(1);
});
await waitFor(() => {
expect(body.getByRole("button", { name: "Save changes" })).toBeDisabled();
});
expect(args.onCreateProvider).toHaveBeenCalledWith(
expect.objectContaining({
provider: "openai",