Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
left_sidebar: Refactor left_sidebar.hbs structures for readability.
Karl Stolleyfd0dd3acd84b
diff --git a/web/e2e-tests/stars.test.ts b/web/e2e-tests/stars.test.tsindex e7480e53ec3..724e8fae24d 100644--- a/web/e2e-tests/stars.test.ts+++ b/web/e2e-tests/stars.test.ts@@ -28,7 +28,7 @@ async function toggle_test_star_message(page: Page): Promise<void> {}async function test_narrow_to_starred_messages(page: Page): Promise<void> {- await page.click('#global_filters a[href^="#narrow/is/starred"]');+ await page.click('#left-sidebar-navigation-list a[href^="#narrow/is/starred"]');await common.check_messages_sent(page, "zfilt", [["Verona > stars", [message]]]);// Go back to all messages narrow.diff --git a/web/src/click_handlers.js b/web/src/click_handlers.jsindex 2c5d7c0cc43..d8ed8d86673 100644--- a/web/src/click_handlers.js+++ b/web/src/click_handlers.js@@ -627,7 +627,9 @@ export function initialize() {// MISC{- const sel = ["#stream_filters", "#global_filters", "#user_presences"].join(", ");+ const sel = ["#stream_filters", "#left-sidebar-navigation-list", "#user_presences"].join(+ ", ",+ );$(sel).on("click", "a", function () {this.blur();@@ -801,7 +803,7 @@ export function initialize() {// End Webathena code// disable the draggability for left-sidebar components- $("#stream_filters, #global_filters").on("dragstart", (e) => {+ $("#stream_filters, #left-sidebar-navigation-list").on("dragstart", (e) => {e.target.blur();return false;});diff --git a/web/src/list_util.ts b/web/src/list_util.tsindex 33971009553..8f0b4287374 100644--- a/web/src/list_util.ts+++ b/web/src/list_util.ts@@ -2,7 +2,7 @@ import $ from "jquery";const list_selectors = ["#stream_filters",- "#global_filters",+ "#left-sidebar-navigation-list","#user_presences","#send_later_options",];diff --git a/web/src/resize.js b/web/src/resize.jsindex 94a13392373..c6b3681ddc1 100644--- a/web/src/resize.js+++ b/web/src/resize.js@@ -18,9 +18,9 @@ function get_new_heights() {res.stream_filters_max_height =viewport_height -Number.parseInt($("#left-sidebar").css("paddingTop"), 10) -- Number.parseInt($(".narrows_panel").css("marginTop"), 10) -- Number.parseInt($(".narrows_panel").css("marginBottom"), 10) -- ($("#global_filters").outerHeight(true) ?? 0) -+ Number.parseInt($("#left-sidebar-navigation-area").css("marginTop"), 10) -+ Number.parseInt($("#left-sidebar-navigation-area").css("marginBottom"), 10) -+ ($("#left-sidebar-navigation-list").outerHeight(true) ?? 0) -($("#private_messages_sticky_header").outerHeight(true) ?? 0);// Don't let us crush the stream sidebar completely out of viewdiff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.cssindex 54192d5ec07..f41704b78f0 100644--- a/web/styles/left_sidebar.css+++ b/web/styles/left_sidebar.css@@ -54,13 +54,13 @@ $before_unread_count_padding: 3px;cursor: pointer;}-#global_filters .filter-icon i {+#left-sidebar-navigation-list .filter-icon i {padding-right: 3px;- color: var(--color-global-filter-icon);+ color: var(--color-left-sidebar-navigation-icon);}#stream_filters,-#global_filters {+#left-sidebar-navigation-list {margin-right: 12px;}@@ -203,7 +203,7 @@ li.show-more-topics {}}-.narrows_panel {+.left-sidebar-navigation-area {& li a {margin-top: 1px;@@ -485,14 +485,14 @@ li.active-sub-filter {}}-#global_filters {+#left-sidebar-navigation-list {margin-bottom: $sections_vertical_gutter;- .global-filter-container {+ .left-sidebar-navigation-label-container {display: flex;padding-right: 20px;- .global-filter-name {+ .left-sidebar-navigation-label {overflow: hidden;text-overflow: ellipsis;white-space: nowrap;diff --git a/web/styles/zulip.css b/web/styles/zulip.cssindex a1b95ce6f61..e2bf43c8171 100644--- a/web/styles/zulip.css+++ b/web/styles/zulip.css@@ -212,7 +212,7 @@ body {--color-message-star-action: hsl(41deg 100% 47% / 100%);/* The gray on the filter icons is the same aswhat's set on ul.filters, but with 70% opacity. */- --color-global-filter-icon: hsl(0deg 0% 20% / 70%);+ --color-left-sidebar-navigation-icon: hsl(0deg 0% 20% / 70%);--color-vdots-hint: hsl(0deg 0% 0% / 30%);--color-vdots-visible: hsl(0deg 0% 0% / 53%);--color-vdots-hover: hsl(0deg 0% 0%);@@ -311,7 +311,7 @@ body {--color-icon-bot: hsl(180deg 5% 50% / 100%);--color-message-action-visible: hsl(217deg 41% 90% / 50%);--color-message-action-interactive: hsl(217deg 41% 90% / 100%);- --color-global-filter-icon: hsl(0deg 0% 100% / 56%);+ --color-left-sidebar-navigation-icon: hsl(0deg 0% 100% / 56%);--color-vdots-hint: hsl(0deg 0% 100% / 30%);--color-vdots-visible: hsl(236deg 33% 80%);--color-vdots-hover: hsl(0deg 0% 100%);@@ -3112,7 +3112,7 @@ select.invite-as {}}- .narrows_panel {+ .left-sidebar-navigation-area {margin-top: 10px;}}diff --git a/web/templates/left_sidebar.hbs b/web/templates/left_sidebar.hbsindex b19ec7e0620..7f5e224c902 100644--- a/web/templates/left_sidebar.hbs+++ b/web/templates/left_sidebar.hbs@@ -1,74 +1,74 @@<div class="left-sidebar" id="left-sidebar" role="navigation">- <div class="narrows_panel">- <ul id="global_filters" class="filters">+ <div id="left-sidebar-navigation-area" class="left-sidebar-navigation-area">+ <ul id="left-sidebar-navigation-list" class="left-sidebar-navigation-list filters"><li class="top_left_inbox top_left_row hidden-for-spectators">- <a href="#inbox" class="tippy-left-sidebar-tooltip global-filter-container" data-tooltip-template-id="inbox-tooltip-template">+ <a href="#inbox" class="tippy-left-sidebar-tooltip left-sidebar-navigation-label-container" data-tooltip-template-id="inbox-tooltip-template"><span class="filter-icon"><i class="zulip-icon zulip-icon-inbox" aria-hidden="true"></i></span>{{~!-- squash whitespace --~}}- <span class="global-filter-name">{{t 'Inbox' }}</span>+ <span class="left-sidebar-navigation-label">{{t 'Inbox' }}</span><span class="unread_count"></span></a><span class="arrow sidebar-menu-icon inbox-sidebar-menu-icon hidden-for-spectators"><i class="zulip-icon zulip-icon-more-vertical" aria-hidden="true"></i></span></li><li class="top_left_recent_view top_left_row">- <a href="#recent" class="tippy-left-sidebar-tooltip global-filter-container" data-tooltip-template-id="recent-conversations-tooltip-template">+ <a href="#recent" class="tippy-left-sidebar-tooltip left-sidebar-navigation-label-container" data-tooltip-template-id="recent-conversations-tooltip-template"><span class="filter-icon"><i class="fa fa-clock-o" aria-hidden="true"></i></span>{{~!-- squash whitespace --~}}- <span class="global-filter-name">{{t 'Recent conversations' }}</span>+ <span class="left-sidebar-navigation-label">{{t 'Recent conversations' }}</span></a></li><li class="top_left_all_messages top_left_row">- <a href="#all_messages" class="home-link tippy-left-sidebar-tooltip global-filter-container" data-tooltip-template-id="all-message-tooltip-template">+ <a href="#all_messages" class="home-link tippy-left-sidebar-tooltip left-sidebar-navigation-label-container" data-tooltip-template-id="all-message-tooltip-template"><span class="filter-icon"><i class="fa fa-align-left" aria-hidden="true"></i></span>{{~!-- squash whitespace --~}}- <span class="global-filter-name">{{t 'All messages' }}</span>+ <span class="left-sidebar-navigation-label">{{t 'All messages' }}</span></a></li><li class="top_left_mentions top_left_row hidden-for-spectators">- <a class="global-filter-container" href="#narrow/is/mentioned">+ <a class="left-sidebar-navigation-label-container" href="#narrow/is/mentioned"><span class="filter-icon"><i class="fa fa-at" aria-hidden="true"></i></span>{{~!-- squash whitespace --~}}- <span class="global-filter-name">{{t 'Mentions' }}</span>+ <span class="left-sidebar-navigation-label">{{t 'Mentions' }}</span><span class="unread_count"></span></a></li><li class="top_left_starred_messages top_left_row hidden-for-spectators">- <a class="global-filter-container" href="#narrow/is/starred">+ <a class="left-sidebar-navigation-label-container" href="#narrow/is/starred"><span class="filter-icon"><i class="fa fa-star" aria-hidden="true"></i></span>{{~!-- squash whitespace --~}}- <span class="global-filter-name">{{t 'Starred messages' }}</span>+ <span class="left-sidebar-navigation-label">{{t 'Starred messages' }}</span><span class="unread_count"></span></a><span class="arrow sidebar-menu-icon starred-messages-sidebar-menu-icon"><i class="zulip-icon zulip-icon-more-vertical" aria-hidden="true"></i></span></li><li class="top_left_drafts top_left_row hidden-for-spectators">- <a href="#drafts" class="tippy-left-sidebar-tooltip global-filter-container" data-tooltip-template-id="drafts-tooltip-template">+ <a href="#drafts" class="tippy-left-sidebar-tooltip left-sidebar-navigation-label-container" data-tooltip-template-id="drafts-tooltip-template"><span class="filter-icon"><i class="fa fa-pencil" aria-hidden="true"></i></span>{{~!-- squash whitespace --~}}- <span class="global-filter-name">{{t 'Drafts' }}</span>+ <span class="left-sidebar-navigation-label">{{t 'Drafts' }}</span><span class="unread_count"></span></a><span class="arrow sidebar-menu-icon drafts-sidebar-menu-icon"><i class="zulip-icon zulip-icon-more-vertical" aria-hidden="true"></i></span></li><li class="top_left_scheduled_messages top_left_row hidden-for-spectators">- <a class="global-filter-container" href="#scheduled">+ <a class="left-sidebar-navigation-label-container" href="#scheduled"><span class="filter-icon"><i class="fa fa-calendar" aria-hidden="true"></i></span>{{~!-- squash whitespace --~}}- <span class="global-filter-name">{{t 'Scheduled messages' }}</span>+ <span class="left-sidebar-navigation-label">{{t 'Scheduled messages' }}</span><span class="unread_count"></span></a></li>