project-robius / robrix

A multi-platform Matrix chat client written in pure Rust using the Makepad UI toolkit and the Robius app dev framework
MIT License
93 stars 17 forks source link

Each `RoomScreen` widget should only handle `MessageAction`s from its own room #197

Closed kevinaboos closed 1 week ago

kevinaboos commented 3 weeks ago

Now that Robrix supports viewing multiple rooms simultaneously, it is possible for one RoomScreen to handle MessageActions or other events that pertain to other rooms.

For example, when you have 3 rooms visible and you click the reply button next to a message, all 3 rooms will display their reply previews for their respective messages at the given item ID in that room's timeline, which is obviously not desirable behavior.

This is a relatively easy fix but requires checking for widget UIDs/paths in the RoomScreen's action/event handler function. This is much preferred over the alternative approach of including the OwnedRoomId in every single action, which has high memory overhead.

Demolemon11 commented 3 weeks ago

I am sorry, I am a little pulzz about what you mentioned above. Maybe I will have a better understanding if you can provide some pictures or log info :)

alanpoon commented 3 weeks ago

https://github.com/user-attachments/assets/21f943b0-8839-4957-8404-9247b7c32e39

@Demolemon11 Can you spot the bug? The reply box of the second chat room keeps appearing whenever user wants to reply in the first chat room.

alanpoon commented 3 weeks ago

I am looking at this issue