-
Notifications
You must be signed in to change notification settings - Fork 987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[15660] Show who sent message reaction #15677
Conversation
Jenkins BuildsClick to see older builds (270)
|
Apologies for asking for reviews now, I found a bug and working on it |
(defn reaction-authors | ||
[reaction-authors show-reaction-author-list?] | ||
(let [selected-tab (reagent/atom (first (keys reaction-authors)))] | ||
[:f> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth pointing out we've had recent discussions about the proper way to use functional components, and this pattern we've been using in the codebase is dangerous, in the sense that it can lead to unexpected side-effects and cause performance degradation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Remembered something like this when writing this. But didn't find a reference to the document.
Thanks for sharing!
:on-change #(reset! selected-tab %) | ||
:default-active @selected-tab | ||
:data (mapv (fn [[reaction-type author-details]] | ||
^{:key (str reaction-type)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the reaction-type
really unique among other reaction-authors
? If the keys clash the rendering performance will take a hit. Wouldn't it be better to combine the reaction-type
with something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the same at first, But this renders the tabs that render at the top of the view.
Which I think they're unique because they are constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so each tab is a different reaction type, so it should be fine. Good point
^{:key (str reaction-type)} | ||
{:id reaction-type | ||
:style style/tabs | ||
:label [rn/view {:style style/tab} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now looking in retrospective, I was thinking that since quo/tabs
uses a FlatList
, we shouldn't be building hiccup in the data
prop. There should ideally be a render-fn
prop exposed by the tabs
component. In this way, it would also be possible to extract the renderer that here is built inline to a separate var. Anyway, ideas for performance improvements.
Edit: Outside PR's scope for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor in a follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's certainly an interesting refactor, but given other priorities, it's totally up to you @ibrkhalil.
src/status_im2/contexts/chat/messages/content/reactions/view.cljs
Outdated
Show resolved
Hide resolved
47a8d20
to
add7b53
Compare
…b.com/status-im/status-mobile into see-author-on-long-press-of-emoji status-im/status-go@7586452...ee40032
[:show-bottom-sheet | ||
{:content (fn [] [drawers/reactions | ||
{:chat-id chat-id :message-id message-id}])}]))}]]))) | ||
[:<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant :<>
(count author-details)]]})) | ||
reactions-order)) | ||
|
||
(defn reaction-authors-comp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant function, it can be just in reaction-authors view
73% of end-end tests have passed
Failed tests (9)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMerged:
Class TestCommunityOneDeviceMerged:
Passed tests (24)Click to expandClass TestCommunityMultipleDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityOneDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestActivityMultipleDevicePR:
|
67% of end-end tests have passed
Failed tests (11)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMerged:
Class TestCommunityOneDeviceMerged:
Passed tests (22)Click to expandClass TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
Class TestActivityMultipleDevicePR:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMerged:
|
@ibrkhalil PR can be merged. Thank you! |
fixes #15660
Summary
This PR adds the ability to see who reacted to message by long-pressing on a reaction.
Testing notes
Kindly test this in communities and different types of chats.
Platforms
Areas that maybe impacted
Functional
Steps to test
Upload.from.GitHub.for.iOS.MOV
status: ready