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

Knocking : update create room flow #3804

Merged
merged 16 commits into from
Nov 6, 2024
Merged

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Nov 4, 2024

Content

This PR updates the create room flow with the following changes :

  • Allow setting public room join rule to either "anyone" or "ask to join"
  • Allow setting a room alias (no validation nor auto-fill for now)

There is a new feature flag to enable to see the updated flow.

Motivation and context

Handles some parts of #3689

Screenshots / GIFs

Tests

  • Enable Knock feature flag
  • Go to the room list and click on the start chat button
  • Click on "new room"
  • Select people or not
  • Play with settings

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

Copy link
Contributor

github-actions bot commented Nov 4, 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/hWfEnu

@ganfra ganfra added PR-Wip For anything that isn't ready to ship and will be enabled at a later date Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. labels Nov 5, 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 Nov 5, 2024
@ganfra ganfra marked this pull request as ready for review November 5, 2024 20:17
@ganfra ganfra requested a review from a team as a code owner November 5, 2024 20:17
@ganfra ganfra requested review from jmartinesp and removed request for a team November 5, 2024 20:17
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, just a few suggestions.

@@ -31,28 +37,87 @@ class CreateRoomDataStore @Inject constructor(
field = value
}

fun getCreateRoomConfig(): Flow<CreateRoomConfig> = combine(
val createRoomConfig: Flow<CreateRoomConfig> = combine(
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 createRoomConfigWithInvites?

Comment on lines 52 to 58
Box(
modifier = modifier
.size(30.dp)
.clip(RoundedCornerShape(8.dp))
.background(ElementTheme.colors.bgSubtleSecondary)
.padding(3.dp),
contentAlignment = Alignment.Center,
Copy link
Member

Choose a reason for hiding this comment

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

I think we have RoundedIconAtom for this.

Comment on lines 366 to 367
@PreviewsDayNight
@PreviewWithLargeHeight
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if we can combine preview annotations like this 🫤 . In fact, I don't see a 'long' screenshot being recorded. We'd have to manually add @Preview(height = ...) and @Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, height = ...) to it instead if I'm not mistaken.

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've removed it in the last commits. I'll fix it in another PR with the final design

Comment on lines 10 to 13
sealed interface RoomAddress {
data class AutoFilled(val address: String) : RoomAddress
data class Edited(val address: String) : RoomAddress
}
Copy link
Member

Choose a reason for hiding this comment

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

👌

Comment on lines 38 to 44
modifier
.fillMaxWidth()
.selectable(
selected = isSelected,
onClick = { onOptionClick(roomAccessItem) },
role = Role.RadioButton,
)
Copy link
Member

Choose a reason for hiding this comment

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

One day we have to debug why your formatter does this 😓 .

Copy link
Member

Choose a reason for hiding this comment

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

I agree it's polluting our PRs.

@jmartinesp jmartinesp added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 6, 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 Nov 6, 2024
fun RoomPrivacyOption(
roomPrivacyItem: RoomPrivacyItem,
onOptionClick: (RoomPrivacyItem) -> Unit,
fun RoomVisibilityOption(
Copy link
Member

Choose a reason for hiding this comment

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

Now that I think about it, maybe this should use a ListItem inside instead?

Comment on lines 30 to 37
@Composable
fun RoomAccessOption(
roomAccessItem: RoomAccessItem,
onOptionClick: (RoomAccessItem) -> Unit,
modifier: Modifier = Modifier,
isSelected: Boolean = false,
) {
Row(
Copy link
Member

Choose a reason for hiding this comment

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

This should probably use a ListItem too.

@ganfra ganfra added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Nov 6, 2024
@ganfra ganfra enabled auto-merge November 6, 2024 13:58
@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 Nov 6, 2024
Copy link

sonarcloud bot commented Nov 6, 2024

@ganfra ganfra added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Nov 6, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Nov 6, 2024
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 77.91165% with 55 lines in your changes missing coverage. Please review.

Project coverage is 82.86%. Comparing base (98bf685) to head (2ab6289).
Report is 23 commits behind head on develop.

Files with missing lines Patch % Lines
...id/features/createroom/impl/CreateRoomDataStore.kt 45.45% 16 Missing and 2 partials ⚠️
...eroom/impl/configureroom/ConfigureRoomPresenter.kt 63.15% 11 Missing and 3 partials ⚠️
...createroom/impl/configureroom/ConfigureRoomView.kt 88.37% 7 Missing and 3 partials ⚠️
...eateroom/impl/configureroom/RoomVisibilityState.kt 63.63% 3 Missing and 1 partial ⚠️
...atures/createroom/impl/configureroom/RoomAccess.kt 40.00% 3 Missing ⚠️
...eateroom/impl/configureroom/ConfigureRoomEvents.kt 60.00% 2 Missing ⚠️
...teroom/impl/configureroom/RoomAddressErrorState.kt 33.33% 2 Missing ⚠️
...tures/createroom/impl/configureroom/RoomAddress.kt 66.66% 1 Missing ⚠️
...ibraries/matrix/api/createroom/JoinRuleOverride.kt 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3804      +/-   ##
===========================================
- Coverage    82.91%   82.86%   -0.05%     
===========================================
  Files         1772     1776       +4     
  Lines        44534    44673     +139     
  Branches      5227     5242      +15     
===========================================
+ Hits         36924    37019      +95     
- Misses        5780     5821      +41     
- Partials      1830     1833       +3     

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

@ganfra ganfra merged commit a678fe4 into develop Nov 6, 2024
28 of 30 checks passed
@ganfra ganfra deleted the feature/fga/update_create_room_flow branch November 6, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Wip For anything that isn't ready to ship and will be enabled at a later date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants