project-robius / robrix

Robrix: a multi-platform Matrix chat client written in Rust using the Makepad UI toolkit and the Robius app dev framework
MIT License
120 stars 18 forks source link

Display spoilers in text messages #274

Open kevinaboos opened 2 days ago

kevinaboos commented 2 days ago

Currently Robrix does not display anything at all for text message content that is wrapped within a <data-mx-spoiler> tag. This is bad and makes it seem like the message is empty.

The easiest way to implement this is to make the message unreadable by setting the text background color to be the same as the foreground color. (Ideally, we would use a fancy blur animation, but that's quite difficult to implement.)

Then, when the user clicks the spoiler text, we should "reveal" the text and make it readable, e.g., by setting the background color of the text back to normal.

The key to this implementation is to show the Cursor hand upon hovering over the spoiler text, otherwise the user may now be aware that there's anything clickable there.

With this implementation we can optionally choose to hide or show the spoiler reason (if one is given). That's not super important in the first step.

rabelmervin commented 1 day ago

Hi sir @kevinaboos Can i contribute to this issue ? This will be a good learning opportunity for me.