Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
left_sidebar: Fix some PMs not being displayed when PMs are zoomed in.
Aman Agrawal470553b457f3
diff --git a/frontend_tests/node_tests/recent_topics.js b/frontend_tests/node_tests/recent_topics.jsindex c04a649998a..5b490380bf7 100644--- a/frontend_tests/node_tests/recent_topics.js+++ b/frontend_tests/node_tests/recent_topics.js@@ -107,6 +107,10 @@ const narrow = mock_esm("../../static/js/narrow", {handle_middle_pane_transition: noop,has_shown_message_list_view: true,});+mock_esm("../../static/js/pm_list", {+ update_private_messages: noop,+ handle_narrow_deactivated: noop,+});mock_esm("../../static/js/popovers", {any_active: () => false,});diff --git a/static/js/pm_list.js b/static/js/pm_list.jsindex 38ef458a2af..d99900ac474 100644--- a/static/js/pm_list.js+++ b/static/js/pm_list.js@@ -3,6 +3,7 @@ import _ from "lodash";import * as pm_list_data from "./pm_list_data";import * as pm_list_dom from "./pm_list_dom";+import * as resize from "./resize";import * as ui from "./ui";import * as ui_util from "./ui_util";import * as vdom from "./vdom";@@ -92,6 +93,8 @@ export function update_private_messages() {const new_dom = _build_private_messages_list();set_dom_to(new_dom);}+ // Make sure to update the left sidebar heights after updating PMs.+ setTimeout(resize.resize_stream_filters_container, 0);}export function expand() {diff --git a/static/js/resize.js b/static/js/resize.jsindex 29b11597c36..52dd3fa67eb 100644--- a/static/js/resize.js+++ b/static/js/resize.js@@ -55,7 +55,8 @@ function get_new_heights() {Number.parseInt($("#left-sidebar").css("marginTop"), 10) -Number.parseInt($(".narrows_panel").css("marginTop"), 10) -Number.parseInt($(".narrows_panel").css("marginBottom"), 10) -- $("#global_filters").safeOuterHeight(true);+ $("#global_filters").safeOuterHeight(true) -+ $("#private_messages_sticky_header").safeOuterHeight(true);// Don't let us crush the stream sidebar completely out of viewres.stream_filters_max_height = Math.max(80, res.stream_filters_max_height);@@ -100,7 +101,8 @@ function left_userlist_get_new_heights() {Number.parseInt($(".narrows_panel").css("marginBottom"), 10) -$("#global_filters").safeOuterHeight(true) -$("#userlist-header").safeOuterHeight(true) -- $("#user_search_section").safeOuterHeight(true);+ $("#user_search_section").safeOuterHeight(true) -+ $("#private_messages_sticky_header").safeOuterHeight(true);const blocks = [{diff --git a/static/styles/left_sidebar.css b/static/styles/left_sidebar.cssindex 3fbd91fc055..4dc33d31b8e 100644--- a/static/styles/left_sidebar.css+++ b/static/styles/left_sidebar.css@@ -10,6 +10,7 @@ $topic_indent: calc($far_left_gutter_size + $left_col_size + 4px);$topic_resolve_width: 13px;/* Space between section in the left sidebar. */$sections_vertical_gutter: 8px;+$bottom_scrolling_buffer: 25px;#left-sidebar {#user-list {@@ -320,7 +321,7 @@ li.show-more-topics {#subscribe-to-more-streams {text-decoration: none;margin: 5px auto 5.5px 10px;- margin-bottom: 25px;+ margin-bottom: $bottom_scrolling_buffer;i {min-width: 19px;@@ -705,6 +706,10 @@ li.topic-list-item {display: none;}+ &.private_messages_container ul.pm-list {+ margin-bottom: $bottom_scrolling_buffer;+ }+#more_private_messages_sidebar_title {display: inline;}diff --git a/static/templates/left_sidebar.hbs b/static/templates/left_sidebar.hbsindex 042695778f7..c753c72d830 100644--- a/static/templates/left_sidebar.hbs+++ b/static/templates/left_sidebar.hbs@@ -57,7 +57,7 @@</ul></div>- <div class="private_messages_container zoom-out hidden-for-spectators">+ <div id="private_messages_sticky_header" class="private_messages_container zoom-out hidden-for-spectators"><div id="private_messages_section"><div id="private_messages_section_header" class="zoom-out zoom-in-sticky"><span id="pm_tooltip_container">