Skip to content

[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

Merged
merged 12 commits into from
Apr 17, 2024
Merged

[Feature] Room list invites #2714

merged 12 commits into from
Apr 17, 2024

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Apr 16, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Show invites as part of the room list :

  • Remove the separate invites list
  • Move the invites into the room list
  • Add an invites filter
  • Tapping an invite row outside "Decline" and "Accept" buttons open the room flow.
  • Tapping an invite notification open the room flow too.

Motivation and context

Closes #2707

@ganfra ganfra added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Apr 16, 2024
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Apr 16, 2024
Copy link
Contributor

github-actions bot commented Apr 16, 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/t1DhWf

@ganfra ganfra changed the title Feature/fga/room list invites [Feature] Room list invites Apr 16, 2024
@ganfra ganfra marked this pull request as ready for review April 16, 2024 14:45
@ganfra ganfra requested a review from a team as a code owner April 16, 2024 14:45
@ganfra ganfra requested review from bmarty and removed request for a team April 16, 2024 14:45
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

Attention: Patch coverage is 82.79570% with 48 lines in your changes are missing coverage. Please review.

Project coverage is 72.92%. Comparing base (166063f) to head (90e273c).
Report is 33 commits behind head on develop.

Files Patch % Lines
...eatures/roomlist/impl/components/RoomSummaryRow.kt 83.45% 2 Missing and 21 partials ⚠️
...list/impl/datasource/RoomListRoomSummaryFactory.kt 30.00% 13 Missing and 1 partial ⚠️
...d/features/roomlist/impl/filters/RoomListFilter.kt 42.85% 4 Missing ⚠️
...es/roomlist/impl/components/RoomListContentView.kt 70.00% 1 Missing and 2 partials ⚠️
...droid/features/roomlist/impl/model/InviteSender.kt 87.50% 1 Missing and 1 partial ⚠️
...ndroid/features/roomlist/impl/RoomListPresenter.kt 92.85% 0 Missing and 1 partial ⚠️
...id/libraries/matrix/api/roomlist/RoomListFilter.kt 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

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.

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(
Copy link
Member

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
Copy link
Member

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

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'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,
Copy link
Member

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....

Copy link
Member Author

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(
Copy link
Member

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)
Copy link
Member

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.

Copy link
Member Author

@ganfra ganfra Apr 17, 2024

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(
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use InviteSender to the invite screen, instead of the RoomId?

image image

Copy link
Member Author

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")
Copy link
Member

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.

Copy link
Member Author

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(
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* A filter that matches rooms that with Invited membership.
* A filter that matches rooms with Invited membership.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ganfra ganfra added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Apr 17, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Apr 17, 2024
@ganfra ganfra enabled auto-merge April 17, 2024 20:30
@ganfra ganfra merged commit 0cda5b9 into develop Apr 17, 2024
18 of 19 checks passed
@ganfra ganfra deleted the feature/fga/room_list_invites branch April 17, 2024 21:04
@ganfra ganfra mentioned this pull request Apr 18, 2024
9 tasks
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.

[Task] Show invites as part of the room list
2 participants