Skip to content

Commit 8f46916

Browse files
chore: integrate parviz design tokens (#620)
* feat: add otel tracing and perf budgets * chore: integrate parviz design tokens * Potential fix for code scanning alert no. 11: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * fix: tighten tracing instrumentation * chore: refresh npm integrity * fix: init browser otel and retain perf retries * chore: add rimraf dependency --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent e2490c7 commit 8f46916

File tree

10 files changed

+79
-5
lines changed

10 files changed

+79
-5
lines changed

.github/workflows/perf-budgets.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Performance Budgets
22
permissions:
33
contents: read
4+
actions: write
45

56
on:
67
pull_request:

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"jest-environment-jsdom": "^29.7.0",
6464
"js-yaml": "^4.1.0",
6565
"meshoptimizer": "0.25.0",
66+
"rimraf": "^5.0.5",
6667
"postcss": "^8",
6768
"tailwindcss": "^3.3.0",
6869
"ts-jest": "^29.2.5",
37.1 KB
Binary file not shown.
37.6 KB
Binary file not shown.
38 KB
Binary file not shown.
37.4 KB
Binary file not shown.

frontend/src/app/components/app-ready.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,23 @@ export function AppReadyEffect() {
3838
}
3939
}, [])
4040

41+
useEffect(() => {
42+
let cancelled = false
43+
;(async () => {
44+
try {
45+
const module = await import('@/instrumentation')
46+
if (!cancelled && typeof module.initBrowserTracing === 'function') {
47+
await module.initBrowserTracing()
48+
}
49+
} catch (error) {
50+
console.warn('[otel] Failed to initialise browser tracing', error)
51+
}
52+
})()
53+
54+
return () => {
55+
cancelled = true
56+
}
57+
}, [])
58+
4159
return null
42-
}
60+
}

frontend/src/app/layout.tsx

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
11
import type { Metadata } from 'next'
2-
import { Inter } from 'next/font/google'
2+
import localFont from 'next/font/local'
33
import './globals.css'
44
import '@/styles/kds.css'
55
import { Providers } from './providers'
66
import { AppReadyEffect } from './components/app-ready'
77

8-
const inter = Inter({ subsets: ['latin'] })
8+
const universalSans = localFont({
9+
src: [
10+
{
11+
path: '../../public/fonts/tesla/Universal-Sans-Display-Regular.woff2',
12+
weight: '400',
13+
style: 'normal',
14+
},
15+
{
16+
path: '../../public/fonts/tesla/Universal-Sans-Display-Medium.woff2',
17+
weight: '500',
18+
style: 'normal',
19+
},
20+
{
21+
path: '../../public/fonts/tesla/Universal-Sans-Text-Regular.woff2',
22+
weight: '400',
23+
style: 'normal',
24+
},
25+
{
26+
path: '../../public/fonts/tesla/Universal-Sans-Text-Medium.woff2',
27+
weight: '500',
28+
style: 'normal',
29+
},
30+
],
31+
variable: '--font-pds-sans',
32+
display: 'swap',
33+
})
934

1035
export const metadata: Metadata = {
1136
title: 'Kitchen Configurator',
@@ -22,7 +47,10 @@ export default function RootLayout({
2247
}) {
2348
return (
2449
<html lang="en">
25-
<body className={inter.className} style={{ margin: 0, background: '#0f0f0f' }}>
50+
<body
51+
className={`${universalSans.variable} ${universalSans.className}`}
52+
style={{ margin: 0, background: '#0f0f0f' }}
53+
>
2654
<Providers>
2755
<div id="app" data-ready="false">
2856
<AppReadyEffect />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { notFound } from 'next/navigation';
2-
import { PartcadViewerShell } from '../../../components/PartcadViewerShell';
2+
import { PartcadViewerShell } from '../../../../components/PartcadViewerShell';
33

44
export const dynamic = 'force-dynamic';
55

frontend/tailwind.config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,32 @@ const config: Config = {
1111
colors: {
1212
'vector-pink': '#eb088a',
1313
'vector-purple': '#8a08eb',
14+
'pzds-text': '#171a20',
15+
'pzds-white': '#ffffff',
16+
'pzds-black': '#000000',
17+
'pzds-blue': '#3e6ae1',
18+
'pzds-blue-dark': '#3457b1',
19+
'pzds-backdrop': '#f4f4f4',
20+
'pzds-grey-65': '#eeeeee',
21+
'pzds-grey-50': '#d0d1d2',
22+
'pzds-grey-40': '#a2a3a5',
23+
'pzds-grey-30': '#5c5e62',
24+
'pzds-grey-20': '#393c41',
25+
'pzds-status-green': '#02b028',
26+
'pzds-status-red': '#eb432f',
27+
},
28+
spacing: {
29+
'pzds-0p5': '4px',
30+
'pzds-1': '8px',
31+
'pzds-1p5': '12px',
32+
'pzds-2': '16px',
33+
'pzds-3': '24px',
34+
'pzds-4': '32px',
35+
'pzds-5': '40px',
36+
'pzds-6': '48px',
37+
},
38+
fontFamily: {
39+
'pds-sans': ['"Universal Sans"', '"Helvetica Neue"', 'Arial', 'sans-serif'],
1440
},
1541
},
1642
},

0 commit comments

Comments
 (0)