Skip to content

Commit 12c25a8

Browse files
committed
test: add gallery affordances, vrt tests, and perf budgets
1 parent 6748df3 commit 12c25a8

File tree

4 files changed

+122
-1
lines changed

4 files changed

+122
-1
lines changed

frontend/src/app/configurator/ClientPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { useEffect } from 'react'
44

55
import KitchenLayoutShell from '@/components/KitchenLayoutShell'
66
import { initOtelRoute } from '@/lib/otel-route'
7-
import Viewer3D from '../components/Viewer3D'
87
import ConfiguratorPanel from '../components/configurator-panel'
8+
import Viewer3D from '../components/Viewer3D'
99

1010
export default function ClientPage() {
1111
const demoVariant = 'base_600'
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
.kds-gallery {
2+
position: absolute;
3+
inset: 0;
4+
overflow: hidden;
5+
}
6+
7+
.kds-gallery__ctrl {
8+
position: absolute;
9+
top: 0;
10+
bottom: 0;
11+
width: 12%;
12+
opacity: 0;
13+
display: flex;
14+
align-items: center;
15+
justify-content: center;
16+
border: 0;
17+
background: transparent;
18+
cursor: pointer;
19+
transition: opacity 0.4s ease;
20+
}
21+
22+
.kds-gallery:hover .kds-gallery__ctrl,
23+
.kds-gallery:focus-within .kds-gallery__ctrl {
24+
opacity: 1;
25+
}
26+
27+
.kds-gallery__prev {
28+
left: 0;
29+
}
30+
31+
.kds-gallery__next {
32+
right: 0;
33+
}
34+
35+
.kds-gallery__arrow {
36+
width: var(--kds-gallery-arrow-size);
37+
height: var(--kds-gallery-arrow-size);
38+
border-radius: 999px;
39+
display: inline-flex;
40+
align-items: center;
41+
justify-content: center;
42+
background: rgba(16, 16, 16, 0.6);
43+
border: 1px solid rgba(255, 255, 255, 0.16);
44+
color: var(--kds-fg);
45+
font-size: 32px;
46+
line-height: 1;
47+
transition: transform 0.3s ease, opacity 0.3s ease;
48+
}
49+
50+
.kds-gallery__ctrl:hover .kds-gallery__arrow,
51+
.kds-gallery__ctrl:focus-visible .kds-gallery__arrow {
52+
transform: scale(1.05);
53+
}
54+
55+
.kds-gallery__dots {
56+
position: absolute;
57+
left: 50%;
58+
bottom: var(--kds-space-4);
59+
transform: translateX(-50%);
60+
display: flex;
61+
gap: var(--kds-space-2);
62+
}
63+
64+
.kds-gallery__dot {
65+
width: var(--kds-gallery-dots-size);
66+
height: var(--kds-gallery-dots-size);
67+
border-radius: 999px;
68+
opacity: 0.32;
69+
background: rgba(255, 255, 255, 0.6);
70+
backdrop-filter: blur(7px);
71+
transition: opacity 0.3s ease, transform 0.3s ease;
72+
}
73+
74+
.kds-gallery__dot--active {
75+
opacity: 1;
76+
transform: scale(1.1);
77+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
78+
}

frontend/tests/e2e/layout.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
const CONFIGURATOR_URL = '/configurator';
4+
5+
test.describe('Configurator layout geometry', () => {
6+
test('order summary card maintains Tesla geometry', async ({ page }) => {
7+
await page.goto(CONFIGURATOR_URL);
8+
const card = page.locator('.kds-card').first();
9+
await expect(card).toHaveCSS('max-width', '432px');
10+
await expect(card).toHaveCSS('border-radius', '8px');
11+
});
12+
13+
test('gallery affordances reveal on hover', async ({ page }) => {
14+
await page.goto(CONFIGURATOR_URL);
15+
const gallery = page.locator('.kds-gallery-frame');
16+
await gallery.hover();
17+
const controls = page.locator('.kds-gallery__ctrl');
18+
await expect(controls).toHaveCount(2);
19+
await controls.first().waitFor({ state: 'visible' });
20+
});
21+
});

tools/perf/budgets.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"budgets": [
3+
{
4+
"metric": "tti",
5+
"target": 2500,
6+
"threshold": "<=",
7+
"label": "Time to Interactive (4G fast)"
8+
},
9+
{
10+
"metric": "route-change-p95",
11+
"target": 300,
12+
"threshold": "<=",
13+
"label": "Route change p95 (ms)"
14+
},
15+
{
16+
"metric": "cpu-blocking",
17+
"target": 150,
18+
"threshold": "<=",
19+
"label": "Main-thread blocking (ms)"
20+
}
21+
]
22+
}

0 commit comments

Comments
 (0)