mock-foundation / moc

A (really) native and powerful macOS and iPadOS Telegram client, optimized for moderating large communities and personal use. Currently in alpha
GNU General Public License v3.0
119 stars 6 forks source link

Members in Chat Inspector #153

Closed levochkaa closed 1 year ago

levochkaa commented 1 year ago

Added list of members of a chat to chat inspector

Some bugs when scrolling fast, .anchorPreference(key:value:transform:) might fix

ggoraa commented 1 year ago

I have encountered some issues while testing this PR, which is when changing chats, the user list does not update, please fix it

ggoraa commented 1 year ago

And also the user list update process introduces tremendous lag, probably related to fetching everything on the main thread

levochkaa commented 1 year ago

I have encountered some issues while testing this PR, which is when changing chats, the user list does not update, please fix it

It was updating, but just adding list of users from new chat to an old one. Fixed it:

if isInitial {
    self.chatMembers = mappedUsers
} else {
    self.chatMembers += mappedUsers
}
levochkaa commented 1 year ago

And also the user list update process introduces tremendous lag, probably related to fetching everything on the main thread

hope it is fixed, i have removed fetching from the main thread to background

ggoraa commented 1 year ago

Thanks for the fixes! I will test these changes later this day :)

ggoraa commented 1 year ago

Just did the testing:

  1. A clear of the user list still does not work, that thing still thinks that it's in a previous chat
  2. Performance problems did go away, good job!
  3. Also, to fetch the next batch of users the user should do a large overscroll to make it fetch new users, which will definitely not work for folks with mouses, and is generally not that easy to use. I think it's better to fetch some time before reaching the end, so it doesn't feel as janky
ggoraa commented 1 year ago

UPD: tried again, somehow it works differently now, but still broken

Now after changing a chat, the user list does not update at all, it just clears itself and doesn't fill up again

ggoraa commented 1 year ago

Bruh I tried again and the behavior returned back to how it was lmao

ggoraa commented 1 year ago

Tested the new update, now it works as expected! Kind of... If I select a chat which is not a group, it will clear the entire list, as expected, but when I select a group again, it will not show a list of users from that chat, it will stay clear

ggoraa commented 1 year ago

And, if you can, it will be really good if you will add support for updates from TDLib, which will make that list live, and make it update itself when data changes

ggoraa commented 1 year ago

Fuck it, gonna YOLO it and do a merge