Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sdwoodbury opened this issue May 8, 2023 · 2 comments
Assignees
Labels
assigned 💻 chat 📺 Tickets that have to do with chat chore 🧹 high priority Tickets here need to be finished asap

Comments

@sdwoodbury
Copy link
Contributor

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 sdwoodbury added this to Uplink May 8, 2023
@github-project-automation github-project-automation bot moved this to Backlog in Uplink May 8, 2023
@tooshel tooshel changed the title improve chats improve chats so that the Dioxus key field can prevent unnecessary re-renders May 8, 2023
@tooshel tooshel added the high priority Tickets here need to be finished asap label May 8, 2023
@sdwoodbury sdwoodbury self-assigned this May 9, 2023
@sdwoodbury sdwoodbury moved this from Backlog to In Progress in Uplink May 9, 2023
@sdwoodbury
Copy link
Contributor Author

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 sdwoodbury removed their assignment May 9, 2023
@sdwoodbury sdwoodbury moved this from In Progress to Todo in Uplink May 9, 2023
@stavares843 stavares843 changed the title improve chats so that the Dioxus key field can prevent unnecessary re-renders chore(chats): improve chats so that the Dioxus key field can prevent unnecessary re-renders May 15, 2023
@Flemmli97 Flemmli97 self-assigned this Jun 19, 2023
@stavares843 stavares843 added chat 📺 Tickets that have to do with chat chore 🧹 labels Jul 21, 2023
@tooshel
Copy link
Contributor

tooshel commented Jul 26, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned 💻 chat 📺 Tickets that have to do with chat chore 🧹 high priority Tickets here need to be finished asap
Projects
Status: Todo
Development

No branches or pull requests

4 participants