From f005693874c541dcfeb16e9451c28a311bfce46d Mon Sep 17 00:00:00 2001 From: Thirumani Vihaan Date: Thu, 16 Jul 2026 20:20:58 +0530 Subject: [PATCH] Fix #7181: Remove back arrow from device verified screen and use 'Done' text (#7222) * Fix #7181: Remove back arrow from device verified screen and use 'Done' text * Update screenshots * Fix failing Maestro test by tapping 'Done' instead of 'Continue' --------- Co-authored-by: ElementBot Co-authored-by: thirumani-vihaan --- .maestro/tests/account/verifySession.yaml | 2 +- .../impl/outgoing/OutgoingVerificationView.kt | 15 +++++++++------ .../impl/outgoing/OutgoingVerificationViewTest.kt | 8 ++++---- ...utgoing_OutgoingVerificationView_Day_10_en.png | 4 ++-- ...utgoing_OutgoingVerificationView_Day_11_en.png | 4 ++-- ...going_OutgoingVerificationView_Night_10_en.png | 4 ++-- ...going_OutgoingVerificationView_Night_11_en.png | 4 ++-- 7 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.maestro/tests/account/verifySession.yaml b/.maestro/tests/account/verifySession.yaml index 20b3d1b8ac..456627f742 100644 --- a/.maestro/tests/account/verifySession.yaml +++ b/.maestro/tests/account/verifySession.yaml @@ -16,4 +16,4 @@ appId: ${MAESTRO_APP_ID} - extendedWaitUntil: visible: "Device verified" timeout: 30000 -- tapOn: "Continue" +- tapOn: "Done" diff --git a/features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/outgoing/OutgoingVerificationView.kt b/features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/outgoing/OutgoingVerificationView.kt index 1c199f8826..9131ad63fb 100644 --- a/features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/outgoing/OutgoingVerificationView.kt +++ b/features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/outgoing/OutgoingVerificationView.kt @@ -66,7 +66,8 @@ fun OutgoingVerificationView( fun cancelOrResetFlow() { when (step) { is Step.Canceled -> state.eventSink(OutgoingVerificationViewEvents.Reset) - Step.Initial, Step.Completed -> onBack() + Step.Initial -> onBack() + Step.Completed -> onFinish() Step.Ready, is Step.AwaitingOtherDeviceResponse -> state.eventSink(OutgoingVerificationViewEvents.Cancel) is Step.Verifying -> { if (!step.state.isLoading()) { @@ -96,7 +97,9 @@ fun OutgoingVerificationView( TopAppBar( title = {}, navigationIcon = { - BackButton(onClick = ::cancelOrResetFlow) + if (step !is Step.Completed) { + BackButton(onClick = ::cancelOrResetFlow) + } }, colors = topAppBarColors(containerColor = Color.Transparent), ) @@ -108,7 +111,7 @@ fun OutgoingVerificationView( OutgoingVerificationBottomMenu( state = state, onCancelClick = ::cancelOrResetFlow, - onContinueClick = onFinish, + onDoneClick = onFinish, ) }, isScrollable = true, @@ -244,7 +247,7 @@ private fun ContentInitial( private fun OutgoingVerificationBottomMenu( state: OutgoingVerificationState, onCancelClick: () -> Unit, - onContinueClick: () -> Unit, + onDoneClick: () -> Unit, ) { val eventSink = state.eventSink when (val step = state.step) { @@ -313,8 +316,8 @@ private fun OutgoingVerificationBottomMenu( VerificationBottomMenu { Button( modifier = Modifier.fillMaxWidth(), - text = stringResource(CommonStrings.action_continue), - onClick = onContinueClick, + text = stringResource(CommonStrings.action_done), + onClick = onDoneClick, ) InvisibleButton() } diff --git a/features/verifysession/impl/src/test/kotlin/io/element/android/features/verifysession/impl/outgoing/OutgoingVerificationViewTest.kt b/features/verifysession/impl/src/test/kotlin/io/element/android/features/verifysession/impl/outgoing/OutgoingVerificationViewTest.kt index 311b9c795e..2b5ec63ced 100644 --- a/features/verifysession/impl/src/test/kotlin/io/element/android/features/verifysession/impl/outgoing/OutgoingVerificationViewTest.kt +++ b/features/verifysession/impl/src/test/kotlin/io/element/android/features/verifysession/impl/outgoing/OutgoingVerificationViewTest.kt @@ -99,10 +99,10 @@ class OutgoingVerificationViewTest : RobolectricTest() { } @Test - fun `back key pressed - on Completed exits the flow`() = runAndroidComposeUiTest { + fun `back key pressed - on Completed finishes the flow`() = runAndroidComposeUiTest { ensureCalledOnce { callback -> setOutgoingVerificationView( - onBack = callback, + onFinished = callback, state = anOutgoingVerificationState( step = OutgoingVerificationState.Step.Completed, ), @@ -112,7 +112,7 @@ class OutgoingVerificationViewTest : RobolectricTest() { } @Test - fun `when flow is completed and the user clicks on the continue button, the expected callback is invoked`() = runAndroidComposeUiTest { + fun `when flow is completed and the user clicks on the done button, the expected callback is invoked`() = runAndroidComposeUiTest { val eventsRecorder = EventsRecorder(expectEvents = false) ensureCalledOnce { callback -> setOutgoingVerificationView( @@ -122,7 +122,7 @@ class OutgoingVerificationViewTest : RobolectricTest() { ), onFinished = callback, ) - clickOn(CommonStrings.action_continue) + clickOn(CommonStrings.action_done) } } diff --git a/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Day_10_en.png b/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Day_10_en.png index 985c931a4c..9d1a89e07b 100644 --- a/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Day_10_en.png +++ b/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Day_10_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9c41e73e5672477877ad2fdf17f54373ccac938fe71b2d9b3e53a191b6c658ab -size 26697 +oid sha256:917a2f98fd8feef075587d4176020e98aa6834d39423e29ddaf5f10244a6ffed +size 25647 diff --git a/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Day_11_en.png b/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Day_11_en.png index f2ee878314..ab703510df 100644 --- a/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Day_11_en.png +++ b/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Day_11_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd79cc12515daa43485e6b412e0e98dd3bb9f90882d173c6b48a85de36977afe -size 26164 +oid sha256:dddee8fbcb6e9ddead24c66b0e15b4e9fb1b5d8b56eba4dda369755769c2b92e +size 25128 diff --git a/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Night_10_en.png b/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Night_10_en.png index ffb648a554..4ca95f531b 100644 --- a/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Night_10_en.png +++ b/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Night_10_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c8f9b413f870e28b65528fefcdd879f687ff6b485e57ffa3b53fac9dc5b8724d -size 26036 +oid sha256:b1a4e54a3f7154294b772f647d9bebdb3a8ec149996a308fe7e6b610c0854a80 +size 25072 diff --git a/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Night_11_en.png b/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Night_11_en.png index a826b396ca..54a166cff5 100644 --- a/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Night_11_en.png +++ b/tests/uitests/src/test/snapshots/images/features.verifysession.impl.outgoing_OutgoingVerificationView_Night_11_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1721ac66d58b99333061ee6148d5b242eea75eda7137076c4632a52a11720252 -size 25422 +oid sha256:d13b603195be9d91383818fbc0fa79ec533256305092c6c7433c4cc8e17d1fe5 +size 24446