Skip to content

Commit 1751f9a

Browse files
abidlabsclaude
andcommitted
Address Copilot review feedback
- Fall back to selecting all runs when no previously selected run still exists, so deletions don't leave an empty selection. - Add aria-label to the Runs filter input for screen readers. - Add regression test for the empty-intersection fallback. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 488d52f commit 1751f9a

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

trackio/frontend/src/lib/selection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function reconcileSelectedRuns(prevSelected, newOrderedIds) {
99
const newIdSet = new Set(ordered);
1010
const kept = prev.filter((r) => newIdSet.has(r));
1111

12-
if (prev.length === 0) {
12+
if (prev.length === 0 || kept.length === 0) {
1313
return [...ordered];
1414
}
1515

trackio/frontend/src/lib/selection.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,13 @@ describe("reconcileSelectedRuns", () => {
3636
test("drops runs that no longer exist on the server", () => {
3737
expect(reconcileSelectedRuns(["a", "b", "c"], ["a", "c"])).toEqual(["a", "c"]);
3838
});
39+
40+
test("falls back to all runs when none of the previously selected runs exist anymore", () => {
41+
expect(reconcileSelectedRuns(["a"], ["b"])).toEqual(["b"]);
42+
expect(reconcileSelectedRuns(["x", "y"], ["a", "b", "c"])).toEqual([
43+
"a",
44+
"b",
45+
"c",
46+
]);
47+
});
3948
});

trackio/frontend/src/pages/Runs.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
<input
122122
type="text"
123123
class="filter-input"
124+
aria-label="Filter runs"
124125
placeholder="Filter runs..."
125126
bind:value={filterText}
126127
/>

0 commit comments

Comments
 (0)