Skip to content

Commit abbf6b1

Browse files
committed
fix: sort by last_indexed_at first, add aria-label to delete confirm input
Sort: never-indexed repos no longer jump ahead of recently indexed ones. last_indexed_at is primary sort key, created_at is tiebreaker only. Accessibility: delete confirmation input now has aria-label for screen readers. Skipped: function_count > 0 (intentional), motion.button nesting (large refactor), slug-based confirm (users think in repo names).
1 parent 6de079c commit abbf6b1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

frontend/src/components/RepoList.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,11 @@ export function RepoList({ repos, selectedRepo, onSelect, onDelete, onAddClick,
196196
const sorted = [...repos]
197197
if (sortMode === 'recent') {
198198
sorted.sort((a, b) => {
199-
const aTime = a.last_indexed_at || a.created_at || ''
200-
const bTime = b.last_indexed_at || b.created_at || ''
201-
return bTime.localeCompare(aTime)
199+
// Prefer last_indexed_at; use created_at only as tiebreaker
200+
const aIdx = a.last_indexed_at || ''
201+
const bIdx = b.last_indexed_at || ''
202+
if (aIdx !== bIdx) return bIdx.localeCompare(aIdx)
203+
return (b.created_at || '').localeCompare(a.created_at || '')
202204
})
203205
} else if (sortMode === 'name') {
204206
sorted.sort((a, b) => a.name.localeCompare(b.name))
@@ -312,6 +314,7 @@ export function DeleteConfirmDialog({
312314
value={confirmText}
313315
onChange={(e) => setConfirmText(e.target.value)}
314316
placeholder={repoName}
317+
aria-label={`Type ${repoName} to confirm deletion`}
315318
autoFocus
316319
/>
317320
</div>

0 commit comments

Comments
 (0)