chore(chats): improve chats so that the Dioxus key field can prevent unnecessary re-renders #792
Labels
assigned 💻
chat 📺
Tickets that have to do with chat
chore 🧹
high priority
Tickets here need to be finished asap
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
render_message_group
MessageGroup
render_messages
render_message
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:
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.The text was updated successfully, but these errors were encountered: