From ce3cfad7f89f3803a37911d085d75d4ef7cc9bc8 Mon Sep 17 00:00:00 2001 From: Tyler Koenig Date: Tue, 21 Jul 2026 20:41:21 -0400 Subject: [PATCH] fix(tui): sort groups by active sort column instead of fixed ID order --- internal/tui/data.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/tui/data.go b/internal/tui/data.go index 7bb0f73..ef762d8 100644 --- a/internal/tui/data.go +++ b/internal/tui/data.go @@ -77,8 +77,6 @@ func sortSitesForDisplay(allSites []models.Site, collapsed map[int]bool, sortCol ungrouped = append(ungrouped, s) } } - sort.Slice(groups, func(i, j int) bool { return groups[i].ID < groups[j].ID }) - sortSlice := func(s []models.Site) { sort.Slice(s, func(i, j int) bool { return s[i].ID < s[j].ID }) sort.SliceStable(s, func(i, j int) bool { @@ -98,6 +96,7 @@ func sortSitesForDisplay(allSites []models.Site, collapsed map[int]bool, sortCol }) } + sortSlice(groups) for pid := range children { c := children[pid] sortSlice(c)