-
Notifications
You must be signed in to change notification settings - Fork 116
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
Improve session recovery screens #2657
Improve session recovery screens #2657
Conversation
|
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2657 +/- ##
===========================================
- Coverage 73.58% 73.58% -0.01%
===========================================
Files 1458 1460 +2
Lines 35256 35338 +82
Branches 6775 6793 +18
===========================================
+ Hits 25942 26002 +60
- Misses 5786 5796 +10
- Partials 3528 3540 +12 ☔ View full report in Codecov by Sentry. |
…-session-recovery-to-ftue
3ecdda1
to
c7ec591
Compare
|
||
@PreviewsDayNight | ||
@Composable | ||
internal fun ItemNumberPreview() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this function to CreateNewRecoveryKeyViewPreview
please?
@Composable | ||
private fun Content() { | ||
Column(modifier = Modifier.padding(horizontal = 16.dp), verticalArrangement = Arrangement.spacedBy(24.dp)) { | ||
Item(index = 1, text = AnnotatedString(stringResource(R.string.screen_create_new_recovery_key_list_item_1))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Element
should not be hard-coded in the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the index? What should we use instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I just realised you meant the name of the app. Sorry.
it.onDone() | ||
} | ||
} | ||
private val callback = plugins<VerifySessionEntryPoint.Callback>().first() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that we will have only one plugin for the callback, but the current practice is to invoke the method on all the Callback in the plugin list.
onPositiveButtonClicked = onEnterRecoveryKey, | ||
negativeButtonTitle = stringResource(R.string.screen_identity_confirmation_create_new_recovery_key), | ||
onNegativeButtonClicked = onCreateNewRecoveryKey, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think that it is a good idea to display the Create a new recovery key
action only if this is the last device.
Users may have ghost sessions (i.e. not logged out sessions but not accessible anymore, for instance after uninstalling the application without signing out).
Giving such feedback in the PR is not great, and maybe this has been discussed internally. Sorry if it's the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we always included it we'd have 3 buttons for 'use another device', 'use recovery key' or 'reset recovery key', which seems like a bit too much. The flows were designed this way, but maybe we can revisit them in the future and add it either on the root view or in the enter recovery key one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -119,6 +123,7 @@ class VerifySelfSessionViewTest { | |||
eventSink = eventsRecorder | |||
), | |||
onEnterRecoveryKey = EnsureNeverCalled(), | |||
onCreateNewRecoveryKey = EnsureNeverCalled(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should introduce an extension <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setVerifySelfSessionView
to avoid touching all the tests when a new callback is added.
…-session-recovery-to-ftue
|
Type of change
Content
Motivation and context
Closes #2579, also takes care of https://github.com/element-hq/element-internal/issues/583.
Screenshots / GIFs
In the PR.
Tests
VerifySelfSessionPresenter
soisLastDevice
is true.Tested devices
Checklist