-
Notifications
You must be signed in to change notification settings - Fork 25
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
Display spoilers in text messages #274
Comments
<spoiler>
tags in messages
Hi sir @kevinaboos Can i contribute to this issue ? This will be a good learning opportunity for me. |
definitely, go for it! We love to have contributions from anyone, they're much appreciated. |
Thanks @kevinaboos Excited to work on this :) |
Hi @kevinaboos it would be great if you tell me the file location where changes needed. |
Well you'll need to modify a few different things to implement this. First up would be to create a Spoiler widget, probably in its own separate file, which includes the blurred or colored-over view of the hidden text and the spoiler reason text, both as Rust states. You'll also need to implement click handlers for the Spoiler widget such that it can transform info plaintext upon click. |
So this was a bit more complex than I initially thought, but I have just implemented both background colors and spoilers myself (they use similar techniques). @rabelmervin Just wanted to let you know in case you were still tinkering with it. |
Yeah @kevinaboos , Initially i struggled with this issue a lot Since, I was new to rust and failed to fix this issue. |
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.
The text was updated successfully, but these errors were encountered: