From fd5b9a341c144c32d05fa2573281a1af1bb7f483 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Fri, 3 Oct 2025 16:31:10 -0700 Subject: [PATCH] action_sheet: Prefix channel name with "#" in a confirmation dialog title See Alya's feedback on #1890: https://github.com/zulip/zulip-flutter/pull/1890#issuecomment-3358327567 > In general, our pattern is to always show a privacy marker or (if > not convenient) a `#` before a channel name. It can be a separate > PR, but can we add that to these confirmation dialogs? Doing this in code, rather than in the translators' source string, because we don't want it to vary by language. --- assets/l10n/app_en.arb | 2 +- lib/widgets/action_sheet.dart | 2 +- test/widgets/action_sheet_test.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/l10n/app_en.arb b/assets/l10n/app_en.arb index 2570578b6f..05598dab42 100644 --- a/assets/l10n/app_en.arb +++ b/assets/l10n/app_en.arb @@ -140,7 +140,7 @@ "@unsubscribeConfirmationDialogTitle": { "description": "Title for a confirmation dialog for unsubscribing from a channel.", "placeholders": { - "channelName": {"type": "String", "example": "mobile"} + "channelName": {"type": "String", "example": "#mobile"} } }, "unsubscribeConfirmationDialogMessageCannotResubscribe": "Once you leave this channel, you will not be able to rejoin.", diff --git a/lib/widgets/action_sheet.dart b/lib/widgets/action_sheet.dart index 5d233a527f..96f365d409 100644 --- a/lib/widgets/action_sheet.dart +++ b/lib/widgets/action_sheet.dart @@ -647,7 +647,7 @@ class UnsubscribeButton extends ActionSheetMenuItemButton { final zulipLocalizations = ZulipLocalizations.of(pageContext); final dialog = showSuggestedActionDialog(context: pageContext, - title: zulipLocalizations.unsubscribeConfirmationDialogTitle(subscription.name), + title: zulipLocalizations.unsubscribeConfirmationDialogTitle('#${subscription.name}'), message: zulipLocalizations.unsubscribeConfirmationDialogMessageCannotResubscribe, destructiveActionButton: true, actionButtonText: zulipLocalizations.unsubscribeConfirmationDialogConfirmButton); diff --git a/test/widgets/action_sheet_test.dart b/test/widgets/action_sheet_test.dart index e03e102cf5..8107b6fbcb 100644 --- a/test/widgets/action_sheet_test.dart +++ b/test/widgets/action_sheet_test.dart @@ -599,7 +599,7 @@ void main() { await tester.pump(); final (unsubscribeButton, cancelButton) = checkSuggestedActionDialog(tester, - expectedTitle: 'Unsubscribe from ${channel.name}?', + expectedTitle: 'Unsubscribe from #${channel.name}?', expectedMessage: 'Once you leave this channel, you will not be able to rejoin.', expectDestructiveActionButton: true, expectedActionButtonText: 'Unsubscribe');