[lib] Introduce chat mention candidates getters
Summary:
Solution for ENG-4551.
This diff introduces a custom data structure for chat mentions. We require this type of data structure to efficiently retrieve potential chat mention candidates.
Test Plan:
Use useChatMentionCandidatesObj in web/chat/chat.react.js and check if data structure is valid:
- Object keys should contain all ids available in redux store
- Each object value should be another object with threadID as keys and ResolvedThreadInfo as value.
- This inner object should contain threadIDs within the community without key (= threadID)
- Check GENESIS chats if they contain only chats that are inside the top level that is below GENESIS.
Example:
Thread store:
- GENESIS
- chat1
- chat1.1
- chat2
- chat1
- Test community
- chat3
- chat5
- chat4
- chat3
Valid object:
{chat1: {chat1.1}, {chat2: {}}, Test community: {chat3, chat5, chat4}, chat3: {Test community, chat4, chat5}, ...}
Reviewers: tomek, inka
Reviewed By: inka
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D8833