robrix icon indicating copy to clipboard operation
robrix copied to clipboard

WIP: Sort room list by date

Open henri2h opened this issue 9 months ago • 5 comments

When filtering rooms and after reseting the filter, sort rooms according to the timestamp of the last m.room.message event.

henri2h avatar Mar 02 '25 22:03 henri2h

Formatting went wrong, are you using a custom configuration for cargo fmt?

henri2h avatar Mar 02 '25 22:03 henri2h

Formatting went wrong, are you using a custom configuration for cargo fmt?

Thanks for your contributing!

Currently, no any format is enabled, please change your editor setting like this(i use zed):

"format_on_save": "off"

aaravlu avatar Mar 03 '25 03:03 aaravlu

hi!@henri2h Thank you for your contribution, as we don't have a unified fixed version of format at the moment, it may cause local format formatting, please ignore these changes and commit again.

tyreseluo avatar Mar 03 '25 06:03 tyreseluo

When filtering rooms and after reseting the filter, sort rooms according to the timestamp of the last m.room.message event.

Thanks @henri2h! Sorting by recency is a good feature to add, but it should be done based on the server-provided recency timestamp, not based on the timestamp of the latest message event (which may not always exist). Native/simplified sliding sync already offers a recency-based filter (it might even be the default), so we should use that instead.

Regarding formatting, we have not yet set that up because I generally dislike auto-formatters. We'll set it up soon now that the project is gaining traction & contributors, but for now, kindly disable your editor's auto-formatter.

kevinaboos avatar Mar 03 '25 19:03 kevinaboos

thanks for the reply, I removed the auto formatting. Indeed, the sliding sync mechanism provide a way to maintain a sorted room list. Currently modifying my pull request to exploit it instead of filtering the room manually.

henri2h avatar Mar 03 '25 22:03 henri2h

@henri2h Please resolve the merge conflicts. Also, is this task finished? If so, you can remove the "WIP" from the title so we can review it.

ZhangHanDong avatar Jun 13 '25 07:06 ZhangHanDong

@henri2h You haven’t fully implemented this feature, have you? I suggest you convert it to a draft PR first. When you’ve completely finished and are ready for review, you can change it back to a regular PR.

ZhangHanDong avatar Jun 17 '25 10:06 ZhangHanDong

Hi @ZhangHanDong, sorry for the delay I tried rebasing this MR on the latest commits but the code change a lot since last time and I don't have time to work anymore on this. I will close this merge request.

henri2h avatar Jun 17 '25 15:06 henri2h