refactor: stack dashboard summary cards
This commit is contained in:
@@ -642,8 +642,8 @@ function Dashboard() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid gap-4 md:grid-cols-3 xl:grid-cols-4">
|
<div className="grid gap-4 xl:grid-cols-[minmax(0,2fr)_minmax(16rem,1fr)] xl:items-stretch">
|
||||||
<Card className="md:col-span-2">
|
<Card className="h-full">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>Unified capacity</CardTitle>
|
<CardTitle>Unified capacity</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
@@ -676,6 +676,7 @@ function Dashboard() {
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
<div className="grid gap-4 xl:grid-rows-3">
|
||||||
{[
|
{[
|
||||||
{
|
{
|
||||||
title: 'Connected sessions',
|
title: 'Connected sessions',
|
||||||
@@ -693,7 +694,7 @@ function Dashboard() {
|
|||||||
tone: 'text-rose-300',
|
tone: 'text-rose-300',
|
||||||
},
|
},
|
||||||
].map((item) => (
|
].map((item) => (
|
||||||
<Card key={item.title}>
|
<Card key={item.title} className="h-full">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardDescription>{item.title}</CardDescription>
|
<CardDescription>{item.title}</CardDescription>
|
||||||
<CardTitle className={item.tone}>
|
<CardTitle className={item.tone}>
|
||||||
@@ -703,6 +704,7 @@ function Dashboard() {
|
|||||||
</Card>
|
</Card>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="mt-6 grid gap-6 xl:grid-cols-[1.15fr_0.85fr]">
|
<div className="mt-6 grid gap-6 xl:grid-cols-[1.15fr_0.85fr]">
|
||||||
<Card className="min-w-0">
|
<Card className="min-w-0">
|
||||||
|
|||||||
17
apps/web/test/dashboard-summary-layout.test.js
Normal file
17
apps/web/test/dashboard-summary-layout.test.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { describe, expect, test } from 'bun:test';
|
||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { join } from 'node:path';
|
||||||
|
|
||||||
|
const appSource = readFileSync(join(import.meta.dir, '../src/App.tsx'), 'utf8');
|
||||||
|
|
||||||
|
describe('dashboard summary layout', () => {
|
||||||
|
test('stacks the session summary cards vertically beside unified capacity on desktop', () => {
|
||||||
|
expect(appSource).toContain(
|
||||||
|
'className="grid gap-4 xl:grid-cols-[minmax(0,2fr)_minmax(16rem,1fr)] xl:items-stretch"',
|
||||||
|
);
|
||||||
|
expect(appSource).toContain('className="h-full"');
|
||||||
|
expect(appSource).toContain('className="grid gap-4 xl:grid-rows-3"');
|
||||||
|
expect(appSource).not.toContain('className="grid gap-4 md:grid-cols-3 xl:grid-cols-4"');
|
||||||
|
expect(appSource).not.toContain('className="md:col-span-2"');
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user