Page MenuHomePhabricator

[native] Display the pinned messages for the thread in the new screen
ClosedPublic

Authored by rohan on Apr 27 2023, 11:15 AM.
Tags
None
Referenced Files
F3388507: D7673.id25877.diff
Fri, Nov 29, 2:39 PM
F3388456: D7673.id26137.diff
Fri, Nov 29, 2:25 PM
F3388447: D7673.id26217.diff
Fri, Nov 29, 2:23 PM
Unknown Object (File)
Tue, Nov 26, 5:12 AM
Unknown Object (File)
Tue, Nov 26, 4:34 AM
Unknown Object (File)
Mon, Nov 11, 3:01 AM
Unknown Object (File)
Mon, Nov 4, 12:18 PM
Unknown Object (File)
Sat, Nov 2, 2:58 PM
Subscribers

Details

Summary

This is the screen that should display the pinned messages / the search results.

Logic is similar to web: https://phab.comm.dev/D7380

Depends on D7672

Test Plan

Check to see the pinned messages render in the screen

Diff Detail

Repository
rCOMM Comm
Branch
pinned_messages_native
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/chat/message-results-screen.react.js
28

The logic is very similar to web: https://phab.comm.dev/D7380

37–38

I can probably use dispatchActionPromise() here to use a loading state

119–144
native/chat/message.react.js
33–39

Here, as well as in text-message.react.js and robotext-message.react.js, I can probably extract this to one shared type, so we only have to update it in one place

native/chat/robotext-message.react.js
31–38

Can probably extract to one shared type (though this is for the flow errors I was running into by not including ChatNavigationProp<'MessageResultsScreen'> and NavigationRoute<'MessageResultsScreen'> here, but I can check if there's a better way to handle this without including it here

native/chat/text-message.react.js
41–48

Can probably extract to one shared type

native/chat/message-result.react.js
50

Accidental change

native/chat/robotext-message.react.js
31–38

Here's a comment of mine on one of @ginsu's diff that explains how to do this in a more idiomatic way. @ginsu can help with pointers if you need any!

native/chat/robotext-message.react.js
31–38

Thanks! I'll take a look and give it a go

Thanks! I'll take a look and give it a go

Is this ready for review at the moment? Sending back to your queue, feel free to re-request review if it is.

atul requested changes to this revision.May 3 2023, 8:13 AM
This revision now requires changes to proceed.May 3 2023, 8:13 AM
native/chat/robotext-message.react.js
31–38

Looking at this again, I can see that we have some ChatNavigationProps and some AppNavigationProps... it'll be pretty messy to select the right one based on the route name, so probably not worth it. I think we can leave this as-is

rohan requested review of this revision.May 5 2023, 11:18 AM
In D7673#228607, @atul wrote:

Thanks! I'll take a look and give it a go

Is this ready for review at the moment? Sending back to your queue, feel free to re-request review if it is.

It's ready for review now, talked about it in my sync with Ashoat and it'll be best to leave it as is at the moment

ashoat requested changes to this revision.May 6 2023, 1:57 AM
ashoat added inline comments.
native/chat/message-results-screen.react.js
58–60 ↗(On Diff #26137)

I think there's a serious issue here – you don't appear to be fetching the pinned messages' related messages (eg. reactions, edits), and are instead relying on them coincidentally being in the Redux store. Is this correct?

I thought you and @inka had been collaborating on this work, and @inka had introduced a utility on the keyserver side that you would be able to use for this. @inka sent this message to you on Thursday:

Screenshot 2023-05-06 at 10.53.51 AM.png (412×1 px, 101 KB)

Have you followed up on that and implemented the functionality to fetch related messages using that utility? If yes, can you please explain why you need to access messageListData here? If no, you'll need to make those changes on both native and web in order to be able to land this project...

This revision now requires changes to proceed.May 6 2023, 1:57 AM
rohan requested review of this revision.May 7 2023, 2:52 PM

Re-requesting review after D7736 and following up about whether we need messageListData or not:

I think so personally, since that seems like the place where the logic for constructing ChatMessageInfoItems is handled (getting the reactions, the thread created from the message, etc.). Without that, I feel like it'd involve a lot of copy-paste for doing all of that

Some nits that aren't super important

native/chat/message-results-screen.react.js
116 ↗(On Diff #26137)

You could use a shorthand and skip the return here

151 ↗(On Diff #26137)

You could use a shorthand and skip the return here

152 ↗(On Diff #26137)

You could use a shorthand and skip the return here

This revision is now accepted and ready to land.May 8 2023, 7:17 AM