When adding a reaction (emoji) to an image or gif that has been minimized (small black triangle) before, that media will get re-opened on all clients.
Media does not get maximized
Media gets maximized on every client
I guess the server emits the message, after it was reacted to:
That upserts the message on the client side
while the collapsed-status is not saved in the model:
causing the collapsed-status to be reset.
A solution could be to add the collapsed-status to the message model (unfortunately this is where my JS/Meteor ends)
I'm not that familiar with Rocket.Chat codebase enough, but I think that adding collapsed-status to the message model would not be the best choice. We don't want the collapse-status of a person to be stored in the server or to affect the collapse-status of another client.
Collapse-status should be stored on the client side and the client should decide that whether to collapseMediaByDefault or not.
The problem, in this case, is that when a person reacts on a media. An event is published from the server which makes the 'rocketchat-message-attachments' component re-render on the client side. When that component re-renders it checks for 'unless mediaCollapsed' status which returns true and the expanded image is rendered.
I'm not sure what's making this.collapsed of Template.messageAttachment to reset.
I'm new to Rocket.Chat and I would like to work on this issue. It would be great if someone from Rocket.Chat community could mentor me.
@tassoevan could I work on this issue?
@himanish-star 馃弫Go ahead! Contact me if you need some help.