Details
Test if tooltip:
- contains chat names
- doesn't contain chat in which we currently are
- changes its content depending on text prefix
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/utils/typeahead-utils.js | ||
---|---|---|
9 | This regex has one drawback: when we type '@' in chat input bar, getMentionTypeahead(User/Chat)Suggestions will always execute. But there is no way to avoid this -> previously when we me mentioned users only we could stop SearchIndex lookup when user types space after mention -> right now when threads can have spaces it's impossible. validChatNameRegexString has a limitation to 191 chars, so when user types a very long message after mention, eventually it will stop executing mention utilities. |
const suggestions = [ ...suggestedUsers.map(user => ({ type: 'user', user })), ...suggestedChats.map(chat => ({ type: 'chat', chat })), ];
This map can be omitted by changing return type of getMentionTypeahead(User/Chat)Suggestions function.
lib/shared/mention-utils.js | ||
---|---|---|
115 ↗ | (On Diff #30293) | Can you make a Set out of this to make the search in line 118 constant instead of linear? |
native/utils/typeahead-utils.js | ||
---|---|---|
19 ↗ | (On Diff #30686) | Same question: isn't oldValidUsernameRegexString a subset of validChatNameRegexString? |
lib/shared/mention-utils.js | ||
---|---|---|
133 ↗ | (On Diff #30686) | Results are not sorted, but we might want to sort them like we do for user candidates. |
native/chat/chat-input-bar.react.js | ||
578 ↗ | (On Diff #30686) | Last sentence of this comment states that we need to show user mentions before chat mentions. But what we could do is to sort suggestions array and place user mentions before chat mentions (if mention text is the same). |
native/utils/typeahead-utils.js | ||
19 ↗ | (On Diff #30686) | Yes it is, will remove it |
lib/shared/mention-utils.js | ||
---|---|---|
115 ↗ | (On Diff #31254) | Maybe chatNamePrefix? |