Page MenuHomePhabricator

[native] deduped open thread and create thread option
ClosedPublic

Authored by ginsu on Oct 20 2022, 2:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 28, 11:36 PM
Unknown Object (File)
Thu, Nov 28, 11:35 PM
Unknown Object (File)
Thu, Nov 28, 11:35 PM
Unknown Object (File)
Thu, Nov 28, 11:35 PM
Unknown Object (File)
Tue, Nov 26, 3:01 PM
Unknown Object (File)
Mon, Nov 25, 11:54 AM
Unknown Object (File)
Mon, Nov 25, 3:45 AM
Unknown Object (File)
Sun, Nov 24, 11:00 PM

Details

Summary

deduped open_thread and create_thread to just be thread. This is because both create_thread and open_thread have the same function. This diff was inspired by this comment on D5381


Depends on D5381
Linear Task: ENG-2037

Test Plan

Please watch the video demo to see that there are no visaul or performance regressions:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/chat/text-message.react.js
124–125 ↗(On Diff #17793)

removed this if condition because this.props.canCreateSidebarFromMessage will always be true for all messages, while this.props.item.threadCreatedFromMessage will not always be true

native/navigation/tooltip.react.js
132–133 ↗(On Diff #17793)

we need to keep these conditions because MultimediaMessageTooltipModal and RobotextMessageTooltipModal still use create_sidebar and open_sidebar

ginsu requested review of this revision.Oct 20 2022, 2:40 PM
native/navigation/tooltip.react.js
132–133 ↗(On Diff #17793)

Do they need to? Why don't we dedup for them too?

ginsu added inline comments.
native/navigation/tooltip.react.js
132–133 ↗(On Diff #17793)

okay i can do that!

ginsu edited the summary of this revision. (Show Details)

addressed ashoat's comments

ginsu retitled this revision from [native] deduped open thread and create thread option for normal text message to [native] deduped open thread and create thread option.Oct 20 2022, 2:59 PM
ginsu edited the test plan for this revision. (Show Details)
ginsu added inline comments.
native/chat/multimedia-message.react.js
85–87 ↗(On Diff #17794)

removed this if condition because this.props.canCreateSidebarFromMessage will always be true for all messages, while this.props.item.threadCreatedFromMessage will not always be true

atul requested changes to this revision.Oct 21 2022, 2:12 PM

Don't think the following assumption is correct:

removed this if condition because this.props.canCreateSidebarFromMessage will always be true for all messages, while this.props.item.threadCreatedFromMessage will not always be true

native/chat/multimedia-message.react.js
85–87 ↗(On Diff #17794)

this.props.canCreateSidebarFromMessage will always be true for all messages

Ah this isn't always true. For example if you go to one of the sidebars in Daily Updates you'll see that you can't create a sidebar from those messages.

We probably want something like:

if (this.props.item.threadCreatedFromMessage || this.props.canCreateSidebarFromMessage) {
  result.push('sidebar');
}

?

Let me know if I'm missing something here!\

This revision now requires changes to proceed.Oct 21 2022, 2:12 PM

addressed atul's comments

This revision is now accepted and ready to land.Oct 24 2022, 9:03 AM