fix: reply sort direction now follows the comment sort pill (descending param)

Replies within a comment thread were always sorted ascending regardless of
the descending parameter. Now they respect it, matching root comment sort.
This commit is contained in:
Xisheng-Zhao
2026-06-07 17:32:04 +08:00
parent ff09efe3a1
commit 01acd39ac9
@@ -200,7 +200,9 @@ final class IssueCommentThreads {
ArrayList<Thread> threads = new ArrayList<>();
for (Models.Comment root : roots) {
ArrayList<Models.Comment> replies = repliesByRoot.getOrDefault(clean(root.id), new ArrayList<>());
replies.sort(IssueCommentThreads::compareCreatedAt);
replies.sort((left, right) -> descending
? compareCreatedAt(right, left)
: compareCreatedAt(left, right));
threads.add(new Thread(root, replies));
}
return threads;