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: Remove #streams_header and related code.

Evy Kassirer9478525f158b
diff --git a/web/e2e-tests/message-basics.test.ts b/web/e2e-tests/message-basics.test.ts
index 5243be438cf..2987cc1c4d5 100644
--- a/web/e2e-tests/message-basics.test.ts
+++ b/web/e2e-tests/message-basics.test.ts
@@ -313,18 +313,12 @@ async function test_search_venice(page: Page): Promise<void> {
await page.waitForSelector(await get_stream_li(page, "Denmark"), {visible: true});
await page.waitForSelector(await get_stream_li(page, "Venice"), {visible: true});
await page.waitForSelector(await get_stream_li(page, "Verona"), {visible: true});
-
- await page.click("#streams_header .left-sidebar-title");
- await page.waitForSelector(".stream_search_section.notdisplayed");
}
async function test_stream_search_filters_stream_list(page: Page): Promise<void> {
console.log("Filter streams using left side bar");
- await page.waitForSelector(".stream_search_section.notdisplayed"); // Stream filter box invisible initially
- await page.click("#streams_header .left-sidebar-title");
-
- await page.waitForSelector("#streams_list .stream_search_section.notdisplayed", {hidden: true});
+ await page.waitForSelector(".stream_search_section");
// assert streams exist by waiting till they're visible
await page.waitForSelector(await get_stream_li(page, "Denmark"), {visible: true});
@@ -386,7 +380,6 @@ async function test_stream_search_filters_stream_list(page: Page): Promise<void>
await test_search_venice(page);
// Search for beginning of "Verona".
- await page.click("#streams_header .left-sidebar-title");
await page.type(".stream-list-filter", "ver");
await page.waitForSelector(await get_stream_li(page, "core team"), {hidden: true});
await page.waitForSelector(await get_stream_li(page, "Denmark"), {hidden: true});
diff --git a/web/src/add_stream_options_popover.ts b/web/src/add_stream_options_popover.ts
index f634baa5832..2d4efcb333e 100644
--- a/web/src/add_stream_options_popover.ts
+++ b/web/src/add_stream_options_popover.ts
@@ -31,8 +31,6 @@ export function initialize(): void {
instance.setContent(parse_html(render_left_sidebar_stream_setting_popover()));
popover_menus.on_show_prep(instance);
- $("#streams_header").addClass("showing-streams-popover");
-
// When showing the popover menu, we want the
// "Add channels" and the "Filter channels" tooltip
// to appear below the "Add channels" icon.
@@ -49,8 +47,6 @@ export function initialize(): void {
instance.destroy();
popover_menus.popover_instances.stream_settings = null;
- $("#streams_header").removeClass("showing-streams-popover");
-
// After the popover menu is closed, we want the
// "Add channels" and the "Filter channels" tooltip
// to appear at it's original position that is
diff --git a/web/src/left_sidebar_navigation_area.ts b/web/src/left_sidebar_navigation_area.ts
index 25e2509a799..4460ee53661 100644
--- a/web/src/left_sidebar_navigation_area.ts
+++ b/web/src/left_sidebar_navigation_area.ts
@@ -80,12 +80,10 @@ 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 $streams_header = $("#streams_header");
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($streams_header, counts.stream_unread_messages);
ui_util.update_unread_count_in_dom($back_to_streams, counts.stream_unread_messages);
if (!skip_animations) {
diff --git a/web/src/left_sidebar_tooltips.ts b/web/src/left_sidebar_tooltips.ts
index 4ef748f6bbd..0fc9de2008a 100644
--- a/web/src/left_sidebar_tooltips.ts
+++ b/web/src/left_sidebar_tooltips.ts
@@ -136,11 +136,6 @@ export function initialize(): void {
},
});
- tippy.delegate("body", {
- target: "#streams_header .streams-tooltip-target",
- appendTo: () => document.body,
- });
-
tippy.delegate("body", {
target: "#add_streams_tooltip",
onShow(instance) {
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index 671c0c9b71f..e890f1cb757 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -81,8 +81,7 @@
}
}
-#left-sidebar-navigation-list .selected-home-view,
-#streams_header {
+#left-sidebar-navigation-list .selected-home-view {
&.hide-unread-messages-count {
.masked_unread_count {
display: flex;
@@ -102,7 +101,6 @@
}
#left-sidebar-navigation-list .selected-home-view:hover,
-#streams_header:hover,
.selected-home-view.top-left-active-filter {
&.hide-unread-messages-count {
.masked_unread_count {
@@ -1107,7 +1105,6 @@ li.top_left_scheduled_messages {
}
#direct-messages-section-header,
-#streams_header,
#topics_header {
display: grid;
align-items: center;
@@ -1827,115 +1824,6 @@ li.topic-list-item {
}
}
-#streams_header {
- grid-template-columns:
- var(--left-sidebar-toggle-width-offset) 0 0 minmax(0, 1fr) minmax(
- 0,
- max-content
- )
- minmax(0, max-content) var(--left-sidebar-vdots-width)
- 0;
- cursor: pointer;
- margin: var(--left-sidebar-sections-vertical-gutter)
- var(--left-sidebar-right-margin) 3px 0;
- position: sticky;
- /* Keep sticky within SimpleBar context. The -0.25px
- offset ensures that no gap is present between the
- direct-messages-section-header and the streams-header */
- top: -0.25px;
- z-index: 2;
- background-color: var(--color-background);
-
- &.showing-stream-search-section {
- /* Open up the stream-search rows and maintain
- space with the streams list below. */
- padding-bottom: var(--left-sidebar-sections-vertical-gutter);
- row-gap: 3px;
-
- /* When the search section is showing, switch
- off the hover effects on the row. */
- &:hover {
- background-color: var(--color-background);
- box-shadow: unset;
- }
- }
-
- .left-sidebar-title {
- grid-area: row-content;
- }
-
- .heading-markers-and-unreads {
- grid-area: markers-and-unreads;
- height: 100%;
- display: flex;
- align-items: center;
- grid-gap: 5px;
- /* Extra margin for unreads. */
- margin-right: var(--left-sidebar-unread-offset);
-
- &:has(.unread_count:empty) {
- margin-right: 0;
- }
- }
-
- #add_streams_tooltip {
- grid-row: 1 / 1;
- margin: 2px 0;
- }
-
- #streams_inline_icon {
- display: none;
- align-items: center;
- justify-content: center;
- /* Ensure the clickable area grows to
- the height of the controls grid. */
- height: 100%;
-
- @media (hover: none) {
- display: flex;
- }
- }
-
- &:hover,
- &.showing-streams-popover {
- /* We only set the border radius on the hover/popover states,
- so as to prevent the background on highlighted channels
- from bleeding through. */
- border-radius: 4px;
- background-color: var(--color-background-opaque-hover-narrow-filter);
- 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);
- }
-
- #streams_inline_icon {
- display: flex;
- }
- }
-}
-
-/* Prepare an adjusted grid for the logged-out state,
- one that reassigns the vdots space to markers and
- controls. */
-.spectator-view #streams_header {
- grid-template-columns:
- var(--left-sidebar-toggle-width-offset) 0 0 minmax(0, 1fr) 0
- minmax(var(--left-sidebar-vdots-width), max-content) 0 0;
- margin-right: var(--left-sidebar-right-margin);
-
- /* With markers and controls now sized the same
- as the ordinary vdots area (but allowed to grow,
- care of `minmax(30px, max-content)`, should
- additional logged-out icons be added in the
- future), let's center the icon in that area,
- just like vdots would be. */
- .heading-markers-and-unreads {
- justify-content: center;
- }
-}
-
.zero_count {
visibility: hidden;
}
@@ -1971,7 +1859,6 @@ li.topic-list-item {
}
}
- #streams_header,
#subscribe-to-more-streams,
#login-to-more-streams,
.show-more-topics {
diff --git a/web/templates/left_sidebar.hbs b/web/templates/left_sidebar.hbs
index 8a5b33b774f..82333b70c1e 100644
--- a/web/templates/left_sidebar.hbs
+++ b/web/templates/left_sidebar.hbs
@@ -195,21 +195,6 @@
</div>
<div id="streams_list" class="zoom-out">
- {{!-- TODO: Future commits will hide #streams_header completely, but for smaller reviewable commits this commit just hides the header for now --}}
- <div id="streams_header" style="display: none;" class="showing-stream-search-section zoom-in-hide">
- <h4 class="left-sidebar-title"><span class="streams-tooltip-target">{{t 'CHANNELS' }}</span></h4>
- <div class="left-sidebar-controls">
- <span id="add_streams_tooltip" class="hidden-for-spectators">
- <i id="streams_inline_icon" class="zulip-icon zulip-icon-square-plus" aria-hidden="true" ></i>
- </span>
- </div>
- <div class="heading-markers-and-unreads">
- <span class="unread_count quiet-count"></span>
- <span class="masked_unread_count">
- <i class="zulip-icon zulip-icon-masked-unread"></i>
- </span>
- </div>
- </div>
{{#> input_wrapper input_type="filter-input" custom_classes="stream_search_section" icon="search" input_button_icon="close"}}
<input type="text" class="input-element stream-list-filter home-page-input" autocomplete="off" placeholder="{{t 'Filter channels' }}" />
{{/input_wrapper}}
diff --git a/web/tests/left_sidebar_navigation_area.test.cjs b/web/tests/left_sidebar_navigation_area.test.cjs
index cc7125fa184..939efa28ad0 100644
--- a/web/tests/left_sidebar_navigation_area.test.cjs
+++ b/web/tests/left_sidebar_navigation_area.test.cjs
@@ -121,8 +121,6 @@ run_test("update_count_in_dom", () => {
make_elem($(".top_left_reminders"), "<reminders-count>");
- make_elem($("#streams_header"), "<stream-count>");
-
make_elem($("#topics_header"), "<topics-count>");
left_sidebar_navigation_area.update_dom_with_unread_counts(counts, false);
@@ -135,7 +133,6 @@ run_test("update_count_in_dom", () => {
assert.equal($("<starred-count>").text(), "444");
assert.equal($("<scheduled-count>").text(), "555");
assert.equal($("<reminders-count>").text(), "888");
- assert.equal($("<stream-count>").text(), "666");
assert.equal($("<topics-count>").text(), "666");
counts.mentioned_message_count = 0;