From 8b95620ec155ebf8dcb39ac8ec28c667f5e51362 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Sun, 22 Mar 2026 20:43:11 +0100 Subject: [PATCH] polish(pagespeed): mini gauges, animated tab switcher, filmstrip title - Replace compact dot+number scores with 64px ScoreGauge circles - ScoreGauge scales font/stroke/spacing for small sizes - Add "Page Load Timeline" header to filmstrip section - Replace pill toggle with animated underline tabs (matches dashboard) --- app/sites/[id]/pagespeed/page.tsx | 63 +++++++++++++---------------- components/pagespeed/ScoreGauge.tsx | 13 +++--- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/app/sites/[id]/pagespeed/page.tsx b/app/sites/[id]/pagespeed/page.tsx index ed2c8b2..af19026 100644 --- a/app/sites/[id]/pagespeed/page.tsx +++ b/app/sites/[id]/pagespeed/page.tsx @@ -6,6 +6,7 @@ import { useParams } from 'next/navigation' import { useSite, usePageSpeedConfig, usePageSpeedLatest, usePageSpeedHistory } from '@/lib/swr/dashboard' import { updatePageSpeedConfig, triggerPageSpeedCheck, getPageSpeedLatest, type PageSpeedCheck, type AuditSummary } from '@/lib/api/pagespeed' import { toast, Button } from '@ciphera-net/ui' +import { motion } from 'framer-motion' import ScoreGauge from '@/components/pagespeed/ScoreGauge' import { AreaChart, @@ -306,27 +307,29 @@ export default function PageSpeedPage() {
{/* Mobile / Desktop toggle */} -
- - +
+ {(['mobile', 'desktop'] as const).map(tab => ( + + ))}
{canEdit && ( @@ -360,20 +363,9 @@ export default function PageSpeedPage() { {/* Center — Compact Scores + Meta */}
-
+
{compactScores.map(({ label, score }) => ( -
- - - {score !== null ? Math.round(score) : '--'} - - - {label} - -
+ ))}
@@ -422,6 +414,9 @@ export default function PageSpeedPage() { {/* Filmstrip — page load progression */} {currentCheck?.filmstrip && currentCheck.filmstrip.length > 0 && (
+

+ Page Load Timeline +

{currentCheck.filmstrip.map((frame, idx) => (
diff --git a/components/pagespeed/ScoreGauge.tsx b/components/pagespeed/ScoreGauge.tsx index 7b9ceb4..617742c 100644 --- a/components/pagespeed/ScoreGauge.tsx +++ b/components/pagespeed/ScoreGauge.tsx @@ -21,10 +21,13 @@ export default function ScoreGauge({ score, label, size = 120 }: ScoreGaugeProps const offset = hasScore ? CIRCUMFERENCE * (1 - score / 100) : CIRCUMFERENCE const color = hasScore ? getColor(score) : '#6b7280' - const fontSize = size >= 160 ? 'text-4xl' : 'text-2xl' + const fontSize = size >= 160 ? 'text-4xl' : size >= 100 ? 'text-2xl' : size >= 80 ? 'text-lg' : 'text-xs' + const labelSize = size >= 100 ? 'text-sm' : 'text-[10px]' + const strokeWidth = size >= 100 ? 8 : 6 + const gap = size >= 100 ? 'gap-2' : 'gap-1' return ( -
+
{/* Filled arc */}
- + {label}