Skip to content

Commit

Permalink
feat: lc-admin file list is now sorted to prevent display jumps on hi…
Browse files Browse the repository at this point in the history
…ghly active instances

Fixes #396
  • Loading branch information
driskell committed Feb 11, 2023
1 parent 4f28efb commit 17e9014
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lc-admin/views/prospector.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ func (p *Prospector) StartUpdate() {
p.updateChan <- err
return
}

// Sort the files - they are not sorted at the moment
// TODO: This should be resolved in prospector side
sort.Slice(resp.Files, func(i int, j int) bool {
cmp := strings.Compare(resp.Files[i].Path, resp.Files[j].Path)
if cmp == 0 {
// Equal - compare on ID
return strings.Compare(resp.Files[i].Id, resp.Files[j].Id) < 0
}
return cmp < 0
})

p.updateChan <- &resp
}

Expand Down

0 comments on commit 17e9014

Please sign in to comment.