Compare commits

...

3 Commits

Author SHA1 Message Date
Danielle Maywood b5a7b37ca9 fix(site): fix type errors in ModelsSection stories
Use canvasElement.querySelector instead of canvas.container which
does not exist on the within() return type.
2026-03-24 00:54:30 +00:00
Danielle Maywood 2d8a0617a3 fix(site): move pricing warning to inline tooltip icon
Replace the third-line pricing warning text with a small warning
icon inline in the subtitle. Hovering the icon shows the tooltip
"Model pricing is not defined". This keeps the row to two lines
while keeping the warning visible at a glance.
2026-03-24 00:46:47 +00:00
Danielle Maywood bd8cc3d89e fix(site): show provider name in model list rows
Add a subtitle line under each model's display name showing the
provider label and model identifier (e.g. "OpenAI · gpt-4.1").
This matches the pattern already used by MCP server list rows
and makes the provider immediately visible without relying solely
on the icon.
2026-03-23 21:04:24 +00:00
2 changed files with 32 additions and 15 deletions
@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from "@storybook/react-vite";
import type * as TypesGen from "api/typesGenerated";
import { TooltipProvider } from "components/Tooltip/Tooltip";
import { expect, fn, within } from "storybook/test";
import { expect, fn, userEvent, within } from "storybook/test";
import type { ProviderState } from "./ChatModelAdminPanel";
import { ModelsSection } from "./ModelsSection";
@@ -73,10 +73,19 @@ type Story = StoryObj<typeof ModelsSection>;
export const ShowsPricingWarning: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
await expect(
canvas.getByText("Model pricing is not defined"),
).toBeInTheDocument();
const body = within(canvasElement.ownerDocument.body);
// The warning icon should be visible in the subtitle line.
const warningIcon = canvasElement.querySelector(".text-content-warning");
expect(warningIcon).toBeTruthy();
// Hovering the icon reveals the tooltip text.
if (warningIcon) {
await userEvent.hover(warningIcon);
await expect(
await body.findByText("Model pricing is not defined"),
).toBeInTheDocument();
}
},
};
@@ -95,9 +104,8 @@ export const HidesPricingWarningForExplicitZeroPricing: Story = {
],
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
expect(
canvas.queryByText("Model pricing is not defined"),
).not.toBeInTheDocument();
// No warning icon should be present.
const warningIcon = canvasElement.querySelector(".text-content-warning");
expect(warningIcon).toBeNull();
},
};
@@ -22,6 +22,7 @@ import {
import type { FC, ReactNode } from "react";
import { useLocation, useNavigate, useSearchParams } from "react-router";
import { cn } from "utils/cn";
import { formatProviderLabel } from "../../utils/modelOptions";
import { SectionHeader } from "../SectionHeader";
import type { ProviderState } from "./ChatModelAdminPanel";
import { ModelForm } from "./ModelForm";
@@ -321,12 +322,20 @@ export const ModelsSection: FC<ModelsSectionProps> = ({
>
{modelConfig.display_name || modelConfig.model}
</span>
{showPricingWarning && (
<span className="mt-1 flex items-center gap-1 text-xs text-content-warning">
<TriangleAlertIcon className="h-3.5 w-3.5 shrink-0" />
Model pricing is not defined
</span>
)}
<span className="flex items-center gap-1 truncate text-xs text-content-secondary">
{formatProviderLabel(modelConfig.provider)} &middot;{" "}
{modelConfig.model}
{showPricingWarning && (
<Tooltip>
<TooltipTrigger asChild>
<TriangleAlertIcon className="h-3.5 w-3.5 shrink-0 text-content-warning" />
</TooltipTrigger>
<TooltipContent>
Model pricing is not defined
</TooltipContent>
</Tooltip>
)}
</span>{" "}
</div>
{modelConfig.enabled === false && (
<Badge size="xs" variant="warning">