Skip to content
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

Add 'more reactions' button to message #756

Merged
merged 8 commits into from
Jul 5, 2023
Merged

Conversation

jonnyandrew
Copy link
Contributor

@jonnyandrew jonnyandrew commented Jul 3, 2023

Changes

  • Add 'more reactions' button to message
  • Fix display of existing emoji reactions to match designs
  • Refactor emoji reactions to reduce nesting of composables

Context

Part of

Screenshots

Before After
before-1 after-1
before-2 after-2

This was referenced Jul 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link:

@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 63.76% and project coverage change: -0.01 ⚠️

Comparison is base (9b887c0) 56.81% compared to head (5dc86d1) 56.80%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #756      +/-   ##
===========================================
- Coverage    56.81%   56.80%   -0.01%     
===========================================
  Files          912      913       +1     
  Lines        23071    23116      +45     
  Branches      4674     4681       +7     
===========================================
+ Hits         13108    13132      +24     
- Misses        7886     7903      +17     
- Partials      2077     2081       +4     
Impacted Files Coverage Δ
...s/impl/timeline/components/TimelineItemEventRow.kt 61.87% <0.00%> (-1.42%) ⬇️
...l/timeline/components/TimelineItemReactionsView.kt 40.90% <20.00%> (-3.54%) ⬇️
...id/features/messages/impl/timeline/TimelineView.kt 50.31% <25.00%> (-0.66%) ⬇️
...ent/android/features/messages/impl/MessagesView.kt 58.52% <66.66%> (+0.14%) ⬆️
...timeline/components/MessagesMoreReactionsButton.kt 66.66% <66.66%> (ø)
...impl/timeline/components/MessagesReactionButton.kt 76.92% <96.55%> (+6.92%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jonnyandrew jonnyandrew marked this pull request as ready for review July 4, 2023 09:44
@jonnyandrew jonnyandrew requested a review from a team as a code owner July 4, 2023 09:44
@jonnyandrew jonnyandrew requested review from julioromano and bmarty and removed request for a team July 4, 2023 09:44
@julioromano julioromano removed their request for review July 4, 2023 12:35
Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment, otherwise LGTM.

@@ -103,6 +104,9 @@ fun TimelineItemEventRow(
fun onReactionClicked(emoji: String) =
onReactionClick(emoji, event)

fun onMoreReactionsClicked() =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function might pass an outdated version of event to onMoreReactionsClick, but I guess it's not really and issue since we're just using the event id. Still, using a lambda here would make this less error-prone (see #771 (comment)).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I actually ran into this exact issue just now while working on something else.

I think the local function captures the outer function parameter the first time it's called but doesn't get updated on recomposition.

Maybe we should ensure local functions do not reference arguments to the parent composable to avoid subtle bugs like this?

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update on the colors!

@sonarcloud
Copy link

sonarcloud bot commented Jul 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@jonnyandrew jonnyandrew merged commit 96ef91b into develop Jul 5, 2023
@jonnyandrew jonnyandrew deleted the jonny/reaction-buttons branch July 5, 2023 15:38
ganfra pushed a commit that referenced this pull request Jul 7, 2023
- Add 'more reactions' button to message
- Fix display of existing emoji reactions to match designs
- Refactor emoji reactions to reduce nesting of composables


---------

Co-authored-by: ElementBot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants