Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3397355
D8628.id29032.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8628.id29032.diff
View Options
diff --git a/lib/shared/inline-engagement-utils.js b/lib/shared/inline-engagement-utils.js
--- a/lib/shared/inline-engagement-utils.js
+++ b/lib/shared/inline-engagement-utils.js
@@ -1,5 +1,6 @@
// @flow
+import type { ReactionInfo } from '../selectors/chat-selectors.js';
import type { ThreadInfo } from '../types/thread-types.js';
function getInlineEngagementSidebarText(threadInfo: ?ThreadInfo): string {
@@ -10,4 +11,15 @@
return `${repliesCount} ${repliesCount > 1 ? 'replies' : 'reply'}`;
}
-export { getInlineEngagementSidebarText };
+function reactionsToRawString(reactions: ReactionInfo): string {
+ const reactionStringParts = [];
+
+ for (const reaction in reactions) {
+ const reactionInfo = reactions[reaction];
+ reactionStringParts.push(`${reaction}${reactionInfo.users.length}`);
+ }
+
+ return reactionStringParts.join('');
+}
+
+export { getInlineEngagementSidebarText, reactionsToRawString };
diff --git a/native/chat/chat-item-height-measurer.react.js b/native/chat/chat-item-height-measurer.react.js
--- a/native/chat/chat-item-height-measurer.react.js
+++ b/native/chat/chat-item-height-measurer.react.js
@@ -3,6 +3,10 @@
import invariant from 'invariant';
import * as React from 'react';
+import {
+ getInlineEngagementSidebarText,
+ reactionsToRawString,
+} from 'lib/shared/inline-engagement-utils.js';
import { messageID } from 'lib/shared/message-utils.js';
import {
messageTypes,
@@ -29,13 +33,16 @@
if (item.itemType !== 'message') {
return null;
}
- const { messageInfo } = item;
+ const { messageInfo, threadCreatedFromMessage, reactions } = item;
+
if (messageInfo.type === messageTypes.TEXT) {
return JSON.stringify({ text: messageInfo.text });
} else if (item.robotext) {
const { threadID } = item.messageInfo;
return JSON.stringify({
robotext: entityTextToRawString(item.robotext, { threadID }),
+ sidebar: getInlineEngagementSidebarText(threadCreatedFromMessage),
+ reactions: reactionsToRawString(reactions),
});
}
return null;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 5:19 PM (20 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608331
Default Alt Text
D8628.id29032.diff (2 KB)
Attached To
Mode
D8628: [lib/native] update heightMeasurerKey function to consider inline engagement for robotext messages
Attached
Detach File
Event Timeline
Log In to Comment