Page MenuHomePhabricator

[native] render thread avatars for parent/child threads in thread settings
ClosedPublic

Authored by ginsu on Mar 21 2023, 10:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 9:53 AM
Unknown Object (File)
Mon, Nov 25, 7:51 AM
Unknown Object (File)
Mon, Nov 25, 5:28 AM
Unknown Object (File)
Sat, Nov 9, 3:24 PM
Unknown Object (File)
Wed, Nov 6, 3:16 AM
Unknown Object (File)
Mon, Nov 4, 11:16 PM
Unknown Object (File)
Oct 27 2024, 12:05 AM
Unknown Object (File)
Oct 27 2024, 12:05 AM
Subscribers

Details

Summary

rendered thread avatars for both parent and child threads in thread settings


Test Plan

Please check out these screenshots to see the changes I made:

staff user:

Screenshot 2023-03-22 at 3.55.48 AM.png (1×1 px, 862 KB)

non staff user:

Screenshot 2023-03-22 at 3.56.31 AM.png (1×1 px, 776 KB)

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ashoat requested changes to this revision.Mar 22 2023, 1:51 PM
ashoat added inline comments.
native/chat/settings/thread-settings-child-thread.react.js
34 ↗(On Diff #23968)

Why do we need to use useResolvedThreadInfo?

This revision now requires changes to proceed.Mar 22 2023, 1:51 PM
native/chat/settings/thread-settings-parent.react.js
19

I created this component here so that I could pass in the parentThreadInfo as ThreadInfo instead of ?ThreadInfo into the useGetAvatarForThread hook, I figured since this is such a small component and is used just here for now, we could keep the component in this file; however, if we should keep this in a separate file, lmk and I will quickly do that

Accepting to unblock but the pattern of copy-paste is concerning

native/chat/settings/thread-settings-child-thread.react.js
33–45

This is basically copy-pasted from D7136, with a different size. Why don't we extract this into a component?

native/chat/settings/thread-settings-parent.react.js
31–41

Seems like more copy-paste. As I've mentioned before: when you copy-paste code, an alarm should be ringing through your head. You shouldn't wait until you get comments from a reviewer to address it

This revision is now accepted and ready to land.Mar 26 2023, 6:03 AM

Accepting to unblock but the pattern of copy-paste is concerning

native/chat/settings/thread-settings-child-thread.react.js
33–45

Created a task to track this concern and should offer more context on why we didn't extract from the beginning.

https://linear.app/comm/issue/ENG-3413/factor-out-copy-pasted-feature-flag-logic-code

native/chat/settings/thread-settings-parent.react.js
31–41
ginsu edited the summary of this revision. (Show Details)

rebase before landing/updated order in stack so I can unblock landing this diff