-
Notifications
You must be signed in to change notification settings - Fork 186
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
Room / User suggestions #2674
Room / User suggestions #2674
Conversation
// by CreateRoomActionButtonsList | ||
state = state.userListState.copy( | ||
recentDirectRooms = persistentListOf(), | ||
), |
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 do not really like to touch the state in the View, but adding another boolean like renderSuggestions
to UserListView
was more intrusive... Let me know what you reviewer(s) think, there are maybe other more elegant option.
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.
Using a boolean parameter seems more correct, to be honest. Or maybe we could make it part of the UserListPresenterArgs
, so it won't return any recentDirectRooms
if it's false?
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 also though about the option to enhance UserListPresenterArgs
, but it does not work, the presenter is the same for both cases: suggestion for rooms and suggestion for users.
I will keep the current code, we may revisit later.
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 it the same presenter? I see one being instantiated in CreateRoomRootPresenter
and another one in AddPeoplePresenter
.
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.
Yes, you're right.
Here the suggestions have to be in the state (so the presenter has to provide them, that's why I wanted to say by "the presenter is the same"), but are rendered in CreateRoomActionButtonsList
and not in UserListView
, from the same method (CreateRoomRootView
).
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2674 +/- ##
===========================================
+ Coverage 73.55% 73.56% +0.01%
===========================================
Files 1457 1458 +1
Lines 35221 35209 -12
Branches 6757 6761 +4
===========================================
- Hits 25907 25903 -4
+ Misses 5790 5787 -3
+ Partials 3524 3519 -5 ☔ View full report in Codecov by Sentry. |
|
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 have a couple of suggestions, otherwise LGTM!
@@ -74,6 +84,43 @@ fun UserListView( | |||
}, | |||
) | |||
} | |||
if (!state.isSearchActive && state.recentDirectRooms.isNotEmpty()) { |
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.
Maybe this could be moved to its own component?
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 though about it, and I originally did it like this, but the list items are not the same, so it's complicating thing with small added value.
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.
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.
Ah OK, extracting a function, sorry I misunderstood :)
// by CreateRoomActionButtonsList | ||
state = state.userListState.copy( | ||
recentDirectRooms = persistentListOf(), | ||
), |
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.
Using a boolean parameter seems more correct, to be honest. Or maybe we could make it part of the UserListPresenterArgs
, so it won't return any recentDirectRooms
if it's false?
Type of change
Content
Add DM suggestions to open an existing DM when user want to start a chat (Closes #2634), and add user suggestions to invite people when creating a room (Closes #2633)
Motivation and context
Closes #2633
Closes #2634
Screenshots / GIFs
See recorded once
Tests
Tested devices
Checklist