Page MenuHomePhabricator

[lib] Update useCanCreateSidebarFromMessage to prevent sidebar creation for unsupported message types
ClosedPublic

Authored by rohan on Sep 19 2023, 10:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 15, 1:26 PM
Unknown Object (File)
Sun, Sep 15, 1:26 PM
Unknown Object (File)
Sun, Sep 15, 1:25 PM
Unknown Object (File)
Sun, Sep 15, 1:24 PM
Unknown Object (File)
Tue, Aug 27, 1:22 AM
Unknown Object (File)
Mon, Aug 26, 4:33 PM
Unknown Object (File)
Sun, Aug 25, 9:17 PM
Unknown Object (File)
Wed, Aug 21, 10:18 AM
Subscribers

Details

Summary

This diff hard codes the unsupported message types for creating sidebars from. The if check is pretty much identical to the conditions in thread-creator right now. This is just to have a quick working solution. The next diff will work on extracting both this and the original check into one single source of truth for what message types should be prevented from having sidebars created from them.

Part of ENG-4849

Test Plan

Confirmed that client-sided, there is no option to create a sidebar from these message types now (specifically toggle pin messages and change role messages)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Should we use isMessageSidebarSourceReactionEditOrPin for this instead, and extend it to include messageTypes.CHANGE_ROLE? We'll want to eventually unify all of these checks in one place (see here). That will probably be in the message specs, but that doesn't mean we'll delete isMessageSidebarSourceReactionEditOrPin – it can be a helper function that checks the message specs

This revision is now accepted and ready to land.Sep 20 2023, 5:57 AM