diff --git a/app/sites/[id]/pagespeed/page.tsx b/app/sites/[id]/pagespeed/page.tsx index 081ae72..ed2c8b2 100644 --- a/app/sites/[id]/pagespeed/page.tsx +++ b/app/sites/[id]/pagespeed/page.tsx @@ -229,6 +229,9 @@ export default function PageSpeedPage() { date: new Date(c.checked_at).toLocaleDateString('en-GB', { day: '2-digit', month: 'short' }), score: c.performance_score, })) + // * Check if all chart labels are the same (single day of data) + const uniqueDates = new Set(chartData.map(d => d.date)) + const hideXAxis = uniqueDates.size <= 1 // * Parse audits into groups by Lighthouse category const audits = currentCheck?.audits ?? [] @@ -349,7 +352,7 @@ export default function PageSpeedPage() { {/* Section 1 — Hero Card: Score Gauge + Compact Scores + Screenshot */}
-
+
{/* Left — Large Performance Gauge */}
@@ -357,17 +360,17 @@ export default function PageSpeedPage() { {/* Center — Compact Scores + Meta */}
-
+
{compactScores.map(({ label, score }) => ( -
+
- + {score !== null ? Math.round(score) : '--'} - + {label}
@@ -387,18 +390,18 @@ export default function PageSpeedPage() {
{/* Score Legend */} -
- - - 0–49 Poor +
+ + + 0–49 - - - 50–89 Needs Improvement + + + 50–89 - - - 90–100 Good + + + 90–100
@@ -418,14 +421,14 @@ export default function PageSpeedPage() { {/* Filmstrip — page load progression */} {currentCheck?.filmstrip && currentCheck.filmstrip.length > 0 && ( -
-
+
+
{currentCheck.filmstrip.map((frame, idx) => (
{`${frame.timing}ms`} {frame.timing < 1000 ? `${frame.timing}ms` : `${(frame.timing / 1000).toFixed(1)}s`} @@ -433,6 +436,8 @@ export default function PageSpeedPage() {
))}
+ {/* Fade indicator for horizontal scroll */} +
)} @@ -449,7 +454,7 @@ export default function PageSpeedPage() {
{label}
-
+
{formatMetricValue(key, value)}
@@ -464,7 +469,7 @@ export default function PageSpeedPage() {

Performance Score Trend

- + @@ -480,10 +485,11 @@ export default function PageSpeedPage() { /> { const groupAudits = auditsByGroup[group.key] ?? [] const groupPassed = passed.filter(a => a.group === group.key) - if (groupAudits.length === 0 && groupPassed.length === 0) return null + // * Hide categories with no failing audits — showing only passed count adds no value + if (groupAudits.length === 0) return null return (

@@ -576,7 +583,7 @@ function AuditRow({ audit }: { audit: AuditSummary }) { {audit.title} {audit.display_value && ( - {audit.display_value} + {audit.display_value} )} {audit.savings_ms != null && audit.savings_ms > 0 && !audit.display_value && ( @@ -664,21 +671,29 @@ function PageSpeedSkeleton() {
-
- {[...Array(4)].map((_, i) => ( -
-
-
+ {/* Hero skeleton */} +
+
+
+
+
+
+
- ))} +
+
-
- {[...Array(6)].map((_, i) => ( -
-
-
-
- ))} + {/* Metrics skeleton */} +
+
+
+ {[...Array(6)].map((_, i) => ( +
+
+
+
+ ))} +
)