Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
navbar: Purge tab_list label from code base.
YashRE42ae7ff04fe6f9
diff --git a/frontend_tests/node_tests/ui_init.js b/frontend_tests/node_tests/ui_init.jsindex af8e2021607..809b0d0d240 100644--- a/frontend_tests/node_tests/ui_init.js+++ b/frontend_tests/node_tests/ui_init.js@@ -186,7 +186,7 @@ const count_stub = $.create('count');count_stub.set_find_results('.value', value_stub);$(".top_left_starred_messages").set_find_results('.count', count_stub);-$("#tab_list .stream").length = 0;+$("#tab_bar .stream").length = 0;// set find results doesn't work here since we call .empty() in the code.$tab_bar.find = () => false;diff --git a/static/js/tab_bar.js b/static/js/tab_bar.jsindex df5c1db3d30..3665e1b5836 100644--- a/static/js/tab_bar.js+++ b/static/js/tab_bar.js@@ -50,7 +50,7 @@ function make_tab_data(filter) {exports.colorize_tab_bar = function () {const filter = narrow_state.filter();if (filter === undefined || !filter._sub) {return;}- $("#tab_list .stream > .fa").css('color', filter._sub.color);+ $("#tab_bar .stream > .fa").css('color', filter._sub.color);};function append_and_display_title_area(tab_bar_data) {@@ -76,7 +76,7 @@ function bind_title_area_handlers() {e.stopPropagation();});- $("#tab_list span:nth-last-child(2)").on("click", (e) => {+ $("#tab_bar span:nth-last-child(2)").on("click", (e) => {if (document.getSelection().type === "Range") {// Allow copy/paste to work normally without interference.return;@@ -175,14 +175,14 @@ exports.maybe_rerender_title_area_for_stream = function (modified_sub) {exports.open_search_bar_and_close_narrow_description = function () {exports.reset_searchbox_text();$(".navbar-search").addClass("expanded");- $("#tab_list").addClass("hidden");+ $("#tab_bar").addClass("hidden");};exports.close_search_bar_and_open_narrow_description = function () {const filter = narrow_state.filter();if (!(filter && !filter.is_common_narrow())) {$(".navbar-search").removeClass("expanded");- $("#tab_list").removeClass("hidden");+ $("#tab_bar").removeClass("hidden");}};diff --git a/static/styles/night_mode.scss b/static/styles/night_mode.scssindex 4f7e42e23fd..ad04220d19a 100644--- a/static/styles/night_mode.scss+++ b/static/styles/night_mode.scss@@ -252,22 +252,22 @@ on a dark background, and don't change the dark labels dark either. */border-color: hsla(0, 0%, 0%, 0.6);}- #tab_bar #tab_list .sub_count {+ #tab_bar .sub_count {&::before,&::after {color: hsla(0, 0%, 100%, 0.5);}}- #tab_bar #tab_list span:nth-last-child(2):hover + .search_closed {+ #tab_bar span:nth-last-child(2):hover + .search_closed {color: hsl(0, 0%, 100%);}- #tab_bar #tab_list .stream {+ #tab_bar .stream {color: hsl(236, 33%, 90%);}- #tab_bar #tab_list .sub_count,- #tab_bar #tab_list .narrow_description {+ #tab_bar .sub_count,+ #tab_bar .narrow_description {color: hsla(0, 0%, 90%, 1);}diff --git a/static/styles/zulip.scss b/static/styles/zulip.scssindex 74156282a82..33518e5bc56 100644--- a/static/styles/zulip.scss+++ b/static/styles/zulip.scss@@ -1456,172 +1456,169 @@ div.focused_table {}#tab_bar {- width: 100%;z-index: 2;float: left;- #tab_list {- display: flex;- align-content: flex-start;- flex-wrap: nowrap;- margin: 0px 0px 0px 0px;- height: $header_height;- line-height: $header_height;- font-size: 16px;- border: none;+ height: $header_height;+ width: 100%;+ line-height: $header_height;+ font-size: 16px;+ display: flex;+ align-content: flex-start;+ flex-wrap: nowrap;+ margin: 0px 0px 0px 0px;+ border: none;+ white-space: nowrap;+ cursor: default;+ .hidden {+ display: none;+ }+ .sub_count,+ .stream,+ & > span {white-space: nowrap;- width: calc(100% - 1px);- cursor: default;- .hidden {- display: none;- }- .sub_count,- .stream,- & > span {- white-space: nowrap;- list-style-type: none;- display: inline-block;- vertical-align: top;- position: relative;- font-weight: 600;- font-size: 16px;- line-height: 16px;- margin: 0 -4px 0 0;- padding: 12px 6px;+ list-style-type: none;+ display: inline-block;+ vertical-align: top;+ position: relative;+ font-weight: 600;+ font-size: 16px;+ line-height: 16px;+ margin: 0 -4px 0 0;+ padding: 12px 6px;- @media (max-width: 500px) {- padding: 7px 3.5px; // based on having ~41.66% decrease- }- i {- margin-right: 3px;+ @media (max-width: 500px) {+ padding: 7px 3.5px; // based on having ~41.66% decrease+ }+ i {+ margin-right: 3px;+ }+ .fa {+ margin: 0px 3px 0px 5px;+ .fa-envelope {+ font-size: 14px;+ margin: 0px 5px 0px 5px;}- .fa {- margin: 0px 3px 0px 5px;- .fa-envelope {- font-size: 14px;- margin: 0px 5px 0px 5px;- }- .fa-hashtag {- font-size: 1.2rem;- // font-weight: 800;- margin: 0px 2px 0px 5px;- }+ .fa-hashtag {+ font-size: 1.2rem;+ // font-weight: 800;+ margin: 0px 2px 0px 5px;}}+ }- .stream {- text-overflow: clip;- overflow: hidden;- color: inherit;- text-decoration: none;- // The first ~3px of padding here overlaps with the left padding from sub_count for some reason.- padding-right: calc(3px + 10px);- }+ .stream {+ text-overflow: clip;+ overflow: hidden;+ color: inherit;+ text-decoration: none;+ // The first ~3px of padding here overlaps with the left padding from sub_count for some reason.+ padding-right: calc(3px + 10px);+ }- .sub_count,- .narrow_description {- background: none;- font-size: 14px;- color: hsl(0, 0%, 40%);- font-weight: 400;- line-height: 20px;- }+ .sub_count,+ .narrow_description {+ background: none;+ font-size: 14px;+ color: hsl(0, 0%, 40%);+ font-weight: 400;+ line-height: 20px;+ }- .sub_count {- padding-left: 10px;- margin-left: 1px;- padding-right: 10px;- margin-right: 1px;- .fa.fa-user-o {- margin-left: 0px;- }+ .sub_count {+ padding-left: 10px;+ margin-left: 1px;+ padding-right: 10px;+ margin-right: 1px;+ .fa.fa-user-o {+ margin-left: 0px;+ }- &::before,- &::after {- content: "|";- position: absolute;- top: 25%;- height: 50%;- color: hsl(0, 0%, 88%);- font-size: 20px;- @media (max-width: 500px) {- top: 10%;- }+ &::before,+ &::after {+ content: "|";+ position: absolute;+ top: 25%;+ height: 50%;+ color: hsl(0, 0%, 88%);+ font-size: 20px;+ @media (max-width: 500px) {+ top: 10%;}+ }- &::before {- left: -3px;- @media (max-width: 500px) {- // this ensures the before "|" doesn't overlap- // with the stream name text on small narrows- left: 0px;- }+ &::before {+ left: -3px;+ @media (max-width: 500px) {+ // this ensures the before "|" doesn't overlap+ // with the stream name text on small narrows+ left: 0px;}+ }- &::after {- right: -3px;- }+ &::after {+ right: -3px;}+ }- .narrow_description {- // the actual value of flex shrink does not matter, it is the- // ratio of this value to other flex items that determines the- // behavior while shrinking, here the other item has the .stream- // class and a flex of 1, so the value here *is* the ratio, and- // is chosen such that the narrow description shrinks to close- // before the stream name must begin to shrink- flex-shrink: 100;- overflow: hidden;- white-space: nowrap;- margin: 0;- padding: 12px 0px;- padding-left: 10px;+ .narrow_description {+ // the actual value of flex shrink does not matter, it is the+ // ratio of this value to other flex items that determines the+ // behavior while shrinking, here the other item has the .stream+ // class and a flex of 1, so the value here *is* the ratio, and+ // is chosen such that the narrow description shrinks to close+ // before the stream name must begin to shrink+ flex-shrink: 100;+ overflow: hidden;+ white-space: nowrap;+ margin: 0;+ padding: 12px 0px;+ padding-left: 10px;- @media (max-width: 500px) {- padding: 7px 0;- padding-left: 10px;- }+ @media (max-width: 500px) {+ padding: 7px 0;+ padding-left: 10px;+ }- & > a {- padding: 12px 0px;- }+ & > a {+ padding: 12px 0px;}+ }- .search_closed {- flex: 0; // makes sure search icon is always visible+ .search_closed {+ flex: 0; // makes sure search icon is always visible- cursor: pointer;- font-size: 20px;+ cursor: pointer;+ font-size: 20px;- padding: 10px 15px 0px 0px;- @media (max-width: 500px) {- padding: 5px 15px 0px 0px;- }+ padding: 10px 15px 0px 0px;+ @media (max-width: 500px) {+ padding: 5px 15px 0px 0px;}+ }- > :not(.search_closed):not(.sub_count):not(.narrow_description) {- flex-shrink: 1;- overflow: hidden;- }+ > :not(.search_closed):not(.sub_count):not(.narrow_description) {+ flex-shrink: 1;+ overflow: hidden;+ }- > :not(.stream) {- text-overflow: ellipsis;- }+ > :not(.stream) {+ text-overflow: ellipsis;+ }- // The very last element in the navbar is the search icon, the second- // last element is either the narrow description (for stream narrows) or- // the "title" (for other narrows). The flex-grow property ensures these- // elements take up the entirety of the white space.- > :nth-last-child(2) {- flex-grow: 1;-- // We extend the clickable area for the search_closed icon over the- // 2nd last navbar element for better design (user convenience) this- // selector makes it so mousing over that element also gives the user- // a visual cue about the results of clicking the element- cursor: pointer;- &:hover + .search_closed {- color: hsl(0, 0%, 0%);- }+ // The very last element in the navbar is the search icon, the second+ // last element is either the narrow description (for stream narrows) or+ // the "title" (for other narrows). The flex-grow property ensures these+ // elements take up the entirety of the white space.+ > :nth-last-child(2) {+ flex-grow: 1;++ // We extend the clickable area for the search_closed icon over the+ // 2nd last navbar element for better design (user convenience) this+ // selector makes it so mousing over that element also gives the user+ // a visual cue about the results of clicking the element+ cursor: pointer;+ &:hover + .search_closed {+ color: hsl(0, 0%, 0%);}}}@@ -2715,8 +2712,6 @@ select.inline_select_topic_edit {#tab_bar,#searchbox,#searchbox_legacy,- #tab_list li,- #tab_list,.header {height: 30px;line-height: 30px;diff --git a/static/templates/tab_bar.hbs b/static/templates/tab_bar.hbsindex 19d940974f8..a4735d2aedb 100644--- a/static/templates/tab_bar.hbs+++ b/static/templates/tab_bar.hbs@@ -1,22 +1,20 @@-<span id="tab_list">- {{#if stream_settings_link}}- <a class="stream" href="{{stream_settings_link}}">- {{> navbar_icon_and_title }}- </a>- <a class="sub_count no-style" data-toggle="tooltip" title="{{sub_count_tooltip_text}}" href="{{stream_settings_link}}">- <i class="fa fa-user-o"></i>{{formatted_sub_count}}- </a>- <span class="narrow_description rendered_markdown" data-toggle="tooltip">- {{#if rendered_narrow_description}}- {{rendered_markdown rendered_narrow_description}}- {{else}}- {{t "(no description)"}}- {{/if}}- </span>+{{#if stream_settings_link}}+<a class="stream" href="{{stream_settings_link}}">+ {{> navbar_icon_and_title }}+</a>+<a class="sub_count no-style" data-toggle="tooltip" title="{{sub_count_tooltip_text}}" href="{{stream_settings_link}}">+ <i class="fa fa-user-o"></i>{{formatted_sub_count}}+</a>+<span class="narrow_description rendered_markdown" data-toggle="tooltip">+ {{#if rendered_narrow_description}}+ {{rendered_markdown rendered_narrow_description}}{{else}}- <span>- {{> navbar_icon_and_title }}- </span>+ {{t "(no description)"}}{{/if}}- <span class="search_icon search_closed" ><i class="fa fa-search" aria-hidden="true"></i></span></span>+{{else}}+<span>+ {{> navbar_icon_and_title }}+</span>+{{/if}}+<span class="search_icon search_closed" ><i class="fa fa-search" aria-hidden="true"></i></span>