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

Pinned messages list : hide reactions #3430

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Sep 9, 2024

Content

Allow disabling computation of reaction and read receipts from the timelineItemFactory.

Motivation and context

Reactions should be hidden in the pinned messages list.

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@ganfra ganfra marked this pull request as ready for review September 9, 2024 12:53
@ganfra ganfra requested a review from a team as a code owner September 9, 2024 12:53
@ganfra ganfra requested review from jmartinesp and removed request for a team September 9, 2024 12:53
@ganfra ganfra added the PR-Change For updates to an existing feature label Sep 9, 2024
Copy link
Contributor

github-actions bot commented Sep 9, 2024

📱 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: https://i.diawi.com/9pFVot

Copy link

codecov bot commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.61%. Comparing base (ba7baea) to head (631a57e).
Report is 10 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3430   +/-   ##
========================================
  Coverage    82.61%   82.61%           
========================================
  Files         1699     1700    +1     
  Lines        39989    40003   +14     
  Branches      4866     4868    +2     
========================================
+ Hits         33036    33050   +14     
  Misses        5233     5233           
  Partials      1720     1720           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

private val dispatchers: CoroutineDispatchers,
private val eventItemFactory: TimelineItemEventFactory,
private val virtualItemFactory: TimelineItemVirtualFactory,
private val timelineItemGrouper: TimelineItemGrouper,
private val timelineItemIndexer: TimelineItemIndexer,
) {
@AssistedFactory
interface Creator {
fun create(context: TimelineItemsFactoryContext): TimelineItemsFactory
Copy link
Member

Choose a reason for hiding this comment

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

We now have creator of factories :)

* @param computeReadReceipts when false, read receipts will be empty.
* @param computeReactions when false, reactions will be empty.
*/
data class TimelineItemsFactoryContext(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe rename to TimelineItemsFactoryParams? Context is sort of a reserved word in Android dev...

Copy link
Member Author

Choose a reason for hiding this comment

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

I find Params a bit weird here, do you have other ideas? I wasn't sure how to name it..

Copy link
Member

Choose a reason for hiding this comment

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

I can only think of either Params or Config.

Copy link
Member

@bmarty bmarty Sep 9, 2024

Choose a reason for hiding this comment

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

Do we need to have a wrapper data class?
Can't we just put the 2 members computeReadReceipts: Boolean and computeReactions: Boolean as parameters of the factory?

Also when trying to implement this ^, I found the line lateinit var context: TimelineItemsFactoryContext a bit not nice... We should pass the parameter to the TimelineItemEventFactory.create method

Copy link
Member

Choose a reason for hiding this comment

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

It's done on init, so it's not that bad, although it's true a refactor could easily break it. The alternative might be creating a TimelineItemsFactoryContextBuilder and I think none of us want to reach that level of design pattern overload 😅 .

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like creating several bools for config, it should be in one wrapper IMO.
So either I pass the wrapper to the create function, but it's a bit stupid because it won't change overtime, either I also use an AssistedFactory 😅

Copy link
Member

Choose a reason for hiding this comment

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

Yes, to be clean we will need an assisted factory.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

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.

LGTM, but I agree with @bmarty in some renaming for the Context class.

@@ -55,7 +56,7 @@ import kotlin.time.Duration.Companion.milliseconds
class PinnedMessagesListPresenter @AssistedInject constructor(
@Assisted private val navigator: PinnedMessagesListNavigator,
private val room: MatrixRoom,
private val timelineItemsFactory: TimelineItemsFactory,
timelineItemsFactoryCreator: TimelineItemsFactory.Creator,
Copy link
Member

Choose a reason for hiding this comment

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

TimelineItemsFactory.Factory was a bit redundant, I guess 😅 .

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, same, wasn't sure of the name 😅

@ganfra ganfra force-pushed the feature/fga/pinned_messages_list_remove_reaction branch from cab8860 to 73bbd1e Compare September 9, 2024 17:29
@ganfra ganfra added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 10, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 10, 2024
Copy link

sonarcloud bot commented Sep 10, 2024

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!

@ganfra ganfra merged commit b4afc32 into develop Sep 10, 2024
28 of 30 checks passed
@ganfra ganfra deleted the feature/fga/pinned_messages_list_remove_reaction branch September 10, 2024 13:48
@ganfra
Copy link
Member Author

ganfra commented Sep 10, 2024

Maestro is still failing at different places, including ANR and issue with the creation flow. I merged as it's not related to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Change For updates to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants