Skip to content

feat(site): add AI settings provider form components#25581

Merged
jakehwll merged 1 commit into
mainfrom
jakehwll/DEVEX-355/03-components
May 26, 2026
Merged

feat(site): add AI settings provider form components#25581
jakehwll merged 1 commit into
mainfrom
jakehwll/DEVEX-355/03-components

Conversation

@jakehwll
Copy link
Copy Markdown
Contributor

@jakehwll jakehwll commented May 21, 2026

🤖 This PR was written by Coder Agents on behalf of Jake Howell.

Linear: DEVEX-355

Third PR in a 5-PR stack splitting #25328. Adds the component-level pieces used by the provider management pages landing in the next PR of the stack.

  • ProviderForm + CredentialField + a provider type-to-form mapping for reading and editing the per-type credential and config fields, with the form API map covered by unit tests.
  • ProviderIcon resolves the bundled per-provider SVG icons and falls back to a building glyph for unknown types.
  • ProviderRow renders a single provider entry for the list view.
  • useUnsavedChangesPrompt hook intercepts unsaved-form navigation.
  • Storybook stories for ProviderForm, ProviderIcon, and ProviderRow exercise each provider type and form state and consume the mock providers from PR 2.

Stories now consume MockAIProviderOpenAI / Anthropic / Bedrock so their per-mock @lintignore tags are removed; the MockAIProviders aggregate and the addableProviderTypes / aiProviders query modules keep their exclusions for the page stories in the next PR.

Stack
  1. feat(site): add UI primitives for the AI settings stack #25579 jakehwll/DEVEX-355/01-primitives, primitives
  2. feat(site): add AI provider API client and query layer #25580 jakehwll/DEVEX-355/02-api, API client and query layer
  3. jakehwll/DEVEX-355/03-components, provider form components (this PR)
  4. jakehwll/DEVEX-355/04-pages, pages and routes
  5. jakehwll/DEVEX-355/05-section, section reshuffle

Replaces #25328 once the stack lands.

Copy link
Copy Markdown
Contributor Author

jakehwll commented May 21, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c34e51a395

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +136 to +137
model: Yup.string(),
smallFastModel: Yup.string(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require Bedrock model identifiers before submit

Update the Bedrock validation schema to require both model fields. Right now model and smallFastModel are plain Yup.string() values, so the form can submit with empty strings even though the UI marks them required. That payload is persisted by providerFormValuesToCreate/providerFormValuesToUpdate, but Bedrock calls later fail at runtime because the interceptor rejects missing values (withAWSBedrockOptions returns "model required" / "small fast model required"), which makes the saved provider unusable.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the amended commit. model and smallFastModel are now Yup.string().required(...) in makeBedrockSchema so the form validation matches the UI (both fields render with the required prop) and matches the AIBridge interceptor's runtime expectations.

Reply from Coder Agents on behalf of Jake Howell.

Comment on lines +54 to +55
const makeDisplayNameSchema = (editing: boolean) =>
editing ? Yup.string().required("Display name is required") : Yup.string();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow blank display names when editing providers

Do not require displayName in edit mode. The form text says blank display names should fall back to the provider name, and the update API supports clearing display_name with an empty string, but this schema forces a non-empty value during edits. As a result, users cannot clear a custom display name to return to default slug behavior.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the amended commit. makeDisplayNameSchema is now always optional in both add and edit modes. This matches the form copy ("Friendly name. Defaults to name if blank.") and the update API's behavior of treating an empty string as a request to clear the custom display name.

Reply from Coder Agents on behalf of Jake Howell.

@jakehwll jakehwll changed the title feat(site/src/pages/AISettingsPage): add provider form components feat(site): add provider form components for AI settings May 21, 2026
@jakehwll jakehwll changed the title feat(site): add provider form components for AI settings feat(site): add AI settings provider form components May 21, 2026
@jakehwll jakehwll force-pushed the jakehwll/DEVEX-355/02-api branch from ccdcc22 to 30cfb56 Compare May 21, 2026 16:52
@jakehwll jakehwll force-pushed the jakehwll/DEVEX-355/03-components branch from c34e51a to 1152845 Compare May 21, 2026 16:52
@jakehwll jakehwll force-pushed the jakehwll/DEVEX-355/02-api branch from 30cfb56 to e6b423e Compare May 22, 2026 08:15
@jakehwll jakehwll force-pushed the jakehwll/DEVEX-355/03-components branch from 1152845 to a28647d Compare May 22, 2026 08:15
@jakehwll jakehwll force-pushed the jakehwll/DEVEX-355/02-api branch from e6b423e to e2c7056 Compare May 26, 2026 16:05
@jakehwll jakehwll force-pushed the jakehwll/DEVEX-355/03-components branch from a28647d to f91be01 Compare May 26, 2026 16:11
Base automatically changed from jakehwll/DEVEX-355/02-api to main May 26, 2026 16:13
Adds the component-level pieces used by the provider management pages
landing in the next PR of the AI settings stack:

- ProviderForm + CredentialField + provider type-to-form mapping for
  reading and editing the per-type credential and config fields, with
  the form API map covered by unit tests.
- ProviderIcon resolves the bundled per-provider SVG icons and falls
  back to a building glyph for unknown types.
- ProviderRow renders a single provider entry for the list view.
- useUnsavedChangesPrompt hook intercepts unsaved-form navigation.
- Storybook stories for ProviderForm, ProviderIcon, and ProviderRow
  exercise each provider type and form state and consume the mock
  providers from testHelpers/entities.ts.

Stories now consume MockAIProviderOpenAI / Anthropic / Bedrock so
their per-mock @lintignore tags are removed; the MockAIProviders
aggregate keeps its tag for the page stories landing next.
@jakehwll jakehwll force-pushed the jakehwll/DEVEX-355/03-components branch from f91be01 to 9e89ae2 Compare May 26, 2026 16:17
@jakehwll jakehwll enabled auto-merge (squash) May 26, 2026 16:18
@jakehwll jakehwll merged commit 99a0025 into main May 26, 2026
26 of 28 checks passed
@jakehwll jakehwll deleted the jakehwll/DEVEX-355/03-components branch May 26, 2026 16:27
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants