Page MenuHomePhabricator

[lib] Introduce a canBeRenderedOnItsOwn boolean to message specs
ClosedPublic

Authored by rohan on Oct 19 2023, 6:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 3:17 PM
Unknown Object (File)
Sat, Oct 19, 4:20 AM
Unknown Object (File)
Sat, Oct 19, 4:20 AM
Unknown Object (File)
Sat, Oct 19, 4:20 AM
Unknown Object (File)
Sat, Oct 19, 4:18 AM
Unknown Object (File)
Sat, Oct 19, 4:02 AM
Unknown Object (File)
Sep 23 2024, 5:13 AM
Unknown Object (File)
Sep 15 2024, 1:14 PM
Subscribers

Details

Summary

Now that I've introduced flags for determining sidebar sources / pin sources, the last two steps for ENG-4849 are about refining existing code. Primarily message-fetchers.js code. Taking a look at rawMessageInfoForRowsAndRelatedMessages, we filter out SIDEBAR_SOURCE, TOGGLE_PIN, REACTION and EDIT_MESSAGE. To make this cleaner, we can simplify this since search results will only show TEXT messages, and it's not possible to pin SIDEBAR_SOURCE or TOGGLE_PIN. This new flag, canBeRenderedOnItsOwn, will be set for REACTION and EDIT_MESSAGE, and we'll now check the message specs in the next diff to clean up this code.

Resolves https://linear.app/comm/issue/ENG-5216/introduce-a-canberenderedonitsown-boolean-to-message-specs

Depends on D9445

Test Plan

Updated unit tests, ran yarn workspace lib test, and verified that nothing crashes after introducing a new flag to the message specs

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan held this revision as a draft.
rohan published this revision for review.Oct 19 2023, 7:49 AM

Looks good, thanks for proactively including unit tests


canBeRenderedOnItsOwn => canBeRenderedIndependently?

8d5387.png (376×1 px, 79 KB)

It is longer, but less words?

This revision is now accepted and ready to land.Oct 19 2023, 11:29 AM

canBeRenderedOnItsOwn --> canBeRenderedIndependently