Page MenuHomePhabricator

[native] Display the spoiler content on tap
ClosedPublic

Authored by rohan on Oct 17 2022, 12:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 10:57 AM
Unknown Object (File)
Thu, Apr 18, 7:32 PM
Unknown Object (File)
Thu, Apr 18, 4:26 AM
Unknown Object (File)
Tue, Apr 16, 8:16 AM
Unknown Object (File)
Sat, Apr 13, 12:49 PM
Unknown Object (File)
Thu, Apr 11, 7:59 AM
Unknown Object (File)
Tue, Apr 9, 4:51 AM
Unknown Object (File)
Sat, Apr 6, 5:30 PM
Subscribers

Details

Summary

We render a new Spoiler component for text content parsed to be spoilers. Upon tap, this Spoiler component reveals the text beneath
(https://linear.app/comm/issue/ENG-2011/display-the-spoiler-content-on-tap-within-messagelist-[native]). This diff will not be landed until ENG-2072 is addressed, to resolve the spoiler state not being remembered upon message tap.

Depends on D5373

Test Plan

Spoiler messages are revealed when tapping the spoiler content.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan edited the test plan for this revision. (Show Details)
native/components/spoiler.react.js
27 ↗(On Diff #17625)

nit: For some reason, this feels weird to me, I would write it like this

I'd see what @atul says as well

ginsu requested changes to this revision.Oct 18 2022, 1:05 PM
This revision now requires changes to proceed.Oct 18 2022, 1:05 PM
native/components/spoiler.react.js
27 ↗(On Diff #17625)

Thanks for pointing it out, I think it looks better with your suggestion

Update ReactElement import

Looks good, but we should hold off on landing until we figure out the stuff discussed here: https://linear.app/comm/issue/ENG-2072/maintain-the-spoiler-state-upon-opening-textmessagetooltipmodal

We probably don't want to make a release with broken spoiler support

native/components/spoiler.react.js
24 ↗(On Diff #17650)

We could call this memoizedSpoiler or something

nice thanks for addressing my feedback!

This revision is now accepted and ready to land.Oct 19 2022, 11:07 AM
In D5383#159554, @atul wrote:

Looks good, but we should hold off on landing until we figure out the stuff discussed here: https://linear.app/comm/issue/ENG-2072/maintain-the-spoiler-state-upon-opening-textmessagetooltipmodal

We probably don't want to make a release with broken spoiler support

Yeah that's the plan, after ENG-2072 is approved then I'll land the diffs in this stack and that should allow for working spoilers on native. Thanks for the feedback, I'll address it in my next revision

Rename memoizedText to memoizedSpoiler

I actually don't think it's crazy to launch spoilers with the issue that the spoilers get re-hidden if you select a message

I actually don't think it's crazy to launch spoilers with the issue that the spoilers get re-hidden if you select a message

I think either solution is fine - we can hold off on landing until the ENG-2072 (https://linear.app/comm/issue/ENG-2072/maintain-the-spoiler-state-upon-opening-textmessagetooltipmodal) is done, or land what is in this stack now! Open to either

Update Spoiler to MarkdownSpoiler

Rebase and resolve conflicts

Rebase (pending testing since my dev environment isn't working properly
again)

This revision was automatically updated to reflect the committed changes.