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: Don't let direct messages header scroll out of view.

Evy Kassirera432c3bd44e3
diff --git a/web/src/pm_list.ts b/web/src/pm_list.ts
index f8ce418cdb1..d9f3f9555ed 100644
--- a/web/src/pm_list.ts
+++ b/web/src/pm_list.ts
@@ -130,7 +130,10 @@ export function update_private_messages(): void {
!all_conversations_shown ||
// If there is no search term, always show the header.
!search_term;
- $("#direct-messages-section-header").toggleClass("hidden-by-filters", !is_header_visible);
+ $("#left_sidebar_scroll_container").toggleClass(
+ "direct-messages-hidden-by-filters",
+ !is_header_visible,
+ );
if (!is_dm_section_expanded) {
// In the collapsed state, we will still display the current
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index 5f4dc5bfc35..2537c3b2fbc 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -269,11 +269,15 @@
#direct-messages-section-header {
cursor: pointer;
white-space: nowrap;
- border-radius: 4px;
+ position: sticky;
+ top: 0;
+ z-index: 3;
+ background-color: var(--color-background);
/* Prevent hover styles set on other rows when zoomed in. */
&:not(.zoom-in):hover {
background-color: var(--color-background-hover-narrow-filter);
+ border-radius: 4px;
box-shadow: inset 0 0 0 1px var(--color-shadow-sidebar-row-hover);
.left-sidebar-title,
@@ -396,8 +400,9 @@
cursor: pointer;
background-color: var(--color-background);
position: sticky;
- top: 0;
- /* Must be more than .sidebar-topic-check and less than #left-sidebar-search */
+ top: var(--line-height-sidebar-row-prominent);
+ /* Must be more than .sidebar-topic-check and less than #left-sidebar-search
+ and #direct-messages-section-header */
z-index: 2;
color: var(--color-text-default);
/* There seems to be a bug where when the header returns to normal position after
@@ -2338,7 +2343,16 @@ li.topic-list-item {
display: none !important;
}
-#left-sidebar-navigation-area.hidden-by-filters,
-#direct-messages-section-header.hidden-by-filters {
+#left-sidebar-navigation-area.hidden-by-filters {
display: none;
}
+
+#left_sidebar_scroll_container.direct-messages-hidden-by-filters {
+ #direct-messages-section-header {
+ display: none;
+ }
+
+ .stream-list-subsection-header {
+ top: 0;
+ }
+}