diff --git a/web/src/inbox_ui.ts b/web/src/inbox_ui.ts index f66141a5bc..ed1e82ae28 100644 --- a/web/src/inbox_ui.ts +++ b/web/src/inbox_ui.ts @@ -436,6 +436,7 @@ function format_topic( is_topic: true, stream_id, topic_name: topic, + stream_name: stream_data.get_stream_name_from_id(stream_id), unread_count: topic_unread_count, conversation_key: get_topic_key(stream_id, topic), topic_url: hash_util.by_stream_topic_url(stream_id, topic), diff --git a/web/src/message_list_view.js b/web/src/message_list_view.js index b0b569177e..4666eb9cdb 100644 --- a/web/src/message_list_view.js +++ b/web/src/message_list_view.js @@ -292,6 +292,7 @@ function populate_group_from_message_container(group, message_container) { } else { group.stream_id = sub.stream_id; } + group.stream_name = stream_data.get_stream_name_from_id(sub.stream_id); group.is_subscribed = stream_data.is_subscribed(group.stream_id); group.topic_is_resolved = resolved_topic.is_resolved(group.topic); group.visibility_policy = user_topics.get_topic_visibility_policy( diff --git a/web/src/tippyjs.ts b/web/src/tippyjs.ts index 64ca4285b8..237038b5cc 100644 --- a/web/src/tippyjs.ts +++ b/web/src/tippyjs.ts @@ -11,6 +11,7 @@ import {$t} from "./i18n"; import * as people from "./people"; import * as popovers from "./popovers"; import * as settings_config from "./settings_config"; +import * as stream_data from "./stream_data"; import * as ui_util from "./ui_util"; import {user_settings} from "./user_settings"; @@ -83,11 +84,27 @@ export const topic_visibility_policy_tooltip_props = { appendTo: () => document.body, onShow(instance: tippy.Instance) { const $elem = $(instance.reference); - const current_visibility_policy_str = $elem.attr("data-tippy-content"); + let should_render_privacy_icon; + let current_visibility_policy_str; + if ($elem.hasClass("zulip-icon-inherit")) { + should_render_privacy_icon = true; + } else { + should_render_privacy_icon = false; + current_visibility_policy_str = $elem.attr("data-tippy-content"); + } + let current_stream_obj; + if (should_render_privacy_icon) { + current_stream_obj = stream_data.get_sub_by_id( + Number($elem.parent().attr("data-stream-id")), + ); + } + const tooltip_context = { + ...current_stream_obj, + current_visibility_policy_str, + should_render_privacy_icon, + }; instance.setContent( - ui_util.parse_html( - render_change_visibility_policy_button_tooltip({current_visibility_policy_str}), - ), + ui_util.parse_html(render_change_visibility_policy_button_tooltip(tooltip_context)), ); }, onHidden(instance: tippy.Instance) { diff --git a/web/styles/zulip.css b/web/styles/zulip.css index 15dbd11760..869609ad74 100644 --- a/web/styles/zulip.css +++ b/web/styles/zulip.css @@ -786,7 +786,25 @@ strong { } #change_visibility_policy_button_tooltip { - text-align: center; + text-align: left; + + .tooltip-privacy-icon { + position: relative; + display: inline-block; + } + + .tooltip-privacy-icon .zulip-icon-lock { + margin-top: -0.15em !important; + } + + .tooltip-privacy-icon i { + position: absolute; + top: 0.1667em; + } + + .tooltip-privacy-icon span { + margin-left: 1.25em; + } } .narrow-filter { diff --git a/web/templates/change_visibility_policy_button_tooltip.hbs b/web/templates/change_visibility_policy_button_tooltip.hbs index 64083ba10e..f273c03811 100644 --- a/web/templates/change_visibility_policy_button_tooltip.hbs +++ b/web/templates/change_visibility_policy_button_tooltip.hbs @@ -1,4 +1,15 @@
{{t 'Configure topic notifications' }} -
{{current_visibility_policy_str}}
+
+ + {{#if should_render_privacy_icon}} + {{#tr}} + Notifications are based on your configuration for . + {{#*inline "z-stream-name"}}{{> stream_privacy }}{{name}}{{/inline}} + {{/tr}} + {{else}} + {{current_visibility_policy_str}} + {{/if}} + +
diff --git a/web/templates/inbox_view/inbox_row.hbs b/web/templates/inbox_view/inbox_row.hbs index c093b64d69..6632530df9 100644 --- a/web/templates/inbox_view/inbox_row.hbs +++ b/web/templates/inbox_view/inbox_row.hbs @@ -59,8 +59,8 @@ {{else if (eq visibility_policy all_visibility_policies.INHERIT)}} - + {{/if}} {{/if}} diff --git a/web/templates/recent_view_row.hbs b/web/templates/recent_view_row.hbs index 854bbf99b8..41478b8860 100644 --- a/web/templates/recent_view_row.hbs +++ b/web/templates/recent_view_row.hbs @@ -71,8 +71,8 @@ {{else}} - + {{/if}} diff --git a/web/templates/recipient_row.hbs b/web/templates/recipient_row.hbs index 293deddda7..4f6e0e9b6d 100644 --- a/web/templates/recipient_row.hbs +++ b/web/templates/recipient_row.hbs @@ -70,8 +70,8 @@ {{else}} - + {{/if}} {{/if}}