Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
typeahead: Fix typeahead items wrapping to next line.
Aman Agrawalad4a1a316d2c
diff --git a/web/styles/typeahead.css b/web/styles/typeahead.cssindex 7c481517555..6c5195545fe 100644--- a/web/styles/typeahead.css+++ b/web/styles/typeahead.css@@ -57,14 +57,12 @@}.typeahead-text-container {+ display: flex;align-self: center;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;-- & > * {- margin-right: 3px;- }+ gap: 3px;}}}@@ -81,10 +79,9 @@.autocomplete_secondary {opacity: 0.8;font-size: 85%;-- & code {- display: inline-block;- }+ flex: 1 1 0;+ overflow: hidden;+ text-overflow: ellipsis;}.active .autocomplete_secondary {diff --git a/web/templates/typeahead_list_item.hbs b/web/templates/typeahead_list_item.hbsindex 234d55beb93..2a087831f50 100644--- a/web/templates/typeahead_list_item.hbs+++ b/web/templates/typeahead_list_item.hbs@@ -35,11 +35,11 @@{{> status_emoji status_emoji_info}}{{~/if}}{{~#if has_secondary_html}}- <small class="autocomplete_secondary rendered_markdown">{{{secondary_html}}}</small>+ <span class="autocomplete_secondary rendered_markdown single-line-rendered-markdown">{{rendered_markdown secondary_html}}</span>{{~else if has_secondary}}- <small class="autocomplete_secondary">+ <span class="autocomplete_secondary">{{~ secondary ~}}- </small>+ </span>{{~/if}}</div>{{#if is_unsubscribed}}diff --git a/web/tests/composebox_typeahead.test.js b/web/tests/composebox_typeahead.test.jsindex 3781a40962e..c1fa4f4fe0e 100644--- a/web/tests/composebox_typeahead.test.js+++ b/web/tests/composebox_typeahead.test.js@@ -1137,7 +1137,7 @@ test("initialize", ({override, override_rewire, mock_template}) => {` <span class="user_circle_empty user_circle"></span>\n` +` <img class="typeahead-image" src="http://zulip.zulipdev.com/avatar/${othello.user_id}?s=50" />\n` +'<div class="typeahead-text-container">\n' +- ' <strong class="typeahead-strong-section">Othello, the Moor of Venice</strong> <small class="autocomplete_secondary">[email protected]</small>' ++ ' <strong class="typeahead-strong-section">Othello, the Moor of Venice</strong> <span class="autocomplete_secondary">[email protected]</span>' +"</div>\n";assert.equal(actual_value, expected_value);// Reset the email such that this does not affect further tests.@@ -1149,7 +1149,7 @@ test("initialize", ({override, override_rewire, mock_template}) => {expected_value =' <i class="typeahead-image zulip-icon zulip-icon-triple-users no-presence-circle" aria-hidden="true"></i>\n' +'<div class="typeahead-text-container">\n' +- ' <strong class="typeahead-strong-section">hamletcharacters</strong> <small class="autocomplete_secondary">Characters of Hamlet</small>' ++ ' <strong class="typeahead-strong-section">hamletcharacters</strong> <span class="autocomplete_secondary">Characters of Hamlet</span>' +"</div>\n";assert.equal(actual_value, expected_value);