5
submitted 5 months ago* (last edited 5 months ago) by blawsybogsy@lemmy.ml to c/lemmydev@lemm.ee

I just implemented a user overview of mixed posts and comments, but I'm unsure how to do so while respecting sort (hot, new, old, etc.). Currently I merge the user's comments and posts into a list, then sort them all by timestamp.

Because sorting is handled on the server, and merging posts/comments happens after, I can't see how I can't respect sort and still merge the two sets. Does anyone have any pointers?

I expect a similar issue would arise for the unified inbox view also (replies, mentions, and private messages), although in that case there's less need to sort by anything other than recency.

EDIT: here's the relevant ts code in the official lemmy ui. it sorts by date if sort is new, which i already do, then otherwise it just sorts by "score".

https://github.com/LemmyNet/lemmy-ui/blob/79ed5903354067636f5eb9686ff0a005117bc541/src/shared/components/person/person-details.tsx#L245

all 2 comments
sorted by: hot top controversial new old
[-] blawsybogsy@lemmy.ml 1 points 5 months ago

maybe it can't be done? I think Jerboa doesn't implement, but i thought the web UI did...

this post was submitted on 26 Feb 2024
5 points (85.7% liked)

Lemmy App Development

693 readers
18 users here now

A place for Lemmy builders to chat about building apps, clients, tools and bots for the Lemmy platform.

On-Topic:

Off-Topic:

founded 1 year ago
MODERATORS