Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

left_sidebar: Hide unreads in condensed VIEWS when home view is active.

Sayam Samala7e6d92ae7bd
diff --git a/web/src/left_sidebar_navigation_area_popovers.ts b/web/src/left_sidebar_navigation_area_popovers.ts
index 7f02e62a552..cc3d5ddf91f 100644
--- a/web/src/left_sidebar_navigation_area_popovers.ts
+++ b/web/src/left_sidebar_navigation_area_popovers.ts
@@ -308,12 +308,14 @@ export function initialize(): void {
const unread_count = unread.get_counts();
const unread_messages_present = unread_count.home_unread_messages > 0;
const show_unread_count = user_settings.web_left_sidebar_unreads_count_summary;
+ const is_home_view_active = window.location.hash === "#" + user_settings.web_home_view;
popovers.hide_all();
instance.setContent(
ui_util.parse_html(
render_left_sidebar_views_popover({
views: built_in_popover_condensed_views,
+ is_home_view_active,
unread_messages_present,
show_unread_count,
}),
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index c0d2c136a3a..7c4bd9af671 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -1469,6 +1469,13 @@ li.active-sub-filter {
}
}
+#left-sidebar-navigation-area:has(.selected-home-view.top-left-active-filter)
+ .top_left_condensed_unread_marker {
+ /* Hide the condensed unread marker when the home view is active,
+ since the home view row already shows the unread count. */
+ display: none;
+}
+
#views-label-container {
margin-right: var(--left-sidebar-right-margin);
grid-template-columns:
@@ -1527,18 +1534,6 @@ li.active-sub-filter {
height: var(--line-height-sidebar-row);
}
}
-
- /* When unread counts display in the condensed-view
- row for users who do not prefer to mask their unread
- counts, we suppress the count on the highlighted
- home-view row. */
- &:not(:has(.hide-unread-messages-count)) {
- + #left-sidebar-navigation-list {
- .selected-home-view .unread_count {
- display: none;
- }
- }
- }
}
/* Remove the cursor: pointer property of Views label for the spectators. */
diff --git a/web/templates/popovers/left_sidebar/left_sidebar_views_popover.hbs b/web/templates/popovers/left_sidebar/left_sidebar_views_popover.hbs
index fe492eea720..0cf39924070 100644
--- a/web/templates/popovers/left_sidebar/left_sidebar_views_popover.hbs
+++ b/web/templates/popovers/left_sidebar/left_sidebar_views_popover.hbs
@@ -3,6 +3,7 @@
{{#each views}}
{{> left_sidebar_view_popover_item .}}
{{/each}}
+ {{#unless is_home_view_active}}
<li role="separator" class="popover-menu-separator"></li>
{{#if unread_messages_present}}
<li role="none" class="link-item popover-menu-list-item">
@@ -23,5 +24,6 @@
{{/if}}
</a>
</li>
+ {{/unless}}
</ul>
</div>