Skip to content

Commit

Permalink
webinterface: show suspended PRs always in the same order
Browse files Browse the repository at this point in the history
The suspended PRs were shown in random order.
When reloading the page, the order might have changed.

Show the suspended PRs in the same order then the active PRs, this makes
them easier to find.
  • Loading branch information
fho committed Jan 6, 2025
1 parent 65afa64 commit 0f90bc0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/autoupdater/httplistdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package autoupdater
import (
"fmt"
"net/url"
"slices"
"strconv"
"time"

Expand Down Expand Up @@ -50,6 +51,9 @@ func (a *Autoupdater) httpListData() *types.ListData {

activePRs, suspendedPRs := queue.asSlices()

// sort them PRs to show list in a stable order in the UI
slices.SortFunc(suspendedPRs, orderBefore)

queueData.ActivePRs = toPagesPullRequests(activePRs)
queueData.SuspendedPRs = toPagesPullRequests(suspendedPRs)

Expand All @@ -64,6 +68,7 @@ func toPagesPullRequests(prs []*PullRequest) []*types.PullRequest {
for i, pr := range prs {
result = append(result, toPagesPullRequest(pr, i == 0))
}

return result
}

Expand Down

0 comments on commit 0f90bc0

Please sign in to comment.