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.
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.