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
F3364171: D5451.diff
Mon, Nov 25, 3:45 AM
F3362525: D5451.id17856.diff
Sun, Nov 24, 11:00 PM
F3362524: D5451.id17794.diff
Sun, Nov 24, 10:59 PM
F3362523: D5451.id17793.diff
Sun, Nov 24, 10:59 PM
Unknown Object (File)
Fri, Nov 22, 10:11 AM
Unknown Object (File)
Fri, Nov 22, 10:01 AM
Unknown Object (File)
Fri, Nov 22, 9:44 AM
Unknown Object (File)
Fri, Nov 22, 8:48 AM

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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/chat/text-message.react.js
124–125

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

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

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

ginsu added inline comments.
native/navigation/tooltip.react.js
132–133

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