Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
left_sidebar: Show home unread count in condensed views.
Karl Stolleyb27a9fdbf117
diff --git a/web/src/left_sidebar_navigation_area.ts b/web/src/left_sidebar_navigation_area.tsindex 04228316451..6ec1f2fb875 100644--- a/web/src/left_sidebar_navigation_area.ts+++ b/web/src/left_sidebar_navigation_area.ts@@ -96,10 +96,12 @@ export function update_dom_with_unread_counts(// mentioned/home views have simple integer countsconst $mentioned_li = $(".top_left_mentions");const $home_view_li = $(".selected-home-view");+ const $condensed_view_li = $(".top_left_condensed_unread_marker");const $back_to_streams = $("#topics_header");ui_util.update_unread_count_in_dom($mentioned_li, counts.mentioned_message_count);ui_util.update_unread_count_in_dom($home_view_li, counts.home_unread_messages);+ ui_util.update_unread_count_in_dom($condensed_view_li, counts.home_unread_messages);ui_util.update_unread_count_in_dom($back_to_streams, counts.stream_unread_messages);const pinned_unread_counts: SectionUnreadCount = {diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.cssindex f438d82924c..e7daef14130 100644--- a/web/styles/left_sidebar.css+++ b/web/styles/left_sidebar.css@@ -949,42 +949,63 @@ li.active-sub-filter {/* Set a positioning context for the unread dot. */position: relative;- .unread_count {- position: absolute;- }+ &:not(.top_left_condensed_unread_marker) {+ .unread_count {+ position: absolute;+ }- /* Show the same styles when each item is- hovered or, via the keyboard, the `<a>`- element within receives focus. */- &:hover,- &:focus-within {- background: var(--color-background-navigation-item-hover);+ /* Show the same styles when each item is+ hovered or, via the keyboard, the `<a>`+ element within receives focus. */+ &:hover,+ &:focus-within {+ background: var(--color-background-navigation-item-hover);++ .unread_count {+ /* 6px at 12px/1em */+ top: -0.5em;+ right: -0.5em;+ background: var(--color-background-unread-counter-no-alpha);+ }+ }- .unread_count {- /* 6px at 12px/1em */- top: -0.5em;- right: -0.5em;- background: var(--color-background-unread-counter-no-alpha);+ &:not(:hover) .unread_count {+ /* .unread_count has its based font-size set to 12px at 14px/em. */+ /* 2px, 6px at 12px/1em */+ top: 0.1667em;+ right: 0.1667em;+ width: 0.5em;+ height: 0.5em;+ padding: 0;+ color: transparent;+ background-color: var(--color-background-unread-counter-dot);}}- &:not(:hover) .unread_count {- /* .unread_count has its based font-size set to 12px at 14px/em. */- /* 2px, 6px at 12px/1em */- top: 0.1667em;- right: 0.1667em;- width: 0.5em;- height: 0.5em;- padding: 0;- color: transparent;- background-color: var(--color-background-unread-counter-dot);+ &.top_left_starred_messages .unread_count {+ display: none;}+ }- &.top_left_starred_messages .unread_count {+ &.hide-unread-messages-count {+ /* We suppress the entire unread area+ for users who prefer masked unreads. */+ .top_left_condensed_unread_marker {display: none;}}+ .top_left_condensed_unread_marker {+ display: flex;+ align-content: center;++ .unread_count {+ flex: 0 0 auto;+ margin: 0 var(--left-sidebar-unread-offset);+ align-self: center;+ }+ }+.left-sidebar-navigation-icon-container {/* Unset margin from full nav list anchor elements. */margin: 0;diff --git a/web/templates/left_sidebar.hbs b/web/templates/left_sidebar.hbsindex e1cd9757c98..5148436031f 100644--- a/web/templates/left_sidebar.hbs+++ b/web/templates/left_sidebar.hbs@@ -8,6 +8,9 @@{{#each primary_condensed_views}}{{> left_sidebar_primary_condensed_view_item . }}{{/each}}+ <li class="top_left_condensed_unread_marker left-sidebar-navigation-condensed-item">+ <span class="unread_count normal-count"></span>+ </li></ul><div class="left-sidebar-navigation-menu-icon"><i class="zulip-icon zulip-icon-more-vertical" aria-label="{{t 'Other views'}}"></i>