Skip to content

Commit f144ba6

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 a4b5abb commit f144ba6

18 files changed

+836
-71
lines changed

assets/l10n/app_en.arb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,9 @@
409409
"@composeBoxGenericContentHint": {
410410
"description": "Hint text for content input when sending a message."
411411
},
412-
"newDmSheetBackButtonLabel": "Back",
413-
"@newDmSheetBackButtonLabel": {
414-
"description": "Label for the back button in the new DM sheet, allowing the user to return to the previous screen."
415-
},
416-
"newDmSheetNextButtonLabel": "Next",
417-
"@newDmSheetNextButtonLabel": {
418-
"description": "Label for the front button in the new DM sheet, if applicable, for navigation or action."
412+
"newDmSheetComposeButtonLabel": "Compose",
413+
"@newDmSheetComposeButtonLabel": {
414+
"description": "Label for the compose button in the new DM sheet that starts composing a message to the selected users."
419415
},
420416
"newDmSheetScreenTitle": "New DM",
421417
"@newDmSheetScreenTitle": {
@@ -431,7 +427,7 @@
431427
},
432428
"newDmSheetSearchHintSomeSelected": "Add another user…",
433429
"@newDmSheetSearchHintSomeSelected": {
434-
"description": "Hint text for the search bar when at least one user is selected"
430+
"description": "Hint text for the search bar when at least one user is selected."
435431
},
436432
"newDmSheetNoUsersFound": "No users found",
437433
"@newDmSheetNoUsersFound": {

lib/generated/l10n/zulip_localizations.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -691,17 +691,11 @@ abstract class ZulipLocalizations {
691691
/// **'Type a message'**
692692
String get composeBoxGenericContentHint;
693693

694-
/// Label for the back button in the new DM sheet, allowing the user to return to the previous screen.
694+
/// Label for the compose button in the new DM sheet that starts composing a message to the selected users.
695695
///
696696
/// In en, this message translates to:
697-
/// **'Back'**
698-
String get newDmSheetBackButtonLabel;
699-
700-
/// Label for the front button in the new DM sheet, if applicable, for navigation or action.
701-
///
702-
/// In en, this message translates to:
703-
/// **'Next'**
704-
String get newDmSheetNextButtonLabel;
697+
/// **'Compose'**
698+
String get newDmSheetComposeButtonLabel;
705699

706700
/// Title displayed at the top of the new DM screen.
707701
///
@@ -721,7 +715,7 @@ abstract class ZulipLocalizations {
721715
/// **'Add one or more users'**
722716
String get newDmSheetSearchHintEmpty;
723717

724-
/// Hint text for the search bar when at least one user is selected
718+
/// Hint text for the search bar when at least one user is selected.
725719
///
726720
/// In en, this message translates to:
727721
/// **'Add another user…'**

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
344344
String get composeBoxGenericContentHint => 'Type a message';
345345

346346
@override
347-
String get newDmSheetBackButtonLabel => 'Back';
348-
349-
@override
350-
String get newDmSheetNextButtonLabel => 'Next';
347+
String get newDmSheetComposeButtonLabel => 'Compose';
351348

352349
@override
353350
String get newDmSheetScreenTitle => 'New DM';

lib/generated/l10n/zulip_localizations_de.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
344344
String get composeBoxGenericContentHint => 'Type a message';
345345

346346
@override
347-
String get newDmSheetBackButtonLabel => 'Back';
348-
349-
@override
350-
String get newDmSheetNextButtonLabel => 'Next';
347+
String get newDmSheetComposeButtonLabel => 'Compose';
351348

352349
@override
353350
String get newDmSheetScreenTitle => 'New DM';

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
344344
String get composeBoxGenericContentHint => 'Type a message';
345345

346346
@override
347-
String get newDmSheetBackButtonLabel => 'Back';
348-
349-
@override
350-
String get newDmSheetNextButtonLabel => 'Next';
347+
String get newDmSheetComposeButtonLabel => 'Compose';
351348

352349
@override
353350
String get newDmSheetScreenTitle => 'New DM';

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
344344
String get composeBoxGenericContentHint => 'Type a message';
345345

346346
@override
347-
String get newDmSheetBackButtonLabel => 'Back';
348-
349-
@override
350-
String get newDmSheetNextButtonLabel => 'Next';
347+
String get newDmSheetComposeButtonLabel => 'Compose';
351348

352349
@override
353350
String get newDmSheetScreenTitle => 'New DM';

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
344344
String get composeBoxGenericContentHint => 'Type a message';
345345

346346
@override
347-
String get newDmSheetBackButtonLabel => 'Back';
348-
349-
@override
350-
String get newDmSheetNextButtonLabel => 'Next';
347+
String get newDmSheetComposeButtonLabel => 'Compose';
351348

352349
@override
353350
String get newDmSheetScreenTitle => 'New DM';

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,7 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
351351
String get composeBoxGenericContentHint => 'Wpisz wiadomość';
352352

353353
@override
354-
String get newDmSheetBackButtonLabel => 'Back';
355-
356-
@override
357-
String get newDmSheetNextButtonLabel => 'Next';
354+
String get newDmSheetComposeButtonLabel => 'Compose';
358355

359356
@override
360357
String get newDmSheetScreenTitle => 'New DM';

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,7 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
352352
String get composeBoxGenericContentHint => 'Ввести сообщение';
353353

354354
@override
355-
String get newDmSheetBackButtonLabel => 'Back';
356-
357-
@override
358-
String get newDmSheetNextButtonLabel => 'Next';
355+
String get newDmSheetComposeButtonLabel => 'Compose';
359356

360357
@override
361358
String get newDmSheetScreenTitle => 'New DM';

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
344344
String get composeBoxGenericContentHint => 'Type a message';
345345

346346
@override
347-
String get newDmSheetBackButtonLabel => 'Back';
348-
349-
@override
350-
String get newDmSheetNextButtonLabel => 'Next';
347+
String get newDmSheetComposeButtonLabel => 'Compose';
351348

352349
@override
353350
String get newDmSheetScreenTitle => 'New DM';

lib/generated/l10n/zulip_localizations_uk.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,7 @@ class ZulipLocalizationsUk extends ZulipLocalizations {
353353
String get composeBoxGenericContentHint => 'Ввести повідомлення';
354354

355355
@override
356-
String get newDmSheetBackButtonLabel => 'Back';
357-
358-
@override
359-
String get newDmSheetNextButtonLabel => 'Next';
356+
String get newDmSheetComposeButtonLabel => 'Compose';
360357

361358
@override
362359
String get newDmSheetScreenTitle => 'New DM';

lib/generated/l10n/zulip_localizations_zh.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ class ZulipLocalizationsZh extends ZulipLocalizations {
344344
String get composeBoxGenericContentHint => 'Type a message';
345345

346346
@override
347-
String get newDmSheetBackButtonLabel => 'Back';
348-
349-
@override
350-
String get newDmSheetNextButtonLabel => 'Next';
347+
String get newDmSheetComposeButtonLabel => 'Compose';
351348

352349
@override
353350
String get newDmSheetScreenTitle => 'New DM';

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)