Skip to content

feat: Modal critical event#173

Open
baillyjamy wants to merge 4 commits intomainfrom
feat-modal-critical-event
Open

feat: Modal critical event#173
baillyjamy wants to merge 4 commits intomainfrom
feat-modal-critical-event

Conversation

@baillyjamy
Copy link
Copy Markdown
Contributor

  • Add verify account alert dialog
  • Add Password Changed alert dialog

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 existing values-xx/ locales.
  • Hooked dialog presentation into MainScreen by collecting accountsWithPasswordUpdate and showing a stacked dialog flow.
  • Introduced two new Compose AlertDialog components: PasswordChangedDialog and VerifyAccountSecurityDialog.

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.

Comment on lines 99 to 103
LaunchedEffect(Unit) {
viewModel.accountsWithPasswordUpdate.collect { accounts ->
accounts.firstOrNull()?.let { showPasswordChangedDialogFor = it }
showPasswordChangedDialogFor = accounts.firstOrNull()
}
}
Comment on lines +184 to +190
showPasswordChangedDialog = true
},
onContactSupport = {
(account.status as? Account.Status.LoggedIn)?.passwordChangedAck?.invoke()
context.openUrlInCustomTab(HELP_SUPPORT_URL)
showVerifyAccountDialog = false
showPasswordChangedDialog = true
Comment on lines +184 to +190
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 = { }
Comment on lines +50 to +57
Text(
text = stringResource(R.string.alertDialogPasswordChangedTitle),
textAlign = TextAlign.Center
)
},
text = {
Text(stringResource(R.string.alertDialogPasswordChangedText, account.email))
},
Comment on lines +65 to +70
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))
Comment on lines +152 to +196
@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 = { }
)
}
}

Copy link
Copy Markdown
Contributor

@tevincent tevincent May 8, 2026

Choose a reason for hiding this comment

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

You can put val context = LocalContext.current inside the if (showVerifyAccountDialog) {.

@tevincent
Copy link
Copy Markdown
Contributor

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 ?

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.

3 participants