-
Notifications
You must be signed in to change notification settings - Fork 226
[Feature] Room list invites #2714
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
Conversation
📱 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 #2714 +/- ##
===========================================
- Coverage 73.13% 72.92% -0.21%
===========================================
Files 1478 1467 -11
Lines 35709 35529 -180
Branches 6862 6851 -11
===========================================
- Hits 26114 25911 -203
- Misses 6043 6077 +34
+ Partials 3552 3541 -11 ☔ 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.
Awesome work, thanks!
Testing OK on my side, only minor remarks that are not blocking.
onRoomSettingsClicked = this::onRoomSettingsClicked, | ||
onMenuActionClicked = { onMenuActionClicked(activity, it) }, | ||
onRoomDirectorySearchClicked = this::onRoomDirectorySearchClicked, | ||
modifier = modifier, | ||
) | ||
) { | ||
acceptDeclineInviteView.Render( |
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.
For clarity, maybe acceptDeclineInviteView
should be renamed to acceptDeclineInviteDialogs
? (can be done later)
@@ -71,6 +74,7 @@ import kotlinx.coroutines.flow.map | |||
import kotlinx.coroutines.flow.onEach | |||
import kotlinx.coroutines.flow.takeWhile | |||
import kotlinx.coroutines.launch | |||
import org.jetbrains.annotations.VisibleForTesting |
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.
We also use androidx.annotation.VisibleForTesting
, not sure what's best
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've changed so we have only one
@@ -214,7 +225,7 @@ class RoomListPresenter @Inject constructor( | |||
val initialState = RoomListState.ContextMenu.Shown( | |||
roomId = event.roomListRoomSummary.roomId, | |||
roomName = event.roomListRoomSummary.name, | |||
isDm = event.roomListRoomSummary.isDm, | |||
isDm = event.roomListRoomSummary.isDirect, |
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.
moar confusion here... We should revisit isDm
and isDirect
terminology and ensure of consistency across the project....
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 I know this is messed up... I should probably have both values so it's not changing what we have.
modifier: Modifier = Modifier | ||
) { | ||
Box( | ||
EmptyScaffold( |
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.
Thanks for having removed the useless Box!
Favourites -> null | ||
Rooms -> setOf(People, Invites) | ||
People -> setOf(Rooms, Invites) | ||
Unread -> setOf(Invites) |
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.
Not sure, but we may want to have "unread" invites. Also the green dot on invite item in room list should be hidden when the invite has been visited.
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.
This has been discussed, and for now invites should be shown only when no filter is selected or only the "invite" filter. Also the green dot should stay, at least from what I've been told.
import io.element.android.libraries.matrix.api.core.UserId | ||
|
||
@Immutable | ||
data class InviteSender( |
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.
Will do later
@Composable | ||
fun annotatedString(): AnnotatedString { | ||
return stringResource(R.string.screen_invites_invited_you, displayName, userId.value).let { text -> | ||
val senderNameStart = LocalContext.current.getString(R.string.screen_invites_invited_you).indexOf("%1\$s") |
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.
Searching for %1$s
seems a bit risky regarding translated strings, but let's see.
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.
The code was already like that, I didn't touch it...
aRoomListRoomSummary( | ||
name = "Bob", | ||
displayType = RoomSummaryDisplayType.INVITE, | ||
inviteSender = InviteSender( |
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 extract a fun anInviteSender()
?
@@ -57,6 +57,11 @@ sealed interface RoomListFilter { | |||
*/ | |||
data object Favorite : RoomListFilter | |||
|
|||
/** | |||
* A filter that matches rooms that with Invited membership. |
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.
* A filter that matches rooms that with Invited membership. | |
* A filter that matches rooms with Invited membership. |
|
Type of change
Content
Show invites as part of the room list :
Motivation and context
Closes #2707