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: Fix zoomed-in topics modal styling for spectators.

Evy Kassirera2d4197461de
diff --git a/web/src/pm_list.ts b/web/src/pm_list.ts
index 8aba9fead2e..0cee0a3149e 100644
--- a/web/src/pm_list.ts
+++ b/web/src/pm_list.ts
@@ -146,10 +146,7 @@ export function update_private_messages(): void {
!all_conversations_shown ||
// If there is no search term, always show the header.
!search_term;
- $("#left_sidebar_scroll_container").toggleClass(
- "direct-messages-hidden-by-filters",
- !is_header_visible,
- );
+ $("#left-sidebar").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/src/sidebar_ui.ts b/web/src/sidebar_ui.ts
index da63bca017b..05e38ea00d6 100644
--- a/web/src/sidebar_ui.ts
+++ b/web/src/sidebar_ui.ts
@@ -475,7 +475,7 @@ function get_header_rows_selectors(): string {
// Views header.
"#left-sidebar-navigation-area:not(.hidden-by-filters) #views-label-container, " +
// DM Headers
- "#left_sidebar_scroll_container:not(.direct-messages-hidden-by-filters) #direct-messages-section-header, " +
+ "#left-sidebar:not(.direct-messages-hidden-by-filters) #direct-messages-section-header, " +
// All channel headers.
".stream-list-section-container:not(.no-display) .stream-list-subsection-header"
);
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index ca71515c10a..3667bb9045a 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -2322,7 +2322,7 @@ li.topic-list-item {
display: none;
}
-#left_sidebar_scroll_container.direct-messages-hidden-by-filters,
+#left-sidebar.direct-messages-hidden-by-filters,
.spectator-view {
#direct-messages-section-header {
display: none;
@@ -2362,7 +2362,9 @@ li.topic-list-item {
}
/* The two modals have different top paddings */
-#left-sidebar.zoom-in-conversations #left-sidebar-modal {
+#left-sidebar.zoom-in-conversations #left-sidebar-modal,
+#left-sidebar.direct-messages-hidden-by-filters #left-sidebar-modal,
+.spectator-view #left-sidebar-modal {
.left-sidebar-modal-close-area {
padding-top: var(--left-sidebar-modal-close-area-padding-top);
}
@@ -2388,9 +2390,11 @@ li.topic-list-item {
}
}
-/* The topic menu leaves space to see the DM section by padding the sidebar
- row height to the close section's upper padding. */
-#left-sidebar.zoom-in-topics #left-sidebar-modal {
+/* The topic menu leaves space to see the DM section (if it's visible) by
+ padding the sidebar row height to the close section's upper padding. */
+body:not(.spectator-view)
+ #left-sidebar:not(.direct-messages-hidden-by-filters).zoom-in-topics
+ #left-sidebar-modal {
.left-sidebar-modal-close-area {
padding-top: calc(
var(--left-sidebar-modal-close-area-padding-top) +
@@ -2420,22 +2424,6 @@ li.topic-list-item {
}
}
-/* For spectators, the topic menu has no DM section to leave space
- for, so the padding-top and content height set above are adjusted. */
-.spectator-view #left-sidebar.zoom-in-topics #left-sidebar-modal {
- .left-sidebar-modal-close-area {
- padding-top: var(--left-sidebar-modal-close-area-padding-top);
- }
-
- #left-sidebar-modal-content {
- height: calc(
- 100dvh - var(--navbar-fixed-height) -
- var(--left-sidebar-modal-close-area-padding-top) -
- var(--left-sidebar-modal-close-area-height)
- );
- }
-}
-
@container app (width <= $cq_ml_min) {
.left-sidebar-modal-close-area .zulip-icon-close {
margin-right: 5px;