-
Notifications
You must be signed in to change notification settings - Fork 170
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
Adding spoiler tag support #990
Conversation
Looks great but I would probably put that |
I disagree, we already have a markwon plugin in this file and we shouldn't be dumping everything in Utils if there is a better place for it. If the custom plugins become too much to contain in this file, it'd be better to make a package for them. |
I don't mean the utils.kt, the package Utils as a file. Common package already contains too many non composables that aren't used commonly. When my PRs get merged I look into getting Account & navigation stable. And I'll move nav out of common into a proper package. |
@MV-GH I hope I understood you correctly with this change 🤣 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested this, and it works great, but unfortunately the click to collapse comment
overrides it. Although you can long-click to reveal the spoiler.
@MV-GH @twizmwazin I'm not sure if we should merge as is, and tackle that one separately.
Hey @dessalines, thanks for the 👀 I'm happy to tackle it pronto, I just need a teensy bit of guidance. Does Compose have a 'preventDefault` option? |
Is the issue that tapping to reveal conflicts with tapping to collapse a comment? If so, the desired behavior I think is that for text that is intractable, such as a spoiler, that text's behavior should take precedence over collapsing the comment. There is space in the comment header that will always be empty/non-interactable to collapse a comment even if the entire body is interactable. For implementation, it would be intuitive to me if setting |
The spoiler tag is only a |
Oops, didn't see #695 |
|
||
val wrapper = object : ClickableSpan() { | ||
override fun onClick(p0: View) { | ||
textView.cancelPendingInputEvents() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out it's as easy as this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx!
studio64_2SBC6yGk9b.mp4Spoilers are clickable in preview mode, imo they shouldnt |
If everyone agrees, it's easy to remove |
I am pretty sure the others will agree with this. What approach were you going to take for this? |
I can add a Preview-Non-Clickable.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once interaction is disabled for preview. Your approach sounds good.
Addressing: #627
Adding
::: spoiler
tag support for JerboaSpoiler.Tag.mp4
Nested tags are not supported and parsing can be weird if the syntax isn't correct
I'll wait for #734 to be merged, update and then put mine up for review
Post used for testing: https://voyager.lemmy.ml/post/1053