feat(sidebar): add last activity task sorting (#2762)

This commit is contained in:
Carlos Florêncio
2026-08-18 10:15:42 +01:00
committed by GitHub
parent 270ddbff8f
commit 704f652f30
74 changed files with 2525 additions and 162 deletions
+18 -1
View File
@@ -426,7 +426,7 @@ func convertBatchedPRResult(raw *batchedPRResult, owner, repo string, number int
reviewState := summarizeReviewState(raw.Reviews.Nodes)
checksState := ""
if len(raw.Commits.Nodes) > 0 && raw.Commits.Nodes[0].Commit.StatusCheckRollup != nil {
checksState = strings.ToLower(raw.Commits.Nodes[0].Commit.StatusCheckRollup.State)
checksState = normalizeGraphQLCheckRollupState(raw.Commits.Nodes[0].Commit.StatusCheckRollup.State)
}
unresolved := 0
for _, t := range raw.ReviewThreads.Nodes {
@@ -447,6 +447,23 @@ func convertBatchedPRResult(raw *batchedPRResult, owner, repo string, number int
}
}
// normalizeGraphQLCheckRollupState converts GitHub's GraphQL status-rollup
// enum to the smaller contract shared by REST and TaskPR persistence.
func normalizeGraphQLCheckRollupState(raw string) string {
switch strings.ToLower(strings.TrimSpace(raw)) {
case "":
return ""
case checkStatusSuccess:
return checkStatusSuccess
case checkConclusionFail, "error":
return checkConclusionFail
case "expected", checkStatusPending:
return checkStatusPending
default:
return ""
}
}
// reviewNodesToSamples converts the GraphQL reviewNode shape to the shared
// reviewSample slice used by the dedup helpers in client_helpers.go.
func reviewNodesToSamples(nodes []reviewNode) []reviewSample {