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: Flatten renamed .sidebar-topic-name selector.

Karl Stolley50a7e3cf2c65
diff --git a/web/src/topic_list.ts b/web/src/topic_list.ts
index 53c83506be9..71392c18e2a 100644
--- a/web/src/topic_list.ts
+++ b/web/src/topic_list.ts
@@ -337,7 +337,7 @@ export function initialize({
}): void {
$("#stream_filters").on(
"click",
- ".sidebar-topic-check, .topic-name, .topic-markers-and-controls",
+ ".sidebar-topic-check, .sidebar-topic-name, .topic-markers-and-controls",
(e) => {
if (e.metaKey || e.ctrlKey || e.shiftKey) {
return;
diff --git a/web/src/topic_popover.js b/web/src/topic_popover.js
index 5d4833138a2..d3ca4215f91 100644
--- a/web/src/topic_popover.js
+++ b/web/src/topic_popover.js
@@ -41,7 +41,7 @@ export function initialize() {
.expectOne();
const $stream_li = $elt.closest(".narrow-filter").expectOne();
topic_name = $elt.closest("li").expectOne().attr("data-topic-name");
- url = $elt.closest("li").find(".topic-name").expectOne().prop("href");
+ url = $elt.closest("li").find(".sidebar-topic-name").expectOne().prop("href");
stream_id = stream_popover.elem_to_stream_id($stream_li);
}
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index b1a7961e2d3..b353ce9e032 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -924,33 +924,33 @@ li.top_left_scheduled_messages {
grid-template-columns:
25px $topic_resolve_width minmax(0, 1fr) minmax(0, max-content)
30px 0;
+}
- .topic-name {
- cursor: pointer;
- grid-area: row-content;
- padding: 1px $before_unread_count_padding 1px 0;
+.topic-box .zero_count {
+ display: none;
+}
- /* TODO: We should figure out how to remove this without changing the spacing */
- line-height: 1.1;
+.sidebar-topic-name {
+ cursor: pointer;
+ grid-area: row-content;
+ padding: 1px $before_unread_count_padding 1px 0;
- /* TODO: Consolidate these styles with conversation partners and stream name
- once grid rewrite is complete on all sidebar rows.
+ /* TODO: We should figure out how to remove this without changing the spacing */
+ line-height: 1.1;
- Also: note that these styles will be moot for topic names once we allow
- for multiline topics. If we hold multiline topics to a certain number
- of lines, we'll likely need a JavaScript-based solution like Clamp.js
- to display an ellipsis on the final visible line. */
- white-space: nowrap;
- /* Both `hidden` and `clip` are shown for the sake
- of older browsers that do not support `clip`. */
- overflow-x: hidden;
- overflow-x: clip;
- text-overflow: ellipsis;
- }
-}
+ /* TODO: Consolidate these styles with conversation partners and stream name
+ once grid rewrite is complete on all sidebar rows.
-.topic-box .zero_count {
- display: none;
+ Also: note that these styles will be moot for topic names once we allow
+ for multiline topics. If we hold multiline topics to a certain number
+ of lines, we'll likely need a JavaScript-based solution like Clamp.js
+ to display an ellipsis on the final visible line. */
+ white-space: nowrap;
+ /* Both `hidden` and `clip` are shown for the sake
+ of older browsers that do not support `clip`. */
+ overflow-x: hidden;
+ overflow-x: clip;
+ text-overflow: ellipsis;
}
.sidebar-topic-check {
diff --git a/web/templates/more_topics.hbs b/web/templates/more_topics.hbs
index b639a466f9a..eca1e345814 100644
--- a/web/templates/more_topics.hbs
+++ b/web/templates/more_topics.hbs
@@ -2,7 +2,7 @@
{{#unless more_topics_unreads}}zero-topic-unreads{{/unless}}
{{#if more_topics_unread_count_muted}}more_topic_unreads_muted_only{{/if}}">
<div class="topic-box">
- <a class="topic-name" tabindex="0">{{t "more topics" }}</a>
+ <a class="sidebar-topic-name" tabindex="0">{{t "more topics" }}</a>
<div class="topic-markers-and-controls">
{{#if more_topics_have_unread_mention_messages}}
<span class="unread_mention_info">
diff --git a/web/templates/topic_list_item.hbs b/web/templates/topic_list_item.hbs
index 0bb93a6a22e..22cc2ed1c12 100644
--- a/web/templates/topic_list_item.hbs
+++ b/web/templates/topic_list_item.hbs
@@ -3,7 +3,7 @@
<span class="sidebar-topic-check">
{{topic_resolved_prefix}}
</span>
- <a href="{{url}}" class="topic-name" title="{{topic_name}}">
+ <a href="{{url}}" class="sidebar-topic-name" title="{{topic_name}}">
{{topic_display_name}}
</a>
<div class="topic-markers-and-controls">