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)
Sat, Oct 19, 4:49 AM
Unknown Object (File)
Sat, Oct 19, 4:49 AM
Unknown Object (File)
Sat, Oct 19, 4:49 AM
Unknown Object (File)
Sat, Oct 19, 4:48 AM
Unknown Object (File)
Oct 6 2024, 3:51 PM
Unknown Object (File)
Sep 19 2024, 7:43 PM
Unknown Object (File)
Sep 19 2024, 5:01 PM
Unknown Object (File)
Sep 15 2024, 1:26 PM
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
No Lint Coverage
Unit
No Test Coverage

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