From 4ae9a1f7e39f0fd0b54db75f4d85f0d50b9bae0d Mon Sep 17 00:00:00 2001 From: Raj Dave Date: Mon, 27 Apr 2026 13:57:30 +0300 Subject: [PATCH] Fix two issues identified by coderabbit --- app/client/components/snapshots-table.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/client/components/snapshots-table.tsx b/app/client/components/snapshots-table.tsx index 60b81a31..273c11ed 100644 --- a/app/client/components/snapshots-table.tsx +++ b/app/client/components/snapshots-table.tsx @@ -119,6 +119,15 @@ export const SnapshotsTable = ({ snapshots, repositoryId, backups, listSnapshots const newSelected = new Set(selectedIds); rangeIds.forEach((id) => newSelected.add(id)); setSelectedIds(newSelected); + } else { + // Fallback to single-toggle when range selection fails due to stale lastSelectedId + const newSelected = new Set(selectedIds); + if (newSelected.has(snapshotId)) { + newSelected.delete(snapshotId); + } else { + newSelected.add(snapshotId); + } + setSelectedIds(newSelected); } } else { // Single selection toggle @@ -202,14 +211,9 @@ export const SnapshotsTable = ({ snapshots, repositoryId, backups, listSnapshots e.stopPropagation()}> { - handleSnapshotSelection(snapshot.short_id); - }} onClick={(e: React.MouseEvent) => { e.stopPropagation(); - if (e.shiftKey) { - handleSnapshotSelection(snapshot.short_id, e); - } + handleSnapshotSelection(snapshot.short_id, e); }} aria-label={`Select snapshot ${snapshot.short_id}` as string} />