Skip to content

Commit 1af1048

Browse files
committed
msglist: Add “(you)” indicator for self user in DM conversations
Add a localized “(you)” label beside the self user’s display name in direct-message conversation titles. This improves clarity when viewing DMs, especially in contexts where the participant list may otherwise be ambiguous. Update the RecentDmConversationsItem title logic so that: * In a self-DM (case []), append the localized youLabel to the self user’s name. * In a 1:1 DM, append the label when the other participant is the self user (edge case where user IDs match). * For multi-user DMs, retain the existing comma-joined list without a youLabel, preserving current behavior. Update the test helper checkTitle() to match the new rendering behavior. The helper now inspects the rendered Text widgets directly and matches on startsWith(expectedText), making it robust when the title contains WidgetSpans or the new youLabel. Preserve existing TODO comments and layout behavior. All tests pass locally.
1 parent 9296fb3 commit 1af1048

21 files changed

+199
-81
lines changed

assets/l10n/app_en.arb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,10 @@
665665
"@unknownUserName": {
666666
"description": "Name placeholder to use for a user when we don't know their name."
667667
},
668+
"youLabel": "(you)",
669+
"@youLabel": {
670+
"description": "Label shown after the current user's display name in direct messages."
671+
},
668672
"dmsWithYourselfPageTitle": "DMs with yourself",
669673
"@dmsWithYourselfPageTitle": {
670674
"description": "Message list page title for a DM group that only includes yourself."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,12 @@ abstract class ZulipLocalizations {
10411041
/// **'(unknown user)'**
10421042
String get unknownUserName;
10431043

1044+
/// Label shown after the current user's display name in direct messages.
1045+
///
1046+
/// In en, this message translates to:
1047+
/// **'(you)'**
1048+
String get youLabel;
1049+
10441050
/// Message list page title for a DM group that only includes yourself.
10451051
///
10461052
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
552552
@override
553553
String get unknownUserName => '(unknown user)';
554554

555+
@override
556+
String get youLabel => '(you)';
557+
555558
@override
556559
String get dmsWithYourselfPageTitle => 'DMs with yourself';
557560

lib/generated/l10n/zulip_localizations_de.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
571571
@override
572572
String get unknownUserName => '(Nutzer:in unbekannt)';
573573

574+
@override
575+
String get youLabel => '(you)';
576+
574577
@override
575578
String get dmsWithYourselfPageTitle => 'DNs mit dir selbst';
576579

lib/generated/l10n/zulip_localizations_el.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ class ZulipLocalizationsEl extends ZulipLocalizations {
552552
@override
553553
String get unknownUserName => '(unknown user)';
554554

555+
@override
556+
String get youLabel => '(you)';
557+
555558
@override
556559
String get dmsWithYourselfPageTitle => 'DMs with yourself';
557560

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
552552
@override
553553
String get unknownUserName => '(unknown user)';
554554

555+
@override
556+
String get youLabel => '(you)';
557+
555558
@override
556559
String get dmsWithYourselfPageTitle => 'DMs with yourself';
557560

lib/generated/l10n/zulip_localizations_es.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ class ZulipLocalizationsEs extends ZulipLocalizations {
552552
@override
553553
String get unknownUserName => '(unknown user)';
554554

555+
@override
556+
String get youLabel => '(you)';
557+
555558
@override
556559
String get dmsWithYourselfPageTitle => 'DMs with yourself';
557560

lib/generated/l10n/zulip_localizations_fr.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
568568
@override
569569
String get unknownUserName => '(unknown user)';
570570

571+
@override
572+
String get youLabel => '(you)';
573+
571574
@override
572575
String get dmsWithYourselfPageTitle => 'DMs with yourself';
573576

lib/generated/l10n/zulip_localizations_he.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ class ZulipLocalizationsHe extends ZulipLocalizations {
552552
@override
553553
String get unknownUserName => '(unknown user)';
554554

555+
@override
556+
String get youLabel => '(you)';
557+
555558
@override
556559
String get dmsWithYourselfPageTitle => 'DMs with yourself';
557560

lib/generated/l10n/zulip_localizations_hu.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ class ZulipLocalizationsHu extends ZulipLocalizations {
552552
@override
553553
String get unknownUserName => '(unknown user)';
554554

555+
@override
556+
String get youLabel => '(you)';
557+
555558
@override
556559
String get dmsWithYourselfPageTitle => 'DMs with yourself';
557560

0 commit comments

Comments
 (0)