diff --git a/.gitignore b/.gitignore
index 54b806f..8246125 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@ backend/data/sessions/
# Planning & internal docs
/docs/
+.next/
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e110db0..e70d6d0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,14 @@
All notable changes to F1 Replay Timing will be documented in this file.
+## 1.3.2.1
+
+### Fixes
+- **Lap analysis lap number** — fixed showing incomplete current lap data; now only displays completed laps
+- **Mobile lap analysis scroll** — section is now scrollable on mobile
+
+---
+
## 1.3.2
### Improvements
diff --git a/frontend/src/app/replay/[year]/[round]/page.tsx b/frontend/src/app/replay/[year]/[round]/page.tsx
index 25434ca..06358b1 100644
--- a/frontend/src/app/replay/[year]/[round]/page.tsx
+++ b/frontend/src/app/replay/[year]/[round]/page.tsx
@@ -866,7 +866,7 @@ export default function ReplayPage() {
{/* Lap Analysis Panel - desktop only, left of leaderboard */}
{!isMobile && isRace && lapAnalysisOpen && lapsResponse?.laps && (
- closePanel(() => setLapAnalysisOpen(false))} />
+ closePanel(() => setLapAnalysisOpen(false))} />
)}
@@ -920,8 +920,8 @@ export default function ReplayPage() {
{mobileLapAnalysisOpen && (
-
diff --git a/frontend/src/components/LapAnalysisPanel.tsx b/frontend/src/components/LapAnalysisPanel.tsx
index 0efc7c8..696ab8b 100644
--- a/frontend/src/components/LapAnalysisPanel.tsx
+++ b/frontend/src/components/LapAnalysisPanel.tsx
@@ -118,6 +118,12 @@ const LAP_RANGES = [
export default function LapAnalysisPanel({ laps, drivers, currentLap, onClose }: Props) {
const [selectedDrivers, setSelectedDrivers] = useState<[string | null, string | null]>([null, null]);
const [lapRange, setLapRange] = useState(0); // 0 = all
+ const [lapOrder, setLapOrder] = useState<"asc" | "desc">(() => {
+ if (typeof window !== "undefined") {
+ return (localStorage.getItem("f1replay_lap_order") as "asc" | "desc") || "asc";
+ }
+ return "asc";
+ });
const sortedDrivers = useMemo(
() => [...drivers].sort((a, b) => (a.position ?? 999) - (b.position ?? 999)),
@@ -499,7 +505,20 @@ export default function LapAnalysisPanel({ laps, drivers, currentLap, onClose }:
{/* Header row */}
-
LAP
+
{activeDrivers.map((abbr) => (
= endLap : lap <= endLap; lap += step) {
rows.push(