diff --git a/web/src/left_sidebar_navigation_area.ts b/web/src/left_sidebar_navigation_area.ts index 0422831645..6ec1f2fb87 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 counts const $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.css index f438d82924..e7daef1413 100644 --- a/web/styles/left_sidebar.css +++ b/web/styles/left_sidebar.css @@ -949,35 +949,37 @@ li.active-sub-filter { /* Set a positioning context for the unread dot. */ position: relative; - .unread_count { - position: absolute; - } - - /* Show the same styles when each item is - hovered or, via the keyboard, the `` - element within receives focus. */ - &:hover, - &:focus-within { - background: var(--color-background-navigation-item-hover); - + &:not(.top_left_condensed_unread_marker) { .unread_count { - /* 6px at 12px/1em */ - top: -0.5em; - right: -0.5em; - background: var(--color-background-unread-counter-no-alpha); + position: absolute; } - } - &: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); + /* Show the same styles when each item is + hovered or, via the keyboard, the `` + 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); + } + } + + &: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 { @@ -985,6 +987,25 @@ li.active-sub-filter { } } + &.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.hbs index e1cd9757c9..5148436031 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}} +