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.

search_query: Prevent overflow of long search queries.

whilstsomebody9b0477d771f9
diff --git a/web/styles/zulip.css b/web/styles/zulip.css
index 19c01533f01..60d23369408 100644
--- a/web/styles/zulip.css
+++ b/web/styles/zulip.css
@@ -1329,6 +1329,10 @@ div.toggle_resolve_topic_spinner .loading_indicator_spinner {
.empty-feed-notice-description {
font-size: 1.1em;
+
+ .search-query-word {
+ word-wrap: break-word;
+ }
}
.message-fade,
diff --git a/web/templates/empty_feed_notice.hbs b/web/templates/empty_feed_notice.hbs
index bed147a4500..0c2b393eb9e 100644
--- a/web/templates/empty_feed_notice.hbs
+++ b/web/templates/empty_feed_notice.hbs
@@ -17,7 +17,7 @@
{{#if is_stop_word}}
<del>{{query_word}}</del>
{{else}}
- <span>{{query_word}}</span>
+ <span class="search-query-word">{{query_word}}</span>
{{/if}}
{{/each}}
{{else}}
diff --git a/web/tests/message_view.test.cjs b/web/tests/message_view.test.cjs
index 87337b57e03..b696dfb0128 100644
--- a/web/tests/message_view.test.cjs
+++ b/web/tests/message_view.test.cjs
@@ -136,7 +136,7 @@ run_test("empty_narrow_html", ({mock_template}) => {
Some common words were excluded from your search. <br/>You searched for:
<span>channel: new</span>
<span>topic: test</span>
- <span>search</span>
+ <span class="search-query-word">search</span>
<del>a</del>
</div>
</div>
@@ -160,7 +160,7 @@ run_test("empty_narrow_html", ({mock_template}) => {
<div class="empty-feed-notice-description">
You searched for:
<span>channel: hello world</span>
- <span>searchA</span>
+ <span class="search-query-word">searchA</span>
</div>
</div>
`,
@@ -183,7 +183,7 @@ run_test("empty_narrow_html", ({mock_template}) => {
<div class="empty-feed-notice-description">
You searched for:
<span>topic: hello</span>
- <span>searchB</span>
+ <span class="search-query-word">searchB</span>
</div>
</div>
`,
@@ -608,7 +608,10 @@ run_test("show_empty_narrow_message_with_search", ({mock_template, override}) =>
const current_filter = set_filter([["search", "grail"]]);
narrow_banner.show_empty_narrow_message(current_filter);
- assert.match($(".empty_feed_notice_main").html(), /<span>grail<\/span>/);
+ assert.match(
+ $(".empty_feed_notice_main").html(),
+ /<span class="search-query-word">grail<\/span>/,
+ );
});
run_test("hide_empty_narrow_message", () => {