Uplink icon indicating copy to clipboard operation
Uplink copied to clipboard

chore(chats): improve chats so that the Dioxus key field can prevent unnecessary re-renders

Open sdwoodbury opened this issue 2 years ago • 2 comments

when a conversation is displayed, messages are "grouped". I think that messages should be grouped in a way that doesn't require rendering additional elements. Currently the additional elements involve MessageGroups, GroupedMessages, etc. I think that doing this results in all the messages being re-rendered when the app re-renders.

current steps to render messages: render_message_groups image

render_message_group image

MessageGroup image

render_messages image

render_message image

All this serves to do is wrap the messages in a CSS class that changes the color or some of the pixels in one of the corners of the chat bubbles: image

I think we should take the list of messages and in a single loop/iterator, on the fly, calculate which messages should be grouped. Such a change would allow for the Dioxus key field to prevent unnecessary re-renders and greatly simplify the code.

sdwoodbury avatar May 08 '23 18:05 sdwoodbury

there's a branch called refactor/messages2 which tries to fix this. It's a work in progress. if anyone else wants to take the ticket, that branch is probably a good place to start.

sdwoodbury avatar May 09 '23 18:05 sdwoodbury

This is part of the state rework that @Flemmli97 has been working on.

tooshel avatar Jul 26 '23 17:07 tooshel