iamb icon indicating copy to clipboard operation
iamb copied to clipboard

Sorting does not work correctly

Open Ahwxorg opened this issue 1 year ago • 2 comments

I use both Element and iamb on my computer, and when I use iamb, the sorting isn't the same. It seems to be random, and not based on time or which chat is unread. Is this normal, and if so, can I change this?

Ahwxorg avatar Dec 04 '24 11:12 Ahwxorg

Looks like room sorting is defined by a user-configurable setting named settings.tunables.sort.rooms (see https://github.com/ulyssa/iamb/blob/main/src/windows/mod.rs#L543). You can configure it in your profile config.

This setting accepts a list of sorting criteria. A "~" before a criterion reverses the default sorting order. For example, {"sort": {"rooms":["unread", "recent"]}} would (sensibly) put unreads first and then sort by most recent activity. {"sort": {"rooms":["unread", "~recent"]}} would put unreads first and then sort by least recent activity (God knows why you'd want to do this).

The full list of options is defined in this enum: https://github.com/ulyssa/iamb/blob/main/src/base.rs#L225

The default is supposed to be:

  1. whether a room is "favorited"
  2. whether a room is marked "low-priority"
  3. whether there are unreads
  4. sort by room name alphabetically -- not the display name/alias, but the real name of the room

(see https://github.com/ulyssa/iamb/blob/main/src/config.rs#L48)

This is a pretty weird sort order, maybe some of your rooms are favorited/low-priority? Or maybe it isn't being applied properly. Could you give an example of how your client sorts rooms, and whether it matches up with this default?

Please note that I haven't tested any of this, nor am I involved in iamb development, I'm just reading the source.

pcarrin2 avatar Dec 06 '24 04:12 pcarrin2

I think it does sort correctly, but somehow all chats are always unread, even ones I have just read.

Ahwxorg avatar Dec 06 '24 08:12 Ahwxorg