Skip to content

Commit 181e3ea

Browse files
authored
Merge pull request #29 from Multiplier-Labs/fix/sidebar-alphabetical-sort
Fix sidebar repo ordering to sort alphabetically
2 parents e01df1d + 77860aa commit 181e3ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/LeftSidebar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ function buildRepoNodes(
5151
list.push(s)
5252
map.set(key, list)
5353
}
54-
return Array.from(map.entries()).map(([key, repoSessions]) => ({
54+
return Array.from(map.entries()).sort((a, b) => {
55+
const nameA = a[0].replace(/\/+$/, '').split('/').pop() ?? a[0]
56+
const nameB = b[0].replace(/\/+$/, '').split('/').pop() ?? b[0]
57+
return nameA.localeCompare(nameB)
58+
}).map(([key, repoSessions]) => ({
5559
workingDir: key,
5660
displayName: repoDisplayName(key),
5761
sessions: repoSessions,

0 commit comments

Comments
 (0)