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)
Wed, Nov 20, 4:38 PM
Unknown Object (File)
Wed, Nov 20, 4:38 PM
Unknown Object (File)
Wed, Nov 20, 4:38 PM
Unknown Object (File)
Wed, Nov 20, 4:37 PM
Unknown Object (File)
Wed, Nov 20, 4:18 PM
Unknown Object (File)
Tue, Nov 19, 10:17 PM
Unknown Object (File)
Tue, Nov 19, 7:25 PM
Unknown Object (File)
Fri, Nov 8, 3:17 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