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: Modal styling for more DM conversations.

Evy Kassirer161a43073300
diff --git a/docs/THIRDPARTY b/docs/THIRDPARTY
index 72eff7a3b11..d7dc4497940 100644
--- a/docs/THIRDPARTY
+++ b/docs/THIRDPARTY
@@ -63,6 +63,10 @@ Files: tools/check-thirdparty
Copyright: 2020 Kandra Labs, Inc.
License: GPL-2.0+
+Files: web/icons/arrow-left.svg
+Copyright: 2013-2023 Cole Bemis, Lucide Contributors 2025 (https://lucide.dev/icons/arrow-left)
+License: ISC License
+
Files: web/icons/arrow-left-circle.svg
Copyright: 2013-2017 Cole Bemis (https://feathericons.com)
License: Expat
diff --git a/web/icons/arrow-left.svg b/web/icons/arrow-left.svg
new file mode 100644
index 00000000000..ed0d1c8fd00
--- /dev/null
+++ b/web/icons/arrow-left.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path d="M 12,4 A 1,1 0 0 0 11.292969,4.2929687 L 4.2929687,11.292969 a 1.0001,1.0001 0 0 0 0,1.414062 l 7.0000003,7 a 1,1 0 0 0 1.414062,0 1,1 0 0 0 0,-1.414062 L 6.4140625,12 12.707031,5.7070312 a 1,1 0 0 0 0,-1.4140625 A 1,1 0 0 0 12,4 Z" />
+ <path d="m 5,11 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 14 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" />
+</svg>
diff --git a/web/src/click_handlers.ts b/web/src/click_handlers.ts
index 13b315b4e97..9ebd8bdcee6 100644
--- a/web/src/click_handlers.ts
+++ b/web/src/click_handlers.ts
@@ -988,7 +988,7 @@ export function initialize(): void {
topic_list.clear_topic_search,
);
- $("body").on("click", "#direct-messages-section-header.zoom-out", (e) => {
+ $("body").on("click", "#direct-messages-section-header", (e) => {
if ($(e.target).closest(".show-all-direct-messages").length === 1) {
// Let the browser handle the "direct message feed" widget.
return;
@@ -1018,7 +1018,7 @@ export function initialize(): void {
/* The DIRECT MESSAGES label's click behavior is complicated;
* only when zoomed in does it have a navigation effect, so we need
* this click handler rather than just a link. */
- $("body").on("click", "#direct-messages-section-header.zoom-in", (e) => {
+ $("body").on("click", "#direct-messages-modal-section-header", (e) => {
e.preventDefault();
e.stopPropagation();
@@ -1028,7 +1028,7 @@ export function initialize(): void {
$("body").on("click", ".direct-messages-search-section", (e) => {
// We don't want clicking on the filter to trigger the DM
// narrow defined on click for
- // `#direct-messages-section-header.zoom-in`.
+ // `#direct-messages-modal-section-header`.
e.stopPropagation();
});
diff --git a/web/src/left_sidebar_tooltips.ts b/web/src/left_sidebar_tooltips.ts
index eca36d2e3ad..ab4751a85bb 100644
--- a/web/src/left_sidebar_tooltips.ts
+++ b/web/src/left_sidebar_tooltips.ts
@@ -177,7 +177,9 @@ export function initialize(): void {
tippy.delegate("body", {
target: ".dm-tooltip-target",
onShow(instance) {
- if ($(".direct-messages-container").hasClass("zoom-in")) {
+ // Collapsing doesn't happen when the modal is shown.
+ const modal_hidden = $("#direct-messages-modal").hasClass("no-display");
+ if (!modal_hidden) {
return false;
}
diff --git a/web/src/pm_list.ts b/web/src/pm_list.ts
index 55d5d157c6c..af2870490a5 100644
--- a/web/src/pm_list.ts
+++ b/web/src/pm_list.ts
@@ -4,6 +4,7 @@ import * as z from "zod/mini";
import type {Filter} from "./filter.ts";
import {$t} from "./i18n.ts";
+import * as keydown_util from "./keydown_util.ts";
import {localstorage} from "./localstorage.ts";
import * as mouse_drag from "./mouse_drag.ts";
import * as pm_list_data from "./pm_list_data.ts";
@@ -47,8 +48,13 @@ function get_private_messages_section_header(): JQuery {
return $("#direct-messages-section-header");
}
+function get_private_messages_modal_section_header(): JQuery {
+ return $("#direct-messages-modal-section-header");
+}
+
export function set_count(count: number): void {
ui_util.update_unread_count_in_dom(get_private_messages_section_header(), count);
+ ui_util.update_unread_count_in_dom(get_private_messages_modal_section_header(), count);
}
export function close(): void {
@@ -83,8 +89,10 @@ export function _build_direct_messages_list(opts: {
return dom_ast;
}
-function set_dom_to(new_dom: vdom.Tag<PMNode>): void {
- const $container = scroll_util.get_content_element($("#direct-messages-list"));
+function set_dom_to(new_dom: vdom.Tag<PMNode>, for_modal: boolean): void {
+ const $container = for_modal
+ ? scroll_util.get_content_element($("#modal-direct-messages-list"))
+ : scroll_util.get_content_element($("#direct-messages-list"));
function replace_content(html: string): void {
$container.html(html);
@@ -155,7 +163,7 @@ export function update_private_messages(): void {
if (active_conversation) {
const node = [pm_list_dom.keyed_pm_li(active_conversation)];
const new_dom = pm_list_dom.pm_ul(node);
- set_dom_to(new_dom);
+ set_dom_to(new_dom, zoomed);
} else {
// Otherwise, empty the section.
$(".dm-list").empty();
@@ -167,7 +175,7 @@ export function update_private_messages(): void {
conversations_to_be_shown,
search_term,
});
- set_dom_to(new_dom);
+ set_dom_to(new_dom, zoomed);
}
// Make sure to update the left sidebar heights after updating
// direct messages.
@@ -253,11 +261,11 @@ export function update_dom_with_unread_counts(
}
function highlight_all_private_messages_view(): void {
- $(".direct-messages-container").addClass("active-direct-messages-section");
+ $(".direct-messages-container.zoomed-out").addClass("active-direct-messages-section");
}
function unhighlight_all_private_messages_view(): void {
- $(".direct-messages-container").removeClass("active-direct-messages-section");
+ $(".direct-messages-container.zoomed-out").removeClass("active-direct-messages-section");
}
function scroll_pm_into_view($target_li: JQuery): void {
@@ -285,7 +293,9 @@ export function handle_narrow_activated(filter: Filter): void {
// top, but empirically that doesn't occur, so we just ensure the
// section is expanded before scrolling.
expand();
- highlight_all_private_messages_view();
+ if (!zoomed) {
+ highlight_all_private_messages_view();
+ }
scroll_all_private_into_view();
} else {
unhighlight_all_private_messages_view();
@@ -331,9 +341,9 @@ function zoom_in(): void {
pre_search_scroll_position = 0;
ui_util.disable_left_sidebar_search();
update_private_messages();
- $(".direct-messages-container").removeClass("zoom-out").addClass("zoom-in");
- $("#hide-more-direct-messages").addClass("dm-zoomed-in");
+ $("#left-sidebar").removeClass("zoom-out").addClass("zoom-in");
$("#streams_list").hide();
+ $("#direct-messages-modal").toggleClass("no-display", false);
const $filter = $(".direct-messages-list-filter").expectOne();
$filter.trigger("focus");
@@ -346,9 +356,9 @@ function zoom_out(): void {
zoomed = false;
ui_util.enable_left_sidebar_search();
clear_search();
- $(".direct-messages-container").removeClass("zoom-in").addClass("zoom-out");
- $("#hide-more-direct-messages").removeClass("dm-zoomed-in");
+ $("#left-sidebar").removeClass("zoom-in").addClass("zoom-out");
$("#streams_list").show();
+ $("#direct-messages-modal").toggleClass("no-display", true);
}
export function clear_search(): void {
@@ -381,13 +391,27 @@ export function initialize(): void {
}
});
- $("#left-sidebar").on("click", "#hide-more-direct-messages", (e) => {
+ $("#left-sidebar").on("click", ".left-sidebar-modal-close-area", (e) => {
+ if ($("#direct-messages-modal.no-display").length > 0) {
+ // This can happen when zooming out of a topics modal
+ return;
+ }
e.stopPropagation();
e.preventDefault();
zoom_out();
});
+ $("body").on("keydown", ".zoom-in-conversations .left-sidebar-modal-close-area", (e) => {
+ if (!keydown_util.is_enter_event(e)) {
+ return;
+ }
+
+ e.preventDefault();
+ e.stopPropagation();
+ zoom_out();
+ });
+
const throttled_update_private_message = _.throttle(() => {
const $filter = $<HTMLInputElement>(".direct-messages-list-filter").expectOne();
const search_term = $filter.val()!;
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index 49f5061595e..97834c5ab56 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -320,6 +320,13 @@
/* 5px / 16px em */
--left-sidebar-direct-messages-bottom-divider-padding: 0.3125em;
+ /* Left sidebar modal */
+ /* Close area height chosen by playing around with different heights and this one felt best. */
+ --left-sidebar-modal-close-area-height: 1.9em;
+ --left-sidebar-modal-close-area-padding-top: calc(
+ 1.9em + var(--header-padding-bottom)
+ );
+
/* We base sidebar row heights on their line heights.
Prominent rows include things like headers (e.g., VIEWS)
as well as navigation items. Everything else takes
@@ -858,6 +865,23 @@
hsl(0deg 0% 0% / 15%),
hsl(0deg 0% 100% / 15%)
);
+ --color-left-sidebar-inner-box-shadow: light-dark(
+ hsl(0deg 0% 0% / 20%),
+ hsl(0deg 0% 0% / 80%)
+ );
+ --color-left-sidebar-middle-box-shadow: var(--color-background);
+ --color-left-sidebar-outer-box-shadow: light-dark(
+ hsl(0deg 0% 94% / 20%),
+ hsl(0deg 0% 11% / 30%)
+ );
+ --color-left-sidebar-middle-box-shadow-hover: light-dark(
+ hsl(244deg 36% 91%),
+ hsl(240deg 19% 24%)
+ );
+ --color-left-sidebar-outer-box-shadow-hover: light-dark(
+ hsl(240deg 100% 50% / 7%),
+ hsl(240deg 100% 75% / 20%)
+ );
--color-unread-marker: hsl(217deg 64% 59%);
--color-masked-unread-marker: light-dark(
hsl(0deg 0% 80%),
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index ae75abfc835..c0d87bd788e 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -245,45 +245,35 @@
margin: 0;
}
-#hide-more-direct-messages,
-#direct-messages-section-header {
- grid-template-columns:
- 0 var(--left-sidebar-header-icon-toggle-width) 0 minmax(0, 1fr)
- minmax(0, max-content) minmax(0, max-content) var(
- --left-sidebar-vdots-width
- )
- 0;
-}
-
-#hide-more-direct-messages {
- /* Keep the DM zoom-out option hidden until zoomed-in. */
- display: none;
- margin-right: var(--left-sidebar-right-margin);
- line-height: var(--line-height-sidebar-row);
- border-radius: 4px;
- text-decoration: none;
- color: inherit;
+#left-sidebar-modal-content #direct-messages-modal {
+ display: grid;
+ grid-template:
+ "section-header" minmax(0, max-content)
+ "conversation-list" minmax(0, 1fr) / minmax(0, 1fr);
+ max-height: 100%;
- .hide-more-direct-messages-text {
- color: var(--color-text-sidebar-action-heading);
- font-size: var(--font-size-sidebar-action-heading);
- font-weight: var(--font-weight-sidebar-action-heading);
- font-variant: var(--font-variant-sidebar-action-heading);
- text-transform: var(--text-transform-sidebar-action-heading);
- grid-area: row-content;
+ #direct-messages-modal-section-header,
+ .dm-list {
+ margin-right: var(--left-sidebar-right-margin);
}
- &:hover {
- background-color: var(--color-background-sidebar-action-heading-hover);
- box-shadow: inset 0 0 0 1px var(--color-shadow-sidebar-row-hover);
+ .dm-list {
+ margin-bottom: var(--left-sidebar-bottom-scrolling-buffer);
}
- &:focus {
- outline: none;
+ &.no-display {
+ display: none;
}
}
+#direct-messages-modal-section-header,
#direct-messages-section-header {
+ grid-template-columns:
+ 0 var(--left-sidebar-header-icon-toggle-width) 0 minmax(0, 1fr)
+ minmax(0, max-content) minmax(0, max-content) var(
+ --left-sidebar-vdots-width
+ )
+ 0;
cursor: pointer;
white-space: nowrap;
position: sticky;
@@ -295,18 +285,6 @@
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,
- .sidebar-heading-icon {
- opacity: var(--opacity-sidebar-heading-hover);
- }
- }
-
#toggle-direct-messages-section-icon {
grid-area: starting-anchor-element;
/* Horizontally center the icon in its allotted grid area. */
@@ -333,7 +311,7 @@
.compose-new-direct-message,
.show-all-direct-messages {
color: var(--color-sidebar-action);
- display: none;
+ display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
@@ -345,6 +323,31 @@
color: var(--color-sidebar-action-hover);
background-color: var(--color-background-sidebar-action-hover);
}
+ }
+}
+
+#direct-messages-section-header {
+ grid-template-columns:
+ 0 var(--left-sidebar-header-icon-toggle-width) 0 minmax(0, 1fr)
+ minmax(0, max-content) minmax(0, max-content) var(
+ --left-sidebar-vdots-width
+ )
+ 0;
+
+ &: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,
+ .sidebar-heading-icon {
+ opacity: var(--opacity-sidebar-heading-hover);
+ }
+ }
+
+ .compose-new-direct-message,
+ .show-all-direct-messages {
+ display: none;
@media (hover: none) {
display: flex;
@@ -352,7 +355,6 @@
}
&.hover-over-dm-section,
- &.zoom-in,
&:hover {
.compose-new-direct-message,
.show-all-direct-messages {
@@ -361,6 +363,21 @@
}
}
+#direct-messages-modal-section-header {
+ display: grid;
+ align-items: center;
+ /* This is a simplified version of left sidebar rows, and includes a
+ second grid row for placing filter boxes. */
+ grid-template:
+ "starting-offset row-content controls markers-and-unreads ending-offset" var(
+ --line-height-sidebar-row-prominent
+ )
+ "filter-container filter-container filter-container filter-container filter-container"
+ minmax(0, max-content)
+ / 0.6em minmax(0, 1fr) minmax(0, max-content) minmax(0, max-content)
+ var(--left-sidebar-vdots-width);
+}
+
.spectator-view #left-sidebar-search {
grid-template-columns: minmax(0, 1fr);
}
@@ -630,11 +647,14 @@
}
}
-.direct-messages-container {
+.direct-messages-container.zoomed-out {
/* Properly offset all the grid rows
in the DM section. */
margin-right: var(--left-sidebar-right-margin);
+}
+.direct-messages-container,
+#left-sidebar-modal-content {
& ul.dm-list {
list-style-type: none;
font-weight: 400;
@@ -815,6 +835,7 @@
#views-label-container,
#direct-messages-section-header,
+#direct-messages-modal-section-header,
.stream-list-subsection-header,
.top_left_row,
.bottom_left_row {
@@ -829,8 +850,8 @@
.topic-list
.bottom_left_row:has(a.topic-box:focus-visible),
#direct-messages-list .dm-list .bottom_left_row:has(a.dm-box:focus-visible),
+#modal-direct-messages-list .bottom_left_row:has(a.dm-box:focus-visible),
#show-more-direct-messages:has(a.dm-name:focus-visible),
-#hide-more-direct-messages:focus-visible,
#topics_header .show-all-streams:focus-visible,
#subscribe-to-more-streams:has(.subscribe-more-link:focus-visible),
#login-to-more-streams:has(.subscribe-more-link:focus-visible) {
@@ -1083,6 +1104,7 @@ li.active-sub-filter {
.top_left_mentions,
#direct-messages-section-header,
+#direct-messages-modal-section-header,
.dm-list-item {
/* To highlight the background when a new unread arrives,
we set the background on the .new-unread class. */
@@ -1442,7 +1464,6 @@ li.active-sub-filter {
/* New grid definitions here. */
#views-label-container,
-#hide-more-direct-messages.dm-zoomed-in,
.top_left_row,
.left-sidebar-navigation-label-container,
.dm-box,
@@ -1559,20 +1580,6 @@ li.active-sub-filter {
}
}
- &.showing-expanded-navigation {
- /* When the expanded navigation is visible,
- hide the condensed navigation's controls. */
- #left-sidebar-navigation-list-condensed,
- .left-sidebar-navigation-menu-icon {
- display: none;
- }
- /* Give the sidebar title through the end of the markers
- area, if needed. */
- .left-sidebar-title {
- grid-column: row-content-start / markers-and-unreads-end;
- }
- }
-
/* Use a next-sibling combinator (+) to use CSS to show and hide
filter rows as needed, based on the narrow. */
&.showing-condensed-navigation {
@@ -1647,6 +1654,38 @@ li.active-sub-filter {
}
}
+.left-sidebar:not(.zoom-in) #views-label-container.showing-expanded-navigation {
+ /* When the expanded navigation is visible,
+ hide the condensed navigation's controls. */
+ #left-sidebar-navigation-list-condensed,
+ .left-sidebar-navigation-menu-icon {
+ display: none;
+ }
+ /* Give the sidebar title through the end of the markers
+ area, if needed. */
+ .left-sidebar-title {
+ grid-column: row-content-start / markers-and-unreads-end;
+ }
+}
+
+/* When we collapsed the views section because we're zoomed in, hide
+ the condensed navigation's controls (except the unread counter). */
+.left-sidebar.zoom-in #views-label-container {
+ grid-template-columns:
+ 0 var(--left-sidebar-header-icon-toggle-width)
+ 0 minmax(0, 1fr) 0 minmax(0, max-content) var(
+ --left-sidebar-vdots-width
+ )
+ 0;
+
+ .left-sidebar-navigation-condensed-item:not(
+ .top_left_condensed_unread_marker
+ ),
+ .left-sidebar-navigation-menu-icon {
+ display: none;
+ }
+}
+
.subscription_block {
user-select: text;
grid-template-columns:
@@ -2223,21 +2262,8 @@ li.topic-list-item {
}
}
-/* Since direct-messages-sticky-header also has the `input-append`
- class accompanying it. The display property of that class will
- overwrite display: none if we don't have a more specific CSS
- rule. It will also overwrite `display: none` even if `.zoom-out`
- properties are declared after the `.input-append` properties since
- the latter is more specific. */
-#direct-messages-sticky-header.zoom-out,
-.zoom-out {
- #topics_header {
- display: none;
- }
-
- .zoom-out-hide {
- display: none;
- }
+#streams_list.zoom-out #topics_header {
+ display: none;
}
#topics_header {
@@ -2353,25 +2379,10 @@ li.topic-list-item {
display: none;
}
- &.direct-messages-container ul.dm-list {
- margin-bottom: var(--left-sidebar-bottom-scrolling-buffer);
- }
-
- .direct-messages-search-section {
- grid-column: filter-container;
- margin: 5px 0;
- }
-
.zoom-in-hide,
#left-sidebar-search.zoom-in-hide {
display: none;
}
-
- .zoom-in-sticky {
- position: sticky;
- top: 0;
- z-index: 1;
- }
}
.top_left_row.hidden-by-filters {
@@ -2396,3 +2407,93 @@ li.topic-list-item {
top: 0;
}
}
+
+#left-sidebar.zoom-out #left-sidebar-modal {
+ /* Hidden instead of display: none so that we scroll to the
+ correct height more easily as it becomes visible again */
+ visibility: hidden;
+}
+
+#left-sidebar.zoom-in {
+ #left_sidebar_scroll_container {
+ /* Hidden instead of display: none so that we scroll to the
+ correct height more easily as it becomes visible again */
+ visibility: hidden;
+ }
+
+ #left-sidebar-search {
+ display: none;
+ }
+}
+
+#left-sidebar.zoom-in #left-sidebar-modal {
+ position: absolute;
+ left: 0;
+ top: var(--navbar-fixed-height);
+ width: var(--left-sidebar-width);
+ color: var(--color-left-sidebar-navigation-icon);
+
+ .left-sidebar-modal-close-area {
+ position: relative;
+ z-index: 1;
+ height: var(--left-sidebar-modal-close-area-height);
+ padding-top: var(--left-sidebar-modal-close-area-padding-top);
+ display: flex;
+ margin: 0 10px;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 0.9375em; /* 15px at 16px/em */
+ font-weight: 600;
+ letter-spacing: 0.75px;
+
+ &:hover {
+ cursor: pointer;
+ }
+
+ .left-sidebar-modal-back {
+ display: flex;
+ align-items: center;
+ }
+ }
+
+ #direct-messages-modal-section-header {
+ grid-area: section-header;
+ margin-top: 5px;
+ }
+
+ .modal-direct-messages-list {
+ grid-area: conversation-list;
+ }
+
+ #left-sidebar-modal-content {
+ padding: 0 0 5px 5px;
+ background: var(--color-background);
+ border-radius: 6px 6px 0 0;
+ height: calc(
+ 100dvh - var(--navbar-fixed-height) -
+ var(--left-sidebar-modal-close-area-padding-top) -
+ var(--left-sidebar-modal-close-area-height)
+ );
+ box-shadow:
+ 0 -0.2em 0.75em 0 var(--color-left-sidebar-inner-box-shadow),
+ 0 -2.5em 1em 0 var(--color-left-sidebar-middle-box-shadow),
+ 0 -4em 1em 0 var(--color-left-sidebar-outer-box-shadow);
+ }
+
+ .left-sidebar-modal-close-area:focus-visible {
+ outline: none;
+ }
+
+ .left-sidebar-modal-close-area:focus-visible + #left-sidebar-modal-content,
+ .left-sidebar-modal-close-area:hover + #left-sidebar-modal-content {
+ box-shadow:
+ 0 -0.2em 0.75em 0 var(--color-left-sidebar-inner-box-shadow),
+ 0 -2.5em 1em 0 var(--color-left-sidebar-middle-box-shadow-hover),
+ 0 -4em 1em 0 var(--color-left-sidebar-outer-box-shadow-hover);
+ }
+
+ .left-sidebar-filter-input-container {
+ display: block;
+ margin-bottom: 5px;
+ }
+}
diff --git a/web/templates/left_sidebar.hbs b/web/templates/left_sidebar.hbs
index 7a6820b6935..a0c82796035 100644
--- a/web/templates/left_sidebar.hbs
+++ b/web/templates/left_sidebar.hbs
@@ -1,4 +1,4 @@
-<div class="left-sidebar" id="left-sidebar" role="navigation">
+<div class="left-sidebar zoom-out" id="left-sidebar" role="navigation">
<div id="left-sidebar-search" class="zoom-in-hide">
<div class="input-wrapper-for-tooltip tippy-zulip-delayed-tooltip" data-tooltip-template-id="filter-left-sidebar-tooltip-template">
{{#> components/input_wrapper input_type="filter-input" custom_classes="left-sidebar-search-section" icon="search" input_button_icon="close"}}
@@ -36,14 +36,10 @@
{{> left_sidebar_expanded_view_items_list expanded_views=expanded_views}}
</ul>
</div>
-
- <a id="hide-more-direct-messages" class="trigger-click-on-enter" tabindex="0">
- <span class="hide-more-direct-messages-text"> {{t 'back to channels' }}</span>
- </a>
{{~!-- squash whitespace --~}}
<div id="left_sidebar_scroll_container" class="scrolling_list" data-simplebar data-simplebar-tab-index="-1">
- <div id="direct-messages-section-header" class="direct-messages-container zoom-out zoom-in-sticky">
- <i id="toggle-direct-messages-section-icon" class="zulip-icon zulip-icon-heading-triangle-right sidebar-heading-icon rotate-icon-down dm-tooltip-target zoom-in-hide" aria-hidden="true" tabindex="0" role="button"></i>
+ <div id="direct-messages-section-header" class="direct-messages-container zoomed-out">
+ <i id="toggle-direct-messages-section-icon" class="zulip-icon zulip-icon-heading-triangle-right sidebar-heading-icon rotate-icon-down dm-tooltip-target" aria-hidden="true" tabindex="0" role="button"></i>
<h4 class="left-sidebar-title"><span class="dm-tooltip-target">{{ LEFT_SIDEBAR_DIRECT_MESSAGES_TITLE }}</span></h4>
<div class="left-sidebar-controls">
<a class="show-all-direct-messages tippy-left-sidebar-tooltip-no-label-delay" href="#narrow/is/dm" data-tooltip-template-id="show-all-direct-messages-template">
@@ -56,13 +52,8 @@
<div class="heading-markers-and-unreads">
<span class="unread_count"></span>
</div>
- <div class="zoom-out-hide direct-messages-search-section left-sidebar-filter-input-container">
- {{#> components/input_wrapper input_type="filter-input" icon="search" input_button_icon="close"}}
- <input type="text" class="input-element direct-messages-list-filter" autocomplete="off" placeholder="{{t 'Filter direct messages' }}" />
- {{/components/input_wrapper}}
- </div>
</div>
- <div class="direct-messages-container zoom-out hidden-for-spectators">
+ <div class="direct-messages-container zoomed-out hidden-for-spectators">
<div id="direct-messages-list"></div>
</div>
<div class="direct-message-section-bottom-divider-container">
@@ -86,4 +77,38 @@
</div>
</div>
</div>
+ <div id="left-sidebar-modal">
+ <div class="left-sidebar-modal-close-area" tabindex="0">
+ <div class="left-sidebar-modal-back">
+ <i class="zulip-icon zulip-icon-arrow-left" aria-hidden="true"></i>
+ <span>Back</span>
+ </div>
+ <i class="zulip-icon zulip-icon-close"></i>
+ </div>
+ <div id="left-sidebar-modal-content">
+ <div id="direct-messages-modal">
+ <div id="direct-messages-modal-section-header" class="direct-messages-container">
+ <h4 class="left-sidebar-title"><span class="dm-tooltip-target">{{t "ALL DIRECT MESSAGES" }}</span></h4>
+ <div class="left-sidebar-controls">
+ <a class="show-all-direct-messages tippy-left-sidebar-tooltip-no-label-delay" href="#narrow/is/dm" data-tooltip-template-id="show-all-direct-messages-template">
+ <i class="zulip-icon zulip-icon-all-messages" aria-label="{{t 'Direct message feed' }}"></i>
+ </a>
+ <span class="compose-new-direct-message tippy-left-sidebar-tooltip-no-label-delay auto-hide-left-sidebar-overlay" data-tooltip-template-id="new_direct_message_button_tooltip_template">
+ <i class="left-sidebar-new-direct-message-icon zulip-icon zulip-icon-square-plus" aria-label="{{t 'New direct message' }}"></i>
+ </span>
+ </div>
+ <div class="heading-markers-and-unreads">
+ <span class="unread_count"></span>
+ </div>
+ <div class="direct-messages-search-section left-sidebar-filter-input-container">
+ {{#> components/input_wrapper input_type="filter-input" icon="search" input_button_icon="close"}}
+ <input type="text" class="input-element direct-messages-list-filter home-page-input" autocomplete="off" placeholder="{{t 'Filter direct messages' }}" />
+ {{/components/input_wrapper}}
+ </div>
+ </div>
+ <div id="modal-direct-messages-list" class="scrolling_list" data-simplebar data-simplebar-tab-index="-1"></div>
+ </div>
+ {{!-- TODO: Put "more topics modal here --}}
+ </div>
+ </div>
</div>
diff --git a/web/tests/pm_list.test.cjs b/web/tests/pm_list.test.cjs
index 149e1e1028b..dfa2b074878 100644
--- a/web/tests/pm_list.test.cjs
+++ b/web/tests/pm_list.test.cjs
@@ -15,6 +15,9 @@ run_test("update_dom_with_unread_counts", () => {
const $dm_li = $("#direct-messages-section-header");
$dm_li.set_find_results(".unread_count", $total_count);
+ const $dm_modal_header = $("#direct-messages-modal-section-header");
+ $dm_modal_header.set_find_results(".unread_count", $total_count);
+
counts = {
direct_message_count: 10,
};