feat: Modal critical event#173
Conversation
baillyjamy
commented
May 7, 2026
- Add verify account alert dialog
- Add Password Changed alert dialog
|
There was a problem hiding this comment.
Pull request overview
This PR adds Compose modal dialogs to surface “critical events” to the user (password changed + follow-up “verify account security” actions), along with localized strings for all currently-supported app locales.
Changes:
- Added new string resources for the dialogs across
values/and all existingvalues-xx/locales. - Hooked dialog presentation into
MainScreenby collectingaccountsWithPasswordUpdateand showing a stacked dialog flow. - Introduced two new Compose
AlertDialogcomponents:PasswordChangedDialogandVerifyAccountSecurityDialog.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values/strings.xml | Adds dialog strings (EN). |
| app/src/main/res/values-da/strings.xml | Adds dialog strings (DA). |
| app/src/main/res/values-de/strings.xml | Adds dialog strings (DE). |
| app/src/main/res/values-el/strings.xml | Adds dialog strings (EL). |
| app/src/main/res/values-es/strings.xml | Adds dialog strings (ES). |
| app/src/main/res/values-fi/strings.xml | Adds dialog strings (FI). |
| app/src/main/res/values-fr/strings.xml | Adds dialog strings (FR). |
| app/src/main/res/values-it/strings.xml | Adds dialog strings (IT). |
| app/src/main/res/values-nb/strings.xml | Adds dialog strings (NB). |
| app/src/main/res/values-nl/strings.xml | Adds dialog strings (NL). |
| app/src/main/res/values-pl/strings.xml | Adds dialog strings (PL). |
| app/src/main/res/values-pt/strings.xml | Adds dialog strings (PT). |
| app/src/main/res/values-sv/strings.xml | Adds dialog strings (SV). |
| app/src/main/kotlin/com/infomaniak/auth/ui/screen/main/MainScreen.kt | Collects password-changed accounts and orchestrates the dialog stack + support/password reset deep links. |
| app/src/main/kotlin/com/infomaniak/auth/ui/components/dialog/PasswordChangedDialog.kt | New Compose AlertDialog for “password changed” with report/ack actions. |
| app/src/main/kotlin/com/infomaniak/auth/ui/components/dialog/VerifyAccountSecurityDialog.kt | New Compose AlertDialog to direct the user to password reset or support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| LaunchedEffect(Unit) { | ||
| viewModel.accountsWithPasswordUpdate.collect { accounts -> | ||
| accounts.firstOrNull()?.let { showPasswordChangedDialogFor = it } | ||
| showPasswordChangedDialogFor = accounts.firstOrNull() | ||
| } | ||
| } |
| showPasswordChangedDialog = true | ||
| }, | ||
| onContactSupport = { | ||
| (account.status as? Account.Status.LoggedIn)?.passwordChangedAck?.invoke() | ||
| context.openUrlInCustomTab(HELP_SUPPORT_URL) | ||
| showVerifyAccountDialog = false | ||
| showPasswordChangedDialog = true |
| showPasswordChangedDialog = true | ||
| }, | ||
| onContactSupport = { | ||
| (account.status as? Account.Status.LoggedIn)?.passwordChangedAck?.invoke() | ||
| context.openUrlInCustomTab(HELP_SUPPORT_URL) | ||
| showVerifyAccountDialog = false | ||
| showPasswordChangedDialog = true |
| showVerifyAccountDialog = false | ||
| showPasswordChangedDialog = true | ||
| }, | ||
| onDismissRequest = { } |
| Text( | ||
| text = stringResource(R.string.alertDialogPasswordChangedTitle), | ||
| textAlign = TextAlign.Center | ||
| ) | ||
| }, | ||
| text = { | ||
| Text(stringResource(R.string.alertDialogPasswordChangedText, account.email)) | ||
| }, |
| Text(stringResource(R.string.alertDialogReportButton)) | ||
| } | ||
| }, | ||
| dismissButton = { | ||
| TextButton(onClick = onDismissRequest) { | ||
| Text(stringResource(R.string.alertDialogNeutralButton)) |
| }, | ||
| confirmButton = { | ||
| TextButton(onClick = onChangePassword) { | ||
| Text(stringResource(R.string.alertDialogChangePasswordButton)) |
| }, | ||
| dismissButton = { | ||
| TextButton(onClick = onContactSupport) { | ||
| Text(stringResource(R.string.alertDialogContactSupportButton)) |
| @Composable | ||
| private fun PasswordChangedStackDialog( | ||
| account: Account, | ||
| ) { | ||
| var showPasswordChangedDialog by remember { mutableStateOf(true) } | ||
| LaunchedEffect(account) { | ||
| showPasswordChangedDialog = true | ||
| } | ||
|
|
||
| var showVerifyAccountDialog by remember { mutableStateOf(false) } | ||
| val context = LocalContext.current | ||
|
|
||
| if (showPasswordChangedDialog) { | ||
| PasswordChangedDialog( | ||
| account = account, | ||
| onDismissRequest = { | ||
| (account.status as? Account.Status.LoggedIn)?.passwordChangedAck?.invoke() | ||
| showPasswordChangedDialog = false | ||
| }, | ||
| onReportUnauthorizedChange = { | ||
| showPasswordChangedDialog = false | ||
| showVerifyAccountDialog = true | ||
| } | ||
| ) | ||
| } | ||
|
|
||
| if (showVerifyAccountDialog) { | ||
| VerifyAccountSecurityDialog( | ||
| onChangePassword = { | ||
| (account.status as? Account.Status.LoggedIn)?.passwordChangedAck?.invoke() | ||
| context.openUrlInCustomTab(RECOVER_PASSWORD_URL) | ||
| showVerifyAccountDialog = false | ||
| showPasswordChangedDialog = true | ||
| }, | ||
| onContactSupport = { | ||
| (account.status as? Account.Status.LoggedIn)?.passwordChangedAck?.invoke() | ||
| context.openUrlInCustomTab(HELP_SUPPORT_URL) | ||
| showVerifyAccountDialog = false | ||
| showPasswordChangedDialog = true | ||
| }, | ||
| onDismissRequest = { } | ||
| ) | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
You can put val context = LocalContext.current inside the if (showVerifyAccountDialog) {.
|
When we click outside the first dialog, it dismisses the dialog and change the value back to LoggedIn without the passwordAckCallback. We want the user to click on « I understand » to be sure the user acknowledge the change no ? |


