Page MenuHomePhabricator

[native] Extract function for modyfing items to be displayed in MessageResult
ClosedPublic

Authored by inka on May 10 2023, 3:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 3:45 PM
Unknown Object (File)
Thu, Apr 11, 12:45 PM
Unknown Object (File)
Thu, Apr 11, 12:45 PM
Unknown Object (File)
Thu, Apr 11, 12:45 PM
Unknown Object (File)
Thu, Apr 11, 12:45 PM
Unknown Object (File)
Thu, Apr 11, 12:45 PM
Unknown Object (File)
Wed, Mar 27, 11:53 PM
Unknown Object (File)
Mar 3 2024, 4:24 AM
Subscribers

Details

Summary

issue: https://linear.app/comm/issue/ENG-3864/update-messageresult-style#comment-fe30cc85
For pinned messages and search results to be displayed correctly in the MessageResult, their data needs to be changed. I'm extracting this logic and using it ine MessageResult iteself to avoid duplicating code

Test Plan

Pinned a message, navigated to the pinned messages screen. Checked that the messages display correctly in the pinned messages screen and in the pin messages modal.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Extract code from the pin modal as well

inka requested review of this revision.May 10 2023, 3:39 AM
ashoat requested changes to this revision.May 11 2023, 3:45 AM
ashoat added inline comments.
native/chat/message-result.react.js
38 ↗(On Diff #26324)

Why isn't this memoized? You're forcing Message to rerender on every render of MessageResult

40 ↗(On Diff #26324)

This invariant would not be necessary if you return ChatMessageInfoItemWithHeight from modifyItemForResultScreen

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

Why isn't this necessary here anymore? Does MessageResultsScreen call MessageResult, and MessageResult handles it now?

native/chat/toggle-pin-modal.react.js
70 ↗(On Diff #26324)

Does TogglePinModal call MessageResult? Wondering if this is a duplicate call, and why MessageResultsScreen doesn't need this but TogglePinModal does

74 ↗(On Diff #26324)

This invariant would not be necessary if you return ChatMessageInfoItemWithHeight from modifyItemForResultScreen

native/chat/utils.js
417 ↗(On Diff #26324)

You can return ChatMessageInfoItemWithHeight here

This revision now requires changes to proceed.May 11 2023, 3:45 AM
native/chat/message-results-screen.react.js
119 ↗(On Diff #26324)

Yes

native/chat/toggle-pin-modal.react.js
70 ↗(On Diff #26324)

Yes, TogglePinModal calls MessageResult . This is a mistake

inka planned changes to this revision.May 12 2023, 1:09 AM
This revision is now accepted and ready to land.May 12 2023, 9:37 AM