feat(site): add AI settings provider form components#25581
Conversation
There was a problem hiding this comment.
💡 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".
| model: Yup.string(), | ||
| smallFastModel: Yup.string(), |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| const makeDisplayNameSchema = (editing: boolean) => | ||
| editing ? Yup.string().required("Display name is required") : Yup.string(); |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
ccdcc22 to
30cfb56
Compare
c34e51a to
1152845
Compare
30cfb56 to
e6b423e
Compare
1152845 to
a28647d
Compare
e6b423e to
e2c7056
Compare
a28647d to
f91be01
Compare
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.
f91be01 to
9e89ae2
Compare

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.ProviderIconresolves the bundled per-provider SVG icons and falls back to a building glyph for unknown types.ProviderRowrenders a single provider entry for the list view.useUnsavedChangesPrompthook intercepts unsaved-form navigation.ProviderForm,ProviderIcon, andProviderRowexercise each provider type and form state and consume the mock providers from PR 2.Stories now consume
MockAIProviderOpenAI/Anthropic/Bedrockso their per-mock@lintignoretags are removed; theMockAIProvidersaggregate and theaddableProviderTypes/aiProvidersquery modules keep their exclusions for the page stories in the next PR.Stack
Replaces #25328 once the stack lands.