SchildiChat / SchildiChat-android

Matrix client / Element Android fork
https://schildi.chat/android/
Apache License 2.0
386 stars 50 forks source link

Sort rooms with draft messages early in the room list #121

Open Bubu opened 2 years ago

Bubu commented 2 years ago

I often begin to type a message but then get a message in some other room and reply to that first. At that point I'd like to easily go back to my draft message but I need to search for the room again (or go via breadcrumbs but those don't show room names and also I might have looked at too many rooms in-between to quickly find it again.)

So what I'd expect is rooms with draft messages being sorted somewhere at the top of their respective room list category. (I don't actually know if unread rooms are currently sorted at the top of the list or not, but I think this change works regardless of that).

SpiritCroc commented 2 years ago

Sounds useful, but

// implementation details start

is not a one-liner unfortunately, since RoomSummaryEntity does not have a field hasDraft, but only references a UserDraftsEntity, which we can't use for sorting. So we'd probably need to add some artificial hasDrafts field to the db, that we have to keep updated, which sounds particularly annoying considering it's two different entity classes.

// implemenation details end