Skip to content

feat: sort activity lists newest-first#717

Merged
RussH merged 2 commits intoopencats:masterfrom
anonymoususer72041:feat/activity-lists-newest-first
Apr 23, 2026
Merged

feat: sort activity lists newest-first#717
RussH merged 2 commits intoopencats:masterfrom
anonymoususer72041:feat/activity-lists-newest-first

Conversation

@anonymoususer72041
Copy link
Copy Markdown
Contributor

Summary

This PR changes activity list ordering to show the newest entries first across the application where activity lists are rendered via the shared activity retrieval logic.

It updates the core activity queries to sort by the existing created-date sort field in descending order and adds a deterministic tie-breaker by activity_id (descending) to ensure stable ordering when timestamps are identical.

Additionally, the Activities module DataGrid ordering is hardened by appending an activityID tie-breaker when sorting by dateCreatedSort.

Motivation

Seeing the most recent activity first is the expected UX for activity feeds and improves day-to-day usability when reviewing recent interactions.

The deterministic activity_id tie-breaker avoids unstable ordering caused by equal timestamps, making list rendering predictable and preventing confusing “random” reordering between page loads or environments.

@anonymoususer72041 anonymoususer72041 changed the title feat(activity): sort activity lists newest-first feat: sort activity lists newest-first Feb 17, 2026
@anonymoususer72041
Copy link
Copy Markdown
Contributor Author

Not sure if 691e59f is needed

@RussH RussH self-requested a review April 22, 2026 11:35
Copy link
Copy Markdown
Member

@RussH RussH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good again!

One small point before merge: in the Activities datagrid path the tie-breaker is always appended as activityID DESC whenever sorting by dateCreatedSort. That makes ordering deterministic, but if a user explicitly sorts oldest-first the secondary ordering still runs newest ID first, which is a bit inconsistent with the chosen sort direction.

Could you either drop that second commit if it is not actually needed, or adjust it so the activityID tie-breaker follows the same direction as dateCreatedSort?

@anonymoususer72041 anonymoususer72041 force-pushed the feat/activity-lists-newest-first branch from 691e59f to ccb2ee3 Compare April 22, 2026 11:58
@anonymoususer72041
Copy link
Copy Markdown
Contributor Author

Could you either drop that second commit if it is not actually needed, or adjust it so the activityID tie-breaker follows the same direction as dateCreatedSort?

It's actually not needed but useful, so I decided to provide a fix.

Copy link
Copy Markdown
Member

@RussH RussH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - this fix looks great.

@RussH RussH merged commit 11b9a3a into opencats:master Apr 23, 2026
3 checks passed
@anonymoususer72041 anonymoususer72041 deleted the feat/activity-lists-newest-first branch April 23, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants