From 3d6955f20f2d41f6acdca9e9467db1b05b14e19e Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Tue, 11 Aug 2026 05:11:09 -0400 Subject: [PATCH] fix(phase26): fix broken click handler, remove replay button, row click only --- static/js/history.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/static/js/history.js b/static/js/history.js index 80f3b24..f97b1e0 100644 --- a/static/js/history.js +++ b/static/js/history.js @@ -314,11 +314,7 @@ ${formatDuration(trip.duration_seconds)} ${formatSpeed(trip.max_speed_kmh)} ${trip.odo_start_km != null ? trip.odo_start_km.toFixed(0) + ' → ' + trip.odo_end_km.toFixed(0) + ' km' : '—'} - - ${deleteBtn} - `; + ${deleteBtn}`; body.appendChild(row); }); @@ -352,13 +348,12 @@ } } - // Replay button click (desktop) or row click (mobile) — debounced - const tripId = button ? button.dataset.tripId : (row ? row.dataset.tripId : null); - if (!tripId) return; + // Row click triggers replay — debounced + const row = event.target.closest("tr[data-trip-id]"); + if (!row) return; + const tripId = row.dataset.tripId; clearTimeout(_replayDebounce); - _replayDebounce = setTimeout(() => { - replayTrip(tripId); - }, 100); + _replayDebounce = setTimeout(() => replayTrip(tripId), 100); }); scrubber.addEventListener("input", function () {