Skip to content

autocomplete: Support @-wildcard in user-mention autocomplete #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/icons/ZulipIcons.ttf
Binary file not shown.
8 changes: 8 additions & 0 deletions assets/icons/three_person.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion assets/l10n/app_ar.arb
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
{}
{
"wildcardMentionAll": "الجميع",
"wildcardMentionEveryone": "الكل",
"wildcardMentionChannel": "القناة",
"wildcardMentionStream": "الدفق",
"wildcardMentionTopic": "الموضوع",
"wildcardMentionChannelDescription": "إخطار القناة",
"wildcardMentionStreamDescription": "إخطار الدفق",
"wildcardMentionAllDmDescription": "إخطار المستلمين",
"wildcardMentionTopicDescription": "إخطار الموضوع"
}
36 changes: 36 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,42 @@
"@manyPeopleTyping": {
"description": "Text to display when there are multiple users typing."
},
"wildcardMentionAll": "all",
"@wildcardMentionAll": {
"description": "Text for \"@all\" wildcard-mention autocomplete option when writing a channel or DM message."
},
"wildcardMentionEveryone": "everyone",
"@wildcardMentionEveryone": {
"description": "Text for \"@everyone\" wildcard-mention autocomplete option when writing a channel or DM message."
},
"wildcardMentionChannel": "channel",
"@wildcardMentionChannel": {
"description": "Text for \"@channel\" wildcard-mention autocomplete option when writing a channel message."
},
"wildcardMentionStream": "stream",
"@wildcardMentionStream": {
"description": "Text for \"@stream\" wildcard-mention autocomplete option when writing a channel message in older servers."
},
"wildcardMentionTopic": "topic",
"@wildcardMentionTopic": {
"description": "Text for \"@topic\" wildcard-mention autocomplete option when writing a channel message."
},
"wildcardMentionChannelDescription": "Notify channel",
"@wildcardMentionChannelDescription": {
"description": "Description for \"@all\", \"@everyone\", \"@channel\", and \"@stream\" wildcard-mention autocomplete options when writing a channel message."
},
"wildcardMentionStreamDescription": "Notify stream",
"@wildcardMentionStreamDescription": {
"description": "Description for \"@all\", \"@everyone\", and \"@stream\" wildcard-mention autocomplete options when writing a channel message in older servers."
},
"wildcardMentionAllDmDescription": "Notify recipients",
"@wildcardMentionAllDmDescription": {
"description": "Description for \"@all\" and \"@everyone\" wildcard-mention autocomplete options when writing a DM message."
},
"wildcardMentionTopicDescription": "Notify topic",
"@wildcardMentionTopicDescription": {
"description": "Description for \"@topic\" wildcard-mention autocomplete options when writing a channel message."
},
"messageIsEditedLabel": "EDITED",
"@messageIsEditedLabel": {
"description": "Label for an edited message. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
Expand Down
22 changes: 22 additions & 0 deletions lib/api/model/initial_snapshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class InitialSnapshot {

final List<UserTopicItem>? userTopics; // TODO(server-6)

/// The policy for who can use wildcard mentions in large channels.
///
/// Search for "realm_wildcard_mention_policy" in https://zulip.com/api/register-queue.
final RealmWildcardMentionPolicy realmWildcardMentionPolicy;

final bool realmMandatoryTopics;

/// The number of days until a user's account is treated as a full member.
Expand Down Expand Up @@ -127,6 +132,7 @@ class InitialSnapshot {
required this.streams,
required this.userSettings,
required this.userTopics,
required this.realmWildcardMentionPolicy,
required this.realmMandatoryTopics,
required this.realmWaitingPeriodThreshold,
required this.realmDefaultExternalAccounts,
Expand All @@ -151,6 +157,22 @@ enum EmailAddressVisibility {
@JsonValue(5) moderators,
}

@JsonEnum(valueField: 'apiValue')
enum RealmWildcardMentionPolicy {
everyone(apiValue: 1),
members(apiValue: 2),
fullMembers(apiValue: 3),
admins(apiValue: 5),
nobody(apiValue: 6),
moderators(apiValue: 7);

const RealmWildcardMentionPolicy({required this.apiValue});

final int? apiValue;

int? toJson() => apiValue;
}

/// An item in `realm_default_external_accounts`.
///
/// For docs, search for "realm_default_external_accounts:"
Expand Down
13 changes: 13 additions & 0 deletions lib/api/model/initial_snapshot.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,60 @@ abstract class ZulipLocalizations {
/// **'Several people are typing…'**
String get manyPeopleTyping;

/// Text for "@all" wildcard-mention autocomplete option when writing a channel or DM message.
///
/// In en, this message translates to:
/// **'all'**
String get wildcardMentionAll;

/// Text for "@everyone" wildcard-mention autocomplete option when writing a channel or DM message.
///
/// In en, this message translates to:
/// **'everyone'**
String get wildcardMentionEveryone;

/// Text for "@channel" wildcard-mention autocomplete option when writing a channel message.
///
/// In en, this message translates to:
/// **'channel'**
String get wildcardMentionChannel;

/// Text for "@stream" wildcard-mention autocomplete option when writing a channel message in older servers.
///
/// In en, this message translates to:
/// **'stream'**
String get wildcardMentionStream;

/// Text for "@topic" wildcard-mention autocomplete option when writing a channel message.
///
/// In en, this message translates to:
/// **'topic'**
String get wildcardMentionTopic;

/// Description for "@all", "@everyone", "@channel", and "@stream" wildcard-mention autocomplete options when writing a channel message.
///
/// In en, this message translates to:
/// **'Notify channel'**
String get wildcardMentionChannelDescription;

/// Description for "@all", "@everyone", and "@stream" wildcard-mention autocomplete options when writing a channel message in older servers.
///
/// In en, this message translates to:
/// **'Notify stream'**
String get wildcardMentionStreamDescription;

/// Description for "@all" and "@everyone" wildcard-mention autocomplete options when writing a DM message.
///
/// In en, this message translates to:
/// **'Notify recipients'**
String get wildcardMentionAllDmDescription;

/// Description for "@topic" wildcard-mention autocomplete options when writing a channel message.
///
/// In en, this message translates to:
/// **'Notify topic'**
String get wildcardMentionTopicDescription;

/// Label for an edited message. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)
///
/// In en, this message translates to:
Expand Down
27 changes: 27 additions & 0 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,33 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
@override
String get manyPeopleTyping => 'Several people are typing…';

@override
String get wildcardMentionAll => 'الجميع';

@override
String get wildcardMentionEveryone => 'الكل';

@override
String get wildcardMentionChannel => 'القناة';

@override
String get wildcardMentionStream => 'الدفق';

@override
String get wildcardMentionTopic => 'الموضوع';

@override
String get wildcardMentionChannelDescription => 'إخطار القناة';

@override
String get wildcardMentionStreamDescription => 'إخطار الدفق';

@override
String get wildcardMentionAllDmDescription => 'إخطار المستلمين';

@override
String get wildcardMentionTopicDescription => 'إخطار الموضوع';

@override
String get messageIsEditedLabel => 'EDITED';

Expand Down
27 changes: 27 additions & 0 deletions lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,33 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
@override
String get manyPeopleTyping => 'Several people are typing…';

@override
String get wildcardMentionAll => 'all';

@override
String get wildcardMentionEveryone => 'everyone';

@override
String get wildcardMentionChannel => 'channel';

@override
String get wildcardMentionStream => 'stream';

@override
String get wildcardMentionTopic => 'topic';

@override
String get wildcardMentionChannelDescription => 'Notify channel';

@override
String get wildcardMentionStreamDescription => 'Notify stream';

@override
String get wildcardMentionAllDmDescription => 'Notify recipients';

@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get messageIsEditedLabel => 'EDITED';

Expand Down
27 changes: 27 additions & 0 deletions lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,33 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
@override
String get manyPeopleTyping => 'Several people are typing…';

@override
String get wildcardMentionAll => 'all';

@override
String get wildcardMentionEveryone => 'everyone';

@override
String get wildcardMentionChannel => 'channel';

@override
String get wildcardMentionStream => 'stream';

@override
String get wildcardMentionTopic => 'topic';

@override
String get wildcardMentionChannelDescription => 'Notify channel';

@override
String get wildcardMentionStreamDescription => 'Notify stream';

@override
String get wildcardMentionAllDmDescription => 'Notify recipients';

@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get messageIsEditedLabel => 'EDITED';

Expand Down
27 changes: 27 additions & 0 deletions lib/generated/l10n/zulip_localizations_nb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,33 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
@override
String get manyPeopleTyping => 'Several people are typing…';

@override
String get wildcardMentionAll => 'all';

@override
String get wildcardMentionEveryone => 'everyone';

@override
String get wildcardMentionChannel => 'channel';

@override
String get wildcardMentionStream => 'stream';

@override
String get wildcardMentionTopic => 'topic';

@override
String get wildcardMentionChannelDescription => 'Notify channel';

@override
String get wildcardMentionStreamDescription => 'Notify stream';

@override
String get wildcardMentionAllDmDescription => 'Notify recipients';

@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get messageIsEditedLabel => 'EDITED';

Expand Down
27 changes: 27 additions & 0 deletions lib/generated/l10n/zulip_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,33 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
@override
String get manyPeopleTyping => 'Wielu ludzi coś pisze…';

@override
String get wildcardMentionAll => 'all';

@override
String get wildcardMentionEveryone => 'everyone';

@override
String get wildcardMentionChannel => 'channel';

@override
String get wildcardMentionStream => 'stream';

@override
String get wildcardMentionTopic => 'topic';

@override
String get wildcardMentionChannelDescription => 'Notify channel';

@override
String get wildcardMentionStreamDescription => 'Notify stream';

@override
String get wildcardMentionAllDmDescription => 'Notify recipients';

@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get messageIsEditedLabel => 'ZMIENIONO';

Expand Down
Loading
Loading