Skip to content

Commit 6d756de

Browse files
committed
new_dm: Add UI for starting new DM conversations
Add a modal bottom sheet UI for starting direct messages: - Search and select users from global list - Support single and group DMs - Navigate to message list after selection Design reference: https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=4903-31879&p=f&t=pQP4QcxpccllCF7g-0 Fixes: #127
1 parent 9689dce commit 6d756de

16 files changed

+1022
-13
lines changed

assets/l10n/app_en.arb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,30 @@
345345
"@composeBoxGenericContentHint": {
346346
"description": "Hint text for content input when sending a message."
347347
},
348+
"newDmSheetComposeButtonLabel": "Compose",
349+
"@newDmSheetComposeButtonLabel": {
350+
"description": "Label for the compose button in the new DM sheet that starts composing a message to the selected users."
351+
},
352+
"newDmSheetScreenTitle": "New DM",
353+
"@newDmSheetScreenTitle": {
354+
"description": "Title displayed at the top of the new DM screen."
355+
},
356+
"newDmFabButtonLabel": "New DM",
357+
"@newDmFabButtonLabel": {
358+
"description": "Label for the floating action button (FAB) that opens the new DM sheet."
359+
},
360+
"newDmSheetSearchHintEmpty": "Add one or more users",
361+
"@newDmSheetSearchHintEmpty": {
362+
"description": "Hint text for the search bar when no users are selected"
363+
},
364+
"newDmSheetSearchHintSomeSelected": "Add another user…",
365+
"@newDmSheetSearchHintSomeSelected": {
366+
"description": "Hint text for the search bar when at least one user is selected."
367+
},
368+
"newDmSheetNoUsersFound": "No users found",
369+
"@newDmSheetNoUsersFound": {
370+
"description": "Message shown in the new DM sheet when no users match the search."
371+
},
348372
"composeBoxDmContentHint": "Message @{user}",
349373
"@composeBoxDmContentHint": {
350374
"description": "Hint text for content input when sending a message to one other person.",

lib/generated/l10n/zulip_localizations.dart

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,42 @@ abstract class ZulipLocalizations {
580580
/// **'Type a message'**
581581
String get composeBoxGenericContentHint;
582582

583+
/// Label for the compose button in the new DM sheet that starts composing a message to the selected users.
584+
///
585+
/// In en, this message translates to:
586+
/// **'Compose'**
587+
String get newDmSheetComposeButtonLabel;
588+
589+
/// Title displayed at the top of the new DM screen.
590+
///
591+
/// In en, this message translates to:
592+
/// **'New DM'**
593+
String get newDmSheetScreenTitle;
594+
595+
/// Label for the floating action button (FAB) that opens the new DM sheet.
596+
///
597+
/// In en, this message translates to:
598+
/// **'New DM'**
599+
String get newDmFabButtonLabel;
600+
601+
/// Hint text for the search bar when no users are selected
602+
///
603+
/// In en, this message translates to:
604+
/// **'Add one or more users'**
605+
String get newDmSheetSearchHintEmpty;
606+
607+
/// Hint text for the search bar when at least one user is selected.
608+
///
609+
/// In en, this message translates to:
610+
/// **'Add another user…'**
611+
String get newDmSheetSearchHintSomeSelected;
612+
613+
/// Message shown in the new DM sheet when no users match the search.
614+
///
615+
/// In en, this message translates to:
616+
/// **'No users found'**
617+
String get newDmSheetNoUsersFound;
618+
583619
/// Hint text for content input when sending a message to one other person.
584620
///
585621
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,24 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
291291
@override
292292
String get composeBoxGenericContentHint => 'Type a message';
293293

294+
@override
295+
String get newDmSheetComposeButtonLabel => 'Compose';
296+
297+
@override
298+
String get newDmSheetScreenTitle => 'New DM';
299+
300+
@override
301+
String get newDmFabButtonLabel => 'New DM';
302+
303+
@override
304+
String get newDmSheetSearchHintEmpty => 'Add one or more users';
305+
306+
@override
307+
String get newDmSheetSearchHintSomeSelected => 'Add another user…';
308+
309+
@override
310+
String get newDmSheetNoUsersFound => 'No users found';
311+
294312
@override
295313
String composeBoxDmContentHint(String user) {
296314
return 'Message @$user';

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,24 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
291291
@override
292292
String get composeBoxGenericContentHint => 'Type a message';
293293

294+
@override
295+
String get newDmSheetComposeButtonLabel => 'Compose';
296+
297+
@override
298+
String get newDmSheetScreenTitle => 'New DM';
299+
300+
@override
301+
String get newDmFabButtonLabel => 'New DM';
302+
303+
@override
304+
String get newDmSheetSearchHintEmpty => 'Add one or more users';
305+
306+
@override
307+
String get newDmSheetSearchHintSomeSelected => 'Add another user…';
308+
309+
@override
310+
String get newDmSheetNoUsersFound => 'No users found';
311+
294312
@override
295313
String composeBoxDmContentHint(String user) {
296314
return 'Message @$user';

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,24 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
291291
@override
292292
String get composeBoxGenericContentHint => 'Type a message';
293293

294+
@override
295+
String get newDmSheetComposeButtonLabel => 'Compose';
296+
297+
@override
298+
String get newDmSheetScreenTitle => 'New DM';
299+
300+
@override
301+
String get newDmFabButtonLabel => 'New DM';
302+
303+
@override
304+
String get newDmSheetSearchHintEmpty => 'Add one or more users';
305+
306+
@override
307+
String get newDmSheetSearchHintSomeSelected => 'Add another user…';
308+
309+
@override
310+
String get newDmSheetNoUsersFound => 'No users found';
311+
294312
@override
295313
String composeBoxDmContentHint(String user) {
296314
return 'Message @$user';

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,24 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
291291
@override
292292
String get composeBoxGenericContentHint => 'Type a message';
293293

294+
@override
295+
String get newDmSheetComposeButtonLabel => 'Compose';
296+
297+
@override
298+
String get newDmSheetScreenTitle => 'New DM';
299+
300+
@override
301+
String get newDmFabButtonLabel => 'New DM';
302+
303+
@override
304+
String get newDmSheetSearchHintEmpty => 'Add one or more users';
305+
306+
@override
307+
String get newDmSheetSearchHintSomeSelected => 'Add another user…';
308+
309+
@override
310+
String get newDmSheetNoUsersFound => 'No users found';
311+
294312
@override
295313
String composeBoxDmContentHint(String user) {
296314
return 'Message @$user';

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,24 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
298298
@override
299299
String get composeBoxGenericContentHint => 'Wpisz wiadomość';
300300

301+
@override
302+
String get newDmSheetComposeButtonLabel => 'Compose';
303+
304+
@override
305+
String get newDmSheetScreenTitle => 'New DM';
306+
307+
@override
308+
String get newDmFabButtonLabel => 'New DM';
309+
310+
@override
311+
String get newDmSheetSearchHintEmpty => 'Add one or more users';
312+
313+
@override
314+
String get newDmSheetSearchHintSomeSelected => 'Add another user…';
315+
316+
@override
317+
String get newDmSheetNoUsersFound => 'No users found';
318+
301319
@override
302320
String composeBoxDmContentHint(String user) {
303321
return 'Napisz do @$user';

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,24 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
299299
@override
300300
String get composeBoxGenericContentHint => 'Ввести сообщение';
301301

302+
@override
303+
String get newDmSheetComposeButtonLabel => 'Compose';
304+
305+
@override
306+
String get newDmSheetScreenTitle => 'New DM';
307+
308+
@override
309+
String get newDmFabButtonLabel => 'New DM';
310+
311+
@override
312+
String get newDmSheetSearchHintEmpty => 'Add one or more users';
313+
314+
@override
315+
String get newDmSheetSearchHintSomeSelected => 'Add another user…';
316+
317+
@override
318+
String get newDmSheetNoUsersFound => 'No users found';
319+
302320
@override
303321
String composeBoxDmContentHint(String user) {
304322
return 'Сообщение для @$user';

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,24 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
291291
@override
292292
String get composeBoxGenericContentHint => 'Type a message';
293293

294+
@override
295+
String get newDmSheetComposeButtonLabel => 'Compose';
296+
297+
@override
298+
String get newDmSheetScreenTitle => 'New DM';
299+
300+
@override
301+
String get newDmFabButtonLabel => 'New DM';
302+
303+
@override
304+
String get newDmSheetSearchHintEmpty => 'Add one or more users';
305+
306+
@override
307+
String get newDmSheetSearchHintSomeSelected => 'Add another user…';
308+
309+
@override
310+
String get newDmSheetNoUsersFound => 'No users found';
311+
294312
@override
295313
String composeBoxDmContentHint(String user) {
296314
return 'Message @$user';

lib/generated/l10n/zulip_localizations_uk.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,24 @@ class ZulipLocalizationsUk extends ZulipLocalizations {
300300
@override
301301
String get composeBoxGenericContentHint => 'Ввести повідомлення';
302302

303+
@override
304+
String get newDmSheetComposeButtonLabel => 'Compose';
305+
306+
@override
307+
String get newDmSheetScreenTitle => 'New DM';
308+
309+
@override
310+
String get newDmFabButtonLabel => 'New DM';
311+
312+
@override
313+
String get newDmSheetSearchHintEmpty => 'Add one or more users';
314+
315+
@override
316+
String get newDmSheetSearchHintSomeSelected => 'Add another user…';
317+
318+
@override
319+
String get newDmSheetNoUsersFound => 'No users found';
320+
303321
@override
304322
String composeBoxDmContentHint(String user) {
305323
return 'Повідомлення @$user';

lib/model/autocomplete.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ class MentionAutocompleteView extends AutocompleteView<MentionAutocompleteQuery,
556556
/// returns a positive number if [userB] is more recent than [userA],
557557
/// and returns `0` if both [userA] and [userB] are equally recent
558558
/// or there is no DM exchanged with them whatsoever.
559-
@visibleForTesting
560559
static int compareByDms(User userA, User userB, {required PerAccountStore store}) {
561560
final recentDms = store.recentDmConversationsView;
562561
final aLatestMessageId = recentDms.latestMessagesByRecipient[userA.userId];

0 commit comments

Comments
 (0)