Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
user_settings: Add a setting to display names of users who reacted.
Raghav Luthra22a5d008c1ea
diff --git a/static/js/realm_user_settings_defaults.ts b/static/js/realm_user_settings_defaults.tsindex cd2a1104fde..dbaeab0753e 100644--- a/static/js/realm_user_settings_defaults.ts+++ b/static/js/realm_user_settings_defaults.ts@@ -32,6 +32,7 @@ export type RealmDefaultSettingsType = {realm_name_in_notifications: boolean;starred_message_counts: boolean;translate_emoticons: boolean;+ display_emoji_reaction_users: boolean;twenty_four_hour_time: boolean;wildcard_mentions_notify: boolean;};diff --git a/static/js/server_events_dispatch.js b/static/js/server_events_dispatch.jsindex 5f4a0a9d879..bbb316fca4c 100644--- a/static/js/server_events_dispatch.js+++ b/static/js/server_events_dispatch.js@@ -606,6 +606,7 @@ export function dispatch_normal_event(event) {"timezone","twenty_four_hour_time","translate_emoticons",+ "display_emoji_reaction_users","starred_message_counts","send_stream_typing_notifications","send_private_typing_notifications",@@ -686,6 +687,10 @@ export function dispatch_normal_event(event) {// Rerender buddy list status emojiactivity.build_user_sidebar();}++ if (event.property === "display_emoji_reaction_users") {+ message_live_update.rerender_messages_view();+ }if (event.property === "escape_navigates_to_default_view") {$("#go-to-default-view-hotkey-help").toggleClass("notdisplayed", !event.value);}diff --git a/static/js/settings_config.ts b/static/js/settings_config.tsindex 5406695afc4..98a2031c44e 100644--- a/static/js/settings_config.ts+++ b/static/js/settings_config.ts@@ -496,6 +496,12 @@ export const display_settings_labels = {defaultMessage: "Convert emoticons before sending (<code>:)</code> becomes 😃)",}),),+ display_emoji_reaction_users: new Handlebars.SafeString(+ $t_html({+ defaultMessage:+ "Display names of reacting users when few users have reacted to a message.",+ }),+ ),escape_navigates_to_default_view: $t({defaultMessage: "Escape key navigates to default view"}),};diff --git a/static/js/user_settings.ts b/static/js/user_settings.tsindex bb6bbff0fcb..31228c2dd50 100644--- a/static/js/user_settings.ts+++ b/static/js/user_settings.ts@@ -32,6 +32,7 @@ export type UserSettingsType = {realm_name_in_notifications: boolean;starred_message_counts: boolean;translate_emoticons: boolean;+ display_emoji_reaction_users: boolean;twenty_four_hour_time: boolean;wildcard_mentions_notify: boolean;send_stream_typing_notifications: boolean;diff --git a/static/templates/settings/display_settings.hbs b/static/templates/settings/display_settings.hbsindex be80c976278..13fcccbbb0d 100644--- a/static/templates/settings/display_settings.hbs+++ b/static/templates/settings/display_settings.hbs@@ -73,6 +73,13 @@label=settings_label.translate_emoticonsprefix=prefix}}+ {{#if page_params.development_environment }}+ {{> settings_checkbox+ setting_name="display_emoji_reaction_users"+ is_checked=settings_object.display_emoji_reaction_users+ label=settings_label.display_emoji_reaction_users+ prefix=prefix}}+ {{/if}}</div><div class="advanced-settings {{#if for_realm_settings}}org-subsection-parent{{else}}subsection-parent{{/if}}">diff --git a/templates/zerver/api/changelog.md b/templates/zerver/api/changelog.mdindex 2356c41e1f3..d68b58d138e 100644--- a/templates/zerver/api/changelog.md+++ b/templates/zerver/api/changelog.md@@ -20,6 +20,14 @@ format used by the Zulip server that they are interacting with.## Changes in Zulip 6.0+**Feature level 125**++* [`POST /register`](/api/register-queue), [`PATCH+ /settings`](/api/update-settings), [`PATCH+ /realm/user_settings_defaults`](/api/update-realm-user-settings-defaults):+ Added new `display_emoji_reaction_users` display setting,+ controlling whether to display the names of users with emoji reactions.+Feature levels 123-124 are reserved for future use in 5.x maintenancereleases.diff --git a/version.py b/version.pyindex 8d035cd474e..6eabf0aa7fc 100644--- a/version.py+++ b/version.py@@ -33,7 +33,7 @@ DESKTOP_WARNING_VERSION = "5.4.3"# Changes should be accompanied by documentation explaining what the# new level means in templates/zerver/api/changelog.md, as well as# "**Changes**" entries in the endpoint's documentation in `zulip.yaml`.-API_FEATURE_LEVEL = 122+API_FEATURE_LEVEL = 125# Bump the minor PROVISION_VERSION to indicate that folks should provision# only when going from an old version of the code to a newer version. Bumpdiff --git a/zerver/migrations/0389_userprofile_display_emoji_reaction_users.py b/zerver/migrations/0389_userprofile_display_emoji_reaction_users.pynew file mode 100644index 00000000000..adb36da249a--- /dev/null+++ b/zerver/migrations/0389_userprofile_display_emoji_reaction_users.py@@ -0,0 +1,23 @@+# Generated by Django 3.2.12 on 2022-04-16 13:45++from django.db import migrations, models+++class Migration(migrations.Migration):++ dependencies = [+ ("zerver", "0388_preregistrationuser_created_user"),+ ]++ operations = [+ migrations.AddField(+ model_name="realmuserdefault",+ name="display_emoji_reaction_users",+ field=models.BooleanField(default=True),+ ),+ migrations.AddField(+ model_name="userprofile",+ name="display_emoji_reaction_users",+ field=models.BooleanField(default=True),+ ),+ ]diff --git a/zerver/models.py b/zerver/models.pyindex add7e67f6a9..3d08ad3c782 100644--- a/zerver/models.py+++ b/zerver/models.py@@ -1467,6 +1467,7 @@ class UserBaseSettings(models.Model):fluid_layout_width: bool = models.BooleanField(default=False)high_contrast_mode: bool = models.BooleanField(default=False)translate_emoticons: bool = models.BooleanField(default=False)+ display_emoji_reaction_users: bool = models.BooleanField(default=True)twenty_four_hour_time: bool = models.BooleanField(default=False)starred_message_counts: bool = models.BooleanField(default=True)COLOR_SCHEME_AUTOMATIC = 1@@ -1603,6 +1604,7 @@ class UserBaseSettings(models.Model):**notification_setting_types,**dict(# Add new general settings here.+ display_emoji_reaction_users=bool,escape_navigates_to_default_view=bool,send_private_typing_notifications=bool,send_read_receipts=bool,diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yamlindex 9c0674792ca..38b45dc8316 100644--- a/zerver/openapi/zulip.yaml+++ b/zerver/openapi/zulip.yaml@@ -7962,6 +7962,20 @@ paths:schema:type: booleanexample: true+ - name: display_emoji_reaction_users+ in: query+ description: |+ Whether to display the names of reacting users on a message.++ When enabled, clients should display the names of reacting users, rather than+ a count, for messages with few total reactions. The ideal cutoff may depend on+ the space available for displaying reactions; the official web application+ displays names when <=3 total reactions are present with this setting enabled.++ **Changes**: New in Zulip 5.0 (feature level 125).+ schema:+ type: boolean+ example: false- name: default_viewin: querydescription: |@@ -9884,6 +9898,19 @@ paths:description: |Whether to [translate emoticons to emoji](/help/enable-emoticon-translations)in messages the user sends.+ display_emoji_reaction_users:+ type: boolean+ description: |+ Whether to display the names of reacting users on a message.++ When enabled, clients should display the names of reacting+ users, rather than a count, for messages with few total+ reactions. The ideal cutoff may depend on the space+ available for displaying reactions; the official web+ application displays names when <=3 total reactions are+ present with this setting enabled.++ **Changes**: New in Zulip 5.0 (feature level 125).default_language:type: stringdescription: |@@ -11648,6 +11675,19 @@ paths:description: |Whether to [translate emoticons to emoji](/help/enable-emoticon-translations)in messages the user sends.+ display_emoji_reaction_users:+ type: boolean+ description: |+ Whether to display the names of reacting users on a message.++ When enabled, clients should display the names of reacting+ users, rather than a count, for messages with few total+ reactions. The ideal cutoff may depend on the space+ available for displaying reactions; the official web+ application displays names when <=3 total reactions are+ present with this setting enabled.++ **Changes**: New in Zulip 5.0 (feature level 125).default_language:type: stringdescription: |@@ -12591,6 +12631,20 @@ paths:schema:type: booleanexample: true+ - name: display_emoji_reaction_users+ in: query+ description: |+ Whether to display the names of reacting users on a message.++ When enabled, clients should display the names of reacting users, rather than+ a count, for messages with few total reactions. The ideal cutoff may depend on+ the space available for displaying reactions; the official web application+ displays names when <=3 total reactions are present with this setting enabled.++ **Changes**: New in Zulip 5.0 (feature level 125).+ schema:+ type: boolean+ example: false- name: default_languagein: querydescription: |diff --git a/zerver/views/realm.py b/zerver/views/realm.pyindex c83fd6c8f52..6887e76edbf 100644--- a/zerver/views/realm.py+++ b/zerver/views/realm.py@@ -341,6 +341,7 @@ def update_realm_user_settings_defaults(json_validator=check_int_in(UserProfile.COLOR_SCHEME_CHOICES), default=None),translate_emoticons: Optional[bool] = REQ(json_validator=check_bool, default=None),+ display_emoji_reaction_users: Optional[bool] = REQ(json_validator=check_bool, default=None),default_view: Optional[str] = REQ(str_validator=check_string_in(default_view_options), default=None),diff --git a/zerver/views/user_settings.py b/zerver/views/user_settings.pyindex 0b92dca7e38..3de690b3358 100644--- a/zerver/views/user_settings.py+++ b/zerver/views/user_settings.py@@ -146,6 +146,7 @@ def json_change_settings(json_validator=check_int_in(UserProfile.COLOR_SCHEME_CHOICES), default=None),translate_emoticons: Optional[bool] = REQ(json_validator=check_bool, default=None),+ display_emoji_reaction_users: Optional[bool] = REQ(json_validator=check_bool, default=None),default_language: Optional[str] = REQ(default=None),default_view: Optional[str] = REQ(str_validator=check_string_in(default_view_options), default=None