diff --git a/site/src/pages/AISettingsPage/ProvidersPage/ProvidersPageView.tsx b/site/src/pages/AISettingsPage/ProvidersPage/ProvidersPageView.tsx index 10ac4c75ca7..dabc4090ea4 100644 --- a/site/src/pages/AISettingsPage/ProvidersPage/ProvidersPageView.tsx +++ b/site/src/pages/AISettingsPage/ProvidersPage/ProvidersPageView.tsx @@ -98,7 +98,7 @@ const ProvidersPageView: React.FC = ({ )} - +
Name diff --git a/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.stories.tsx b/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.stories.tsx index 1458666c494..b6a3fb72113 100644 --- a/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.stories.tsx +++ b/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.stories.tsx @@ -23,17 +23,12 @@ const meta: Meta = { }, decorators: [ (Story) => ( -
+
- Name - Base URL - - Enabled - - - Open provider - + Name + Base URL + Status @@ -84,9 +79,17 @@ export const NotSupportedInAgents: Story = { }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); - await expect( - canvas.getByText("Not supported in Agents"), - ).toBeInTheDocument(); + const badge = canvas.getByRole("button", { + name: "Not supported in Agents", + }); + await expect(badge).toBeInTheDocument(); + await userEvent.hover(badge); + const tooltip = await within(canvasElement.ownerDocument.body).findByRole( + "tooltip", + ); + await expect(tooltip).toHaveTextContent( + "This provider works with the AI Gateway Proxy but Coder Agents can't use it.", + ); }, }; @@ -117,7 +120,7 @@ export const WithHostnameCollisionWarning: Story = { }, play: async ({ canvasElement, args }) => { const canvas = within(canvasElement); - const badge = canvas.getByText(/warning/i); + const badge = canvas.getByLabelText(/^Warning: Hostname/); await expect(badge).toBeInTheDocument(); await expect(badge).toHaveAttribute( "aria-label", @@ -127,9 +130,10 @@ export const WithHostnameCollisionWarning: Story = { // Hover shows the tooltip with the warning text. await userEvent.hover(badge); - await expect( - await canvas.findByText(/api\.openai\.com/, {}, { timeout: 2000 }), - ).toBeInTheDocument(); + const tooltip = await within(canvasElement.ownerDocument.body).findByRole( + "tooltip", + ); + await expect(tooltip).toHaveTextContent("api.openai.com"); // Keyboard and mouse activation must not navigate the row. badge.focus(); diff --git a/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.tsx b/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.tsx index aa71dc22410..6a889dab7a3 100644 --- a/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.tsx +++ b/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderRow.tsx @@ -68,18 +68,31 @@ export const ProviderRow: React.FC = ({
{provider.enabled && Enabled} {AgentsUnsupportedProviderTypes.some((t) => t === provider.type) && ( - - Not supported in Agents - + + + + Not supported in Agents + + + + This provider works with the AI Gateway Proxy but Coder Agents + can't use it. + + )} {provider.status?.warnings && provider.status.warnings.length > 0 && ( = ({ Warning - + {provider.status.warnings.map((warning) => (

{warning}

))}