From 8ca9689d833dd333317906382eb014b0e8ecbe11 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Tue, 17 Dec 2024 18:03:41 +0100 Subject: [PATCH 1/7] fix: new line can not be added to message composer (#3754) --- .../android/ui/home/messagecomposer/MessageComposerInput.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt index 42b69b8585..48c888ce4d 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposerInput.kt @@ -29,6 +29,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.foundation.text.input.TextFieldLineLimits import androidx.compose.foundation.text.input.TextFieldState import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon @@ -312,7 +313,8 @@ private fun MessageComposerTextInput( }, interactionSource = interactionSource, onSelectedLineIndexChanged = onSelectedLineIndexChanged, - onLineBottomYCoordinateChanged = onLineBottomYCoordinateChanged + onLineBottomYCoordinateChanged = onLineBottomYCoordinateChanged, + lineLimits = TextFieldLineLimits.MultiLine() ) } From 8792a6c5cdcdbe30f554c61483d7d3c7e326c0a9 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Wed, 18 Dec 2024 10:02:21 +0100 Subject: [PATCH 2/7] chore: disable conversation list pagination --- default.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/default.json b/default.json index 8285bccc08..9bc1a266b5 100644 --- a/default.json +++ b/default.json @@ -6,7 +6,6 @@ "logging_enabled": false, "application_is_private_build": false, "development_api_enabled": false, - "paginated_conversation_list_enabled": true, "encrypt_proteus_storage": true, "analytics_enabled": false, "analytics_app_key": "4483f7a58ae3e70b3780319c4ccb5c88a037be49", @@ -81,7 +80,6 @@ "picture_in_picture_enabled": true, "analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438", "analytics_server_url": "https://countly.wire.com/", - "paginated_conversation_list_enabled": true }, "fdroid": { "application_id": "com.wire", From df5ef14597cd399c504525bbe6dd6216551afbcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BBerko?= Date: Fri, 20 Dec 2024 09:27:50 +0100 Subject: [PATCH 3/7] fix: tertiary selected button color [WPB-15120] (#3757) --- .../com/wire/android/ui/home/HomeTopBar.kt | 33 +++++++++--- .../ui/common/button/WireTertiaryButton.kt | 27 +++++----- .../common/button/WireTertiaryIconButton.kt | 51 ++++++++++++++++--- .../wire/android/ui/theme/WireColorScheme.kt | 4 +- 4 files changed, 87 insertions(+), 28 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/HomeTopBar.kt b/app/src/main/kotlin/com/wire/android/ui/home/HomeTopBar.kt index 9f34130884..d3fd259605 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/HomeTopBar.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/HomeTopBar.kt @@ -70,11 +70,11 @@ fun HomeTopBar( } if (navigationItem.withUserAvatar) { val openLabel = stringResource(R.string.content_description_open_label) - val contentDescription = if (shouldShowCreateTeamUnreadIndicator) { - stringResource(R.string.content_description_home_profile_btn_with_notification) - } else { - stringResource(R.string.content_description_home_profile_btn) - } + val contentDescription = if (shouldShowCreateTeamUnreadIndicator) { + stringResource(R.string.content_description_home_profile_btn_with_notification) + } else { + stringResource(R.string.content_description_home_profile_btn) + } UserProfileAvatar( avatarData = userAvatarData, clickable = remember { @@ -87,7 +87,7 @@ fun HomeTopBar( legalHoldIndicatorVisible = withLegalHoldIndicator ), shouldShowCreateTeamUnreadIndicator = shouldShowCreateTeamUnreadIndicator, - contentDescription = contentDescription + contentDescription = contentDescription ) } }, @@ -112,6 +112,27 @@ fun PreviewTopBar() { } } +@PreviewMultipleThemes +@Composable +fun PreviewTopBarWithSelectedFilter() { + WireTheme { + HomeTopBar( + navigationItem = HomeDestination.Group, + userAvatarData = UserAvatarData( + asset = null, + availabilityStatus = UserAvailabilityStatus.AVAILABLE, + nameBasedAvatar = NameBasedAvatar("Jon Doe", -1) + ), + elevation = 0.dp, + withLegalHoldIndicator = false, + shouldShowCreateTeamUnreadIndicator = false, + onHamburgerMenuClick = {}, + onNavigateToSelfUserProfile = {}, + onOpenConversationFilter = {} + ) + } +} + @PreviewMultipleThemes @Composable fun PreviewSettingsTopBarWithoutAvatar() { diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryButton.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryButton.kt index 80696e05ec..78e8ac5afa 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryButton.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryButton.kt @@ -32,14 +32,15 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Shape import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp import com.wire.android.model.ClickBlockParams import com.wire.android.ui.common.Icon +import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireDimensions import com.wire.android.ui.theme.wireTypography +import com.wire.android.util.PreviewMultipleThemes @Composable fun WireTertiaryButton( @@ -93,15 +94,15 @@ fun WireTertiaryButton( description = description ) -@Preview(name = "Default WireSecondaryButton") +@PreviewMultipleThemes @Composable -fun PreviewWireTertiaryButton() { +fun PreviewWireTertiaryButton() = WireTheme { WireTertiaryButton(onClick = { }, text = "text") } -@Preview(name = "Default narrow WireTertiaryButton with icon") +@PreviewMultipleThemes @Composable -fun PreviewWireTertiaryButtonNarrowWithIcons() { +fun PreviewWireTertiaryButtonNarrowWithIcons() = WireTheme { WireTertiaryButton( onClick = { }, text = "text", @@ -111,9 +112,9 @@ fun PreviewWireTertiaryButtonNarrowWithIcons() { ) } -@Preview(name = "Default narrow WireTertiaryButton only icon") +@PreviewMultipleThemes @Composable -fun PreviewWireTertiaryButtonNarrowOnlyIcons() { +fun PreviewWireTertiaryButtonNarrowOnlyIcons() = WireTheme { WireTertiaryButton( onClick = { }, leadingIcon = Icons.Filled.Search.Icon(), @@ -122,20 +123,20 @@ fun PreviewWireTertiaryButtonNarrowOnlyIcons() { ) } -@Preview(name = "Default narrow Disabled WireSecondaryButton") +@PreviewMultipleThemes @Composable -fun PreviewWireTertiaryButtonDisabled() { +fun PreviewWireTertiaryButtonDisabled() = WireTheme { WireTertiaryButton(onClick = { }, state = WireButtonState.Disabled, text = "text", fillMaxWidth = false) } -@Preview(name = "Selected narrow WireSecondaryButton") +@PreviewMultipleThemes @Composable -fun PreviewWireTertiaryButtonSelected() { +fun PreviewWireTertiaryButtonSelected() = WireTheme { WireTertiaryButton(onClick = { }, state = WireButtonState.Selected, text = "text", fillMaxWidth = false) } -@Preview(name = "Error narrow WireSecondaryButton") +@PreviewMultipleThemes @Composable -fun PreviewWireTertiaryButtonError() { +fun PreviewWireTertiaryButtonError() = WireTheme { WireTertiaryButton(onClick = { }, state = WireButtonState.Error, text = "text", fillMaxWidth = false) } diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryIconButton.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryIconButton.kt index 3f7b63ebbd..fdaa1bc917 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryIconButton.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryIconButton.kt @@ -31,13 +31,14 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Shape import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp import com.wire.android.model.ClickBlockParams import com.wire.android.ui.common.R import com.wire.android.ui.common.dimensions +import com.wire.android.ui.common.preview.MultipleThemePreviews +import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireDimensions @Composable @@ -78,21 +79,57 @@ fun WireTertiaryIconButton( ) } -@Preview +@MultipleThemePreviews @Composable -fun PreviewWireTertiaryIconButton() { +fun PreviewWireTertiaryIconButton() = WireTheme { WireTertiaryIconButton({}, loading = false, iconResource = R.drawable.ic_close, contentDescription = 0) } -@Preview +@MultipleThemePreviews @Composable -fun PreviewWireTertiaryIconButtonLoading() { +fun PreviewWireTertiaryIconButtonSelected() = WireTheme { + WireTertiaryIconButton( + {}, + loading = false, + iconResource = R.drawable.ic_close, + contentDescription = 0, + state = WireButtonState.Selected, + ) +} + +@MultipleThemePreviews +@Composable +fun PreviewWireTertiaryIconButtonError() = WireTheme { + WireTertiaryIconButton( + {}, + loading = false, + iconResource = R.drawable.ic_close, + contentDescription = 0, + state = WireButtonState.Error, + ) +} + +@MultipleThemePreviews +@Composable +fun PreviewWireTertiaryIconButtonDisabled() = WireTheme { + WireTertiaryIconButton( + {}, + loading = false, + iconResource = R.drawable.ic_close, + contentDescription = 0, + state = WireButtonState.Disabled, + ) +} + +@MultipleThemePreviews +@Composable +fun PreviewWireTertiaryIconButtonLoading() = WireTheme { WireTertiaryIconButton({}, loading = true, iconResource = R.drawable.ic_close, contentDescription = 0) } -@Preview +@MultipleThemePreviews @Composable -fun PreviewWireTertiaryIconButtonRound() { +fun PreviewWireTertiaryIconButtonRound() = WireTheme { WireTertiaryIconButton( {}, loading = false, diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt index e6599228ef..f7f84e9d86 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt @@ -227,8 +227,8 @@ private val DarkWireColorScheme = WireColorScheme( secondaryButtonRipple = Color.White, tertiaryButtonEnabled = Color.Transparent, onTertiaryButtonEnabled = Color.White, tertiaryButtonDisabled = Color.Transparent, onTertiaryButtonDisabled = WireColorPalette.Gray60, - tertiaryButtonSelected = WireColorPalette.DarkBlue50, onTertiaryButtonSelected = WireColorPalette.DarkBlue500, - tertiaryButtonSelectedOutline = WireColorPalette.DarkBlue300, + tertiaryButtonSelected = WireColorPalette.DarkBlue800, onTertiaryButtonSelected = WireColorPalette.DarkBlue500, + tertiaryButtonSelectedOutline = WireColorPalette.DarkBlue800, tertiaryButtonRipple = Color.White, // strokes and shadows From 4427e8923d66c09ff9c112f1adc6562e18768ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Saleniuk?= <30429749+saleniuk@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:49:14 +0100 Subject: [PATCH 4/7] fix: allowing empty team name when migrating [WPB-15092] (#3763) --- .../teammigration/TeamMigrationViewModel.kt | 2 +- .../step2/TeamMigrationTeamNameStepScreen.kt | 2 +- .../teammigration/TeamMigrationViewModelTest.kt | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt index bf2b90fde0..4919c58957 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModel.kt @@ -108,7 +108,7 @@ class TeamMigrationViewModel @Inject constructor( fun migrateFromPersonalToTeamAccount(onSuccess: () -> Unit) { viewModelScope.launch { migrateFromPersonalToTeam.invoke( - teamMigrationState.teamNameTextState.text.toString(), + teamMigrationState.teamNameTextState.text.trim().toString(), ).let { result -> when (result) { is MigrateFromPersonalToTeamResult.Success -> { diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step2/TeamMigrationTeamNameStepScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step2/TeamMigrationTeamNameStepScreen.kt index aa1e8a9ecf..da3d8ab450 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step2/TeamMigrationTeamNameStepScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step2/TeamMigrationTeamNameStepScreen.kt @@ -129,7 +129,7 @@ private fun TeamMigrationTeamNameStepScreenContent( textFieldState = teamNameTextFieldState, ) } - val isContinueButtonEnabled = teamNameTextFieldState.text.isNotEmpty() + val isContinueButtonEnabled = teamNameTextFieldState.text.isNotEmpty() && teamNameTextFieldState.text.isNotBlank() BottomLineButtons( isContinueButtonEnabled = isContinueButtonEnabled, onContinue = onContinueButtonClicked, diff --git a/app/src/test/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModelTest.kt index 8fb30394cc..e6e833a160 100644 --- a/app/src/test/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationViewModelTest.kt @@ -225,6 +225,22 @@ class TeamMigrationViewModelTest { Assertions.assertNull(viewModel.teamMigrationState.migrationFailure) } + @Test + fun `given team name with spaces at start or end, when invoking migration, then trim the name`() = runTest { + // given + val (arrangement, viewModel) = Arrangement() + .withMigrateFromPersonalToTeamSuccess() + .arrange() + val onSuccess = {} + viewModel.teamMigrationState.teamNameTextState.setTextAndPlaceCursorAtEnd(" ${Arrangement.TEAM_NAME} ") + // when + viewModel.migrateFromPersonalToTeamAccount(onSuccess) + // then + coVerify(exactly = 1) { + arrangement.migrateFromPersonalToTeam(Arrangement.TEAM_NAME) + } + } + private class Arrangement { @MockK From 6bd0ce44725138955083a56ba0afde05ffa22834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Saleniuk?= <30429749+saleniuk@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:49:56 +0100 Subject: [PATCH 5/7] fix: attachments menu blends with background [WPB-15102] (#3761) --- .../participantsview/ParticipantTile.kt | 2 +- .../messagecomposer/EnabledMessageComposer.kt | 77 +++++++++++++------ .../wire/android/ui/theme/WireColorScheme.kt | 2 +- 3 files changed, 57 insertions(+), 24 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt index 34dfecc6af..8fe6dadd09 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt @@ -390,7 +390,7 @@ private fun UsernameTile( modifier: Modifier = Modifier, ) { val color = - if (isSpeaking) colorsScheme().primary else darkColorsScheme().surfaceContainerLowest + if (isSpeaking) colorsScheme().primary else darkColorsScheme().inverseOnSurface val nameLabelColor = when { isSpeaking -> colorsScheme().onPrimary diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt index cf94cf8bfe..f1b64a76de 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt @@ -43,7 +43,7 @@ import androidx.compose.foundation.layout.isImeVisible import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.layout.wrapContentSize -import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.shape.GenericShape import androidx.compose.material3.Surface import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -55,12 +55,20 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.drawBehind +import androidx.compose.ui.geometry.CornerRadius import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.geometry.Rect +import androidx.compose.ui.geometry.RoundRect import androidx.compose.ui.geometry.Size +import androidx.compose.ui.geometry.toRect import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.RectangleShape +import androidx.compose.ui.graphics.Path +import androidx.compose.ui.graphics.drawscope.Fill +import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.unit.Density +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Popup @@ -326,11 +334,12 @@ fun EnabledMessageComposer( showAttachments(false) } ) { - val rippleColor = colorsScheme().surface - val shape = if (isImeVisible) { - RectangleShape - } else { - RoundedCornerShape(dimensions().corner14x) + val rippleColor = colorsScheme().surfaceContainerLowest + val borderColor = colorsScheme().divider + val borderWidthPx = if (isImeVisible) 0f else dimensions().spacing1x.toPx(density) + val cornerRadiusPx = if (isImeVisible) 0f else dimensions().corner14x.toPx(density) + val shape = GenericShape { size, _ -> + addPath(calculateOptionsPath(cornerRadiusPx, rippleProgress.value, isImeVisible, size)) } Box( @@ -351,21 +360,22 @@ fun EnabledMessageComposer( .clip(shape) .drawBehind { if (!hideRipple || rippleProgress.value > 0f) { - val maxRadius = size.getDistanceToCorner(Offset(0f, 0f)) - val currentRadius = maxRadius * rippleProgress.value - - drawCircle( - color = rippleColor, - radius = currentRadius, - center = Offset( - 0f, - if (isImeVisible) { - 0f - } else { - size.height - } + calculateOptionsPath(cornerRadiusPx, rippleProgress.value, isImeVisible, size).let { + drawPath( + path = it, + color = rippleColor, + style = Fill ) - ) + if (borderWidthPx > 0f) { + drawPath( + path = it, + color = borderColor, + style = Stroke( + width = borderWidthPx * 2f // double to make inner stroke, outer half is clipped anyway + ) + ) + } + } } } @@ -402,7 +412,30 @@ fun EnabledMessageComposer( } } -fun Size.getDistanceToCorner(corner: Offset): Float { +private fun Size.getDistanceToCorner(corner: Offset): Float { val cornerOffset = Offset(width - corner.x, height - corner.y) return cornerOffset.getDistance() } + +private fun calculateOptionsPath(cornerRadiusPx: Float, rippleProgress: Float, isImeVisible: Boolean, size: Size): Path { + val ripplePath = Path() + ripplePath.addOval( + oval = Rect( + center = Offset( + x = 0f, + y = if (isImeVisible) 0f else size.height + ), + radius = rippleProgress * size.getDistanceToCorner(Offset(0f, 0f)) + ) + ) + val shapePath = Path() + shapePath.addRoundRect( + roundRect = RoundRect( + rect = size.toRect(), + cornerRadius = CornerRadius(cornerRadiusPx, cornerRadiusPx) + ) + ) + return ripplePath.and(shapePath) +} + +private fun Dp.toPx(density: Density) = with(density) { toPx() } diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt index f7f84e9d86..e6f52f180e 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt @@ -207,7 +207,7 @@ private val DarkWireColorScheme = WireColorScheme( surfaceVariant = WireColorPalette.Gray90, onSurfaceVariant = Color.White, inverseSurface = Color.White, inverseOnSurface = Color.Black, surfaceBright = WireColorPalette.Gray70, surfaceDim = WireColorPalette.Gray95, - surfaceContainerLowest = Color.Black, + surfaceContainerLowest = WireColorPalette.Gray100, surfaceContainerLow = WireColorPalette.Gray95, surfaceContainer = WireColorPalette.Gray90, surfaceContainerHigh = WireColorPalette.Gray80, From 1d22fb47ca03447e71a71abfb8e38f742fc17a44 Mon Sep 17 00:00:00 2001 From: Yamil Medina Date: Fri, 27 Dec 2024 08:05:14 -0300 Subject: [PATCH 6/7] fix: adjustments for short signature names (WPB-15188) (#3768) --- .../ui/settings/devices/DeviceDetailsViewModel.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt index 1ca4096174..241cafd5fa 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt @@ -201,7 +201,7 @@ class DeviceDetailsViewModel @Inject constructor( canBeRemoved = !result.isCurrentClient && isSelfClient && result.client.type != ClientType.LegalHold, mlsCipherSuiteSignature = MLSPublicKeyType.from( result.client.mlsPublicKeys?.keys?.firstOrNull().orEmpty() - ).value.toString() + ).let { mapCipherSuiteSignatureToShortName(it) } ) } } @@ -209,6 +209,17 @@ class DeviceDetailsViewModel @Inject constructor( } } + private fun mapCipherSuiteSignatureToShortName(signature: MLSPublicKeyType): String { + return when (signature) { + MLSPublicKeyType.ECDSA_SECP256R1_SHA256 -> "P256" + MLSPublicKeyType.ECDSA_SECP384R1_SHA384 -> "P384" + MLSPublicKeyType.ECDSA_SECP521R1_SHA512 -> "P521" + MLSPublicKeyType.ED25519 -> "ED25519" + MLSPublicKeyType.ED448 -> "ED448" + is MLSPublicKeyType.Unknown -> "Unknown" + } + } + fun removeDevice(onSuccess: () -> Unit) { viewModelScope.launch { val isPasswordRequired: Boolean = when (val passwordRequiredResult = isPasswordRequired()) { From 10efa7e4f633f8295c961b875eafd628df34f783 Mon Sep 17 00:00:00 2001 From: Mohamad Jaara Date: Fri, 27 Dec 2024 15:39:26 +0100 Subject: [PATCH 7/7] fix: group protocol info is not shown when it is Proteus [WPB-15205] (#3769) --- .../details/options/GroupConversationOptions.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt index 88c043c35a..d9926db98b 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt @@ -186,12 +186,13 @@ fun ConversationProtocolDetails( ) { Column(modifier = modifier) { FolderHeader(name = stringResource(R.string.folder_label_protocol_details)) - if (protocolInfo is Conversation.ProtocolInfo.MLS) { - ProtocolDetails( - label = UIText.StringResource(R.string.protocol), - text = UIText.DynamicString(protocolInfo.name()) - ) + ProtocolDetails( + label = UIText.StringResource(R.string.protocol), + text = UIText.DynamicString(protocolInfo.name()) + ) + + if (protocolInfo is Conversation.ProtocolInfo.MLS) { ProtocolDetails( label = UIText.StringResource(R.string.cipher_suite), text = UIText.DynamicString(protocolInfo.cipherSuite.toString())