Commit bee45b58 by CaIon

fix(web): switch the pricing card grid to three columns at xl

The model card grid and its loading skeleton only reached three columns at
2xl, leaving a two-column layout on common desktop widths. Use the xl
breakpoint for both and lock it with a test.
parent 210734bb
......@@ -401,6 +401,24 @@ describe('model cards', () => {
expect(screen.getByRole('heading', { name: 'model-1' })).toBeVisible()
})
it('switches the card grid to three columns at the xl breakpoint instead of 2xl', () => {
queryClient.setQueryData(['perf-metrics-summary', 24], {
success: true,
data: { models: [] },
})
render(
<QueryClientProvider client={queryClient}>
<ModelCardGrid models={[pricingModel()]} onModelClick={vi.fn()} />
</QueryClientProvider>
)
const grid = screen
.getByRole('heading', { name: 'example-model' })
.closest('.grid')
expect(grid).toHaveClass('xl:grid-cols-3')
expect(grid).not.toHaveClass('2xl:grid-cols-3')
expect(grid).not.toHaveClass('min-[1440px]:grid-cols-3')
})
it('lights slots 23 and 18 when series has the current hour and five hours earlier', () => {
vi.useFakeTimers()
vi.setSystemTime(new Date('2026-09-07T12:00:00.000Z'))
......
......@@ -74,7 +74,7 @@ export function LoadingSkeleton(props: LoadingSkeletonProps) {
))}
</div>
) : (
<div className='grid grid-cols-1 gap-3 sm:gap-4 md:grid-cols-2 2xl:grid-cols-3'>
<div className='grid grid-cols-1 gap-3 sm:gap-4 md:grid-cols-2 xl:grid-cols-3'>
{Array.from({ length: 6 }, (_, index) => (
<Card key={index} className='gap-3'>
<CardHeader className='flex flex-row gap-3'>
......
......@@ -73,7 +73,7 @@ export function ModelCardGrid(props: ModelCardGridProps) {
return (
<div className='flex flex-col gap-4 sm:gap-5'>
<div className='grid grid-cols-1 gap-3 sm:gap-4 md:grid-cols-2 2xl:grid-cols-3'>
<div className='grid grid-cols-1 gap-3 sm:gap-4 md:grid-cols-2 xl:grid-cols-3'>
{pagedModels.map((model) => (
<ModelCard
key={model.id ?? model.model_name}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment