message_view_header: Remove subscribers count from the top bar.

Removed the sub_count element along with its styles and dependent
functions.

Fixes #27361.
This commit is contained in:
aryan 2023-10-27 17:01:39 +05:30 committed by Tim Abbott
parent 1800b2c797
commit d707f10bb2
4 changed files with 5 additions and 78 deletions

View File

@ -10,14 +10,6 @@ import * as recent_view_util from "./recent_view_util";
import * as rendered_markdown from "./rendered_markdown";
import * as search from "./search";
function get_formatted_sub_count(sub_count) {
if (sub_count >= 1000) {
// parseInt() is used to floor the value of division to an integer
sub_count = Number.parseInt(sub_count / 1000, 10) + "k";
}
return sub_count;
}
function make_message_view_header(filter) {
const message_view_header = {};
if (recent_view_util.is_visible()) {
@ -56,7 +48,6 @@ function make_message_view_header(filter) {
message_view_header.rendered_narrow_description = current_stream.rendered_description;
const sub_count = peer_data.get_subscriber_count(current_stream.stream_id);
message_view_header.sub_count = sub_count;
message_view_header.formatted_sub_count = get_formatted_sub_count(sub_count);
// the "title" is passed as a variable and doesn't get translated (nor should it)
message_view_header.sub_count_tooltip_text = $t(
{defaultMessage: "This stream has {count} subscribers."},

View File

@ -612,13 +612,6 @@
border-color: hsl(0deg 0% 0% / 60%);
}
#message_view_header .sub_count {
&::before,
&::after {
color: hsl(0deg 0% 100% / 50%);
}
}
& div.overlay,
#subscription_overlay
#stream-creation

View File

@ -2285,7 +2285,6 @@ div.focused-message-list {
display: none;
}
.sub_count,
.message-header-stream-settings-button,
& > span {
white-space: nowrap;
@ -2332,8 +2331,6 @@ div.focused-message-list {
text-overflow: clip;
color: inherit;
text-decoration: none;
/* The first ~3px of padding here overlaps with the left padding from sub_count for some reason. */
padding-right: calc(3px + 10px);
/* Don't yield any space needed for the stream name. */
flex-shrink: 0;
@ -2344,61 +2341,6 @@ div.focused-message-list {
}
}
.divider {
color: hsl(0deg 0% 88%);
font-size: 20px;
margin: 0 3px;
}
.sub_count,
.narrow_description {
background: none;
font-size: 14px;
color: inherit;
font-weight: 400;
line-height: 20px;
}
.sub_count {
padding-left: 10px;
margin-left: 1px;
padding-right: 10px;
margin-right: 1px;
overflow: visible;
.fa.fa-user-o {
margin-left: 0;
}
&::before,
&::after {
content: "|";
position: absolute;
top: 25%;
height: 50%;
color: hsl(0deg 0% 88%);
font-size: 20px;
@media (width < $sm_min) {
top: 10%;
}
}
&::before {
left: -3px;
@media (width < $sm_min) {
/* this ensures the before "|" doesn't overlap
with the stream name text on small narrows */
left: 0;
}
}
&::after {
right: -3px;
}
}
.narrow_description {
/* the actual value of flex shrink does not matter, it is the
ratio of this value to other flex items that determines the
@ -2410,6 +2352,11 @@ div.focused-message-list {
white-space: nowrap;
padding: 12px 0;
padding-left: 10px;
background: none;
font-size: 14px;
color: inherit;
font-weight: 400;
line-height: 20px;
@media (width < $sm_min) {
padding: 7px 0;

View File

@ -2,10 +2,6 @@
<a class="message-header-stream-settings-button" href="{{stream_settings_link}}">
{{> navbar_icon_and_title }}
</a>
<div class="divider only-visible-for-spectators">|</div>
<a class="sub_count no-style tippy-zulip-tooltip hidden-for-spectators" data-tippy-content="{{sub_count_tooltip_text}}" data-tippy-placement="bottom" href="{{stream_settings_link}}">
<i class="fa fa-user-o"></i>{{formatted_sub_count}}
</a>
<span class="narrow_description rendered_markdown">
{{#if rendered_narrow_description}}
{{rendered_markdown rendered_narrow_description}}