Fix descending sort for activity dates and add theme redraw
- Use Order.flip(Order.Date) instead of Order.Date to sort threads, projects, and repository groups by most recent activity first - Add setNeedsDisplayForVisibleBounds() to theme didSet to match the pattern of all other visual properties in ReviewDiffContentView
This commit is contained in:
2 files changed
+8
-3
No files matched your search
@@ -737,6 +737,7 @@ private final class ReviewDiffContentView: UIView, UIGestureRecognizerDelegate {
|
||||
didSet {
|
||||
tokenColorsByHex.removeAll()
|
||||
tokenAttributedStringsByRowId.removeAll()
|
||||
setNeedsDisplayForVisibleBounds()
|
||||
}
|
||||
}
|
||||
private(set) var contentHeight: CGFloat = 0
|
||||
|
||||
@@ -83,7 +83,7 @@ export function groupProjectsByRepository(input: {
|
||||
const threads = Arr.sortWith(
|
||||
threadsByProjectKey.get(projectKey) ?? [],
|
||||
(s) => new Date(s.updatedAt ?? s.createdAt),
|
||||
Order.Date,
|
||||
Order.flip(Order.Date),
|
||||
);
|
||||
|
||||
const latestActivityAt = deriveProjectLatestActivity(project, threads);
|
||||
@@ -123,10 +123,14 @@ export function groupProjectsByRepository(input: {
|
||||
projects: Arr.sortWith(
|
||||
[...existing.projects, projectGroup],
|
||||
(s) => new Date(s.latestActivityAt),
|
||||
Order.Date,
|
||||
Order.flip(Order.Date),
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
return Arr.sortWith([...grouped.values()], (s) => new Date(s.latestActivityAt), Order.Date);
|
||||
return Arr.sortWith(
|
||||
[...grouped.values()],
|
||||
(s) => new Date(s.latestActivityAt),
|
||||
Order.flip(Order.Date),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user