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

Always display 'lost recovery key?' option #2745

Merged
merged 11 commits into from
Apr 25, 2024

Conversation

jmartinesp
Copy link
Contributor

@jmartinesp jmartinesp commented Apr 23, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

  • Removes 'create new key' option from the initial screen of the session verification flow that appeared when the current session was the only one.
  • Always displays 'Lost your recovery key?' action in the enter recovery key screen instead.
  • Added tests for that screen.

Motivation and context

Should be enough to close #2740. It also applies the latest changes to the designs in Figma, which changed the behaviour mentioned above.

Screenshots / GIFs

In the PR.

Tests

  • Log into an account.
  • Use 'enter recovery key' to enter the recovery key verification screen.
  • The new 'Lost your recovery key?' button should be present.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14

Checklist

@jmartinesp jmartinesp requested a review from a team as a code owner April 23, 2024 15:03
@jmartinesp jmartinesp requested review from bmarty and removed request for a team April 23, 2024 15:03
Copy link
Contributor

github-actions bot commented Apr 23, 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/x8fxED

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

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

Project coverage is 73.56%. Comparing base (9a780cd) to head (2036881).
Report is 12 commits behind head on develop.

Files Patch % Lines
...kup/impl/enter/SecureBackupEnterRecoveryKeyView.kt 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2745      +/-   ##
===========================================
+ Coverage    73.55%   73.56%   +0.01%     
===========================================
  Files         1501     1501              
  Lines        35987    35992       +5     
  Branches      6940     6940              
===========================================
+ Hits         26471    26479       +8     
+ Misses        5869     5867       -2     
+ Partials      3647     3646       -1     

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

Thanks!
A few comments.

)
}
BottomMenu(
positiveButtonTitle = stringResource(R.string.screen_identity_use_another_device),
Copy link
Member

Choose a reason for hiding this comment

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

I do not think we should propose to "Use another device" if we know that this is the latest session (isLastDevice). Maybe the UX can be better here by just hiding the first button?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in ccf3c2a.

@@ -29,7 +29,7 @@ data class VerifySelfSessionState(
) {
@Stable
sealed interface VerificationStep {
data class Initial(val canEnterRecoveryKey: Boolean, val isLastDevice: Boolean) : VerificationStep
data class Initial(val canEnterRecoveryKey: Boolean) : VerificationStep
Copy link
Member

Choose a reason for hiding this comment

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

Maybe revert this change, see my other comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also done in ccf3c2a.

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 should not use the term passcode, this is element-hq/element-meta#2402 and since this is affecting the same preview, maybe handle it in the same PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is only the 4th time we've changed this screen in the past couple of weeks. I guess 5th time's the charm!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

5b84eb7 + a new recording of screenshots should fix it.

Use it to display only 'enter recovery key' option for verification.
This should fix the wrong term 'passcode' being used in the recovery key screen title.
@jmartinesp jmartinesp requested a review from bmarty April 24, 2024 13:58
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.

Thanks for the changes. One final remark, then I think we're good!

text = stringResource(id = R.string.screen_recovery_key_confirm_lost_recovery_key),
modifier = Modifier.fillMaxWidth(),
onClick = onCreateRecoveryKey,
)
Copy link
Member

@bmarty bmarty Apr 25, 2024

Choose a reason for hiding this comment

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

I think this button should be disabled when state.submitAction.isLoading(). WDYT?

Made this remark when seeing this screenshot: https://github.com/element-hq/element-x-android/pull/2745/files#diff-dbd46661ff7c38b3aefb7d016c5a6e54348191cc5ac6a6f1bd71213ad7db2019

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, when the progress indicator is displayed the button is not clickable, so it's 'disabled' although it doesn't display the disabled state. It's what we have everywhere else I believe.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, for "Continue" button, but I am talking about the other one "Lost your recovery key?". Sorry if it was not clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah true, good call!

Copy link
Member

Choose a reason for hiding this comment

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

So to clarify:
The two buttons must be disabled during the submit action loading, to avoid user navigating away during the process.

Adding at line 101:

enabled = !state.submitAction.isLoading()

should be fine.

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Apr 25, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Apr 25, 2024
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.

Thanks!

Copy link

sonarcloud bot commented Apr 25, 2024

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

@jmartinesp jmartinesp merged commit 7397df8 into develop Apr 25, 2024
16 checks passed
@jmartinesp jmartinesp deleted the fix/jme/always-display-lost-recovery-key-action branch April 25, 2024 13:28
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] Reset Recovery Key Screen
3 participants