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
F3372326: D7770.id26323.diff
Tue, Nov 26, 6:15 AM
F3370282: D7770.id26934.diff
Tue, Nov 26, 1:46 AM
Unknown Object (File)
Fri, Nov 22, 5:18 PM
Unknown Object (File)
Fri, Nov 22, 4:58 PM
Unknown Object (File)
Fri, Nov 22, 12:31 PM
Unknown Object (File)
Fri, Nov 8, 8:38 AM
Unknown Object (File)
Mon, Nov 4, 8:33 AM
Unknown Object (File)
Fri, Nov 1, 5:33 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
No Lint Coverage
Unit
No Test Coverage

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