fix(phase26): fix broken click handler, remove replay button, row click only

This commit is contained in:
Mathieu Moran
2026-08-11 05:11:09 -04:00
parent 90edc73735
commit 3d6955f20f
+6 -11
View File
@@ -314,11 +314,7 @@
<td>${formatDuration(trip.duration_seconds)}</td>
<td>${formatSpeed(trip.max_speed_kmh)}</td>
<td class="text-muted small">${trip.odo_start_km != null ? trip.odo_start_km.toFixed(0) + ' → ' + trip.odo_end_km.toFixed(0) + ' km' : '—'}</td>
<td class="text-end text-nowrap d-none d-sm-table-cell">
<button class="btn btn-sm btn-primary" type="button" data-trip-id="${trip.id}">
Replay
</button>${deleteBtn}
</td>`;
<td class="text-end text-nowrap d-none d-sm-table-cell">${deleteBtn}</td>`;
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 () {