Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
emoji: Display status emoji as flexboxes in pills.
Karl Stolleyb147440c4389
diff --git a/web/styles/input_pill.css b/web/styles/input_pill.cssindex 07a2f99491f..6f78500d836 100644--- a/web/styles/input_pill.css+++ b/web/styles/input_pill.css@@ -37,8 +37,18 @@border-radius: 4px 0 0 4px;}- .pill-value {+ .pill-label {+ /* Treat as flex container to better position status+ emoji and control ellipsis on the pill value. */+ display: flex;+ /* Allow label to collapse for ellipsis effect. */+ min-width: 0;+ align-items: center;margin: 0 5px;+ }++ .pill-value {+ flex: 0 1 auto;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;diff --git a/web/templates/input_pill.hbs b/web/templates/input_pill.hbsindex 894489faa91..53bc1520c4f 100644--- a/web/templates/input_pill.hbs+++ b/web/templates/input_pill.hbs@@ -2,9 +2,10 @@{{#if has_image}}<img class="pill-image" src="{{img_src}}" />{{/if}}- <span class="pill-value">{{ display_value }}+ <span class="pill-label">+ <span class="pill-value">{{ display_value }}</span>{{~#if has_status~}}- {{~> status_emoji status_emoji_info~}}+ {{~> status_emoji status_emoji_info~}}{{~/if~}}</span><div class="exit">diff --git a/web/tests/search.test.js b/web/tests/search.test.jsindex 88e2978f4f1..9cb8dc59545 100644--- a/web/tests/search.test.js+++ b/web/tests/search.test.js@@ -158,13 +158,13 @@ run_test("initialize", ({mock_template}) => {let expected_value = `<div class="search_list_item">\n <span>Search for zo</span>\n</div>\n`;assert.equal(opts.highlighter(source[0]), expected_value);- expected_value = `<div class="search_list_item">\n <span>sent by</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-value"><strong>Zo</strong>e</span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;+ expected_value = `<div class="search_list_item">\n <span>sent by</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-label">\n <span class="pill-value"><strong>Zo</strong>e</span></span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;assert.equal(opts.highlighter(source[1]), expected_value);- expected_value = `<div class="search_list_item">\n <span>direct messages with</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-value"><strong>Zo</strong>e</span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;+ expected_value = `<div class="search_list_item">\n <span>direct messages with</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-label">\n <span class="pill-value"><strong>Zo</strong>e</span></span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;assert.equal(opts.highlighter(source[2]), expected_value);- expected_value = `<div class="search_list_item">\n <span>group direct messages including</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-value"><strong>Zo</strong>e</span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;+ expected_value = `<div class="search_list_item">\n <span>group direct messages including</span>\n <span class="pill-container pill-container-btn">\n <div class='pill ' tabindex=0>\n <img class="pill-image" src="https://secure.gravatar.com/avatar/0f030c97ab51312c7bbffd3966198ced?d=identicon&version=1&s=50" />\n <span class="pill-label">\n <span class="pill-value"><strong>Zo</strong>e</span></span>\n <div class="exit">\n <span aria-hidden="true">×</span>\n </div>\n</div>\n </span>\n</div>\n`;assert.equal(opts.highlighter(source[3]), expected_value);/* Test sorter */