From 772ddf4a8610dc0f89fc98b1a3b3fe0bba19b407 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Thu, 11 Jun 2026 19:37:56 +0900 Subject: [PATCH] Email library: filter pills render as icon-only chips MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After picking a filter from the dropdown the pill was 'icon + Unread'. Drop the text — the icon is the affordance — so the pill collapses to just the glyph + ×. Hover surfaces the friendly label via the title attribute. Contact + text pills still carry their text label. --- static/js/emailLibrary.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/static/js/emailLibrary.js b/static/js/emailLibrary.js index a976516e1..8603f2b09 100644 --- a/static/js/emailLibrary.js +++ b/static/js/emailLibrary.js @@ -1868,16 +1868,18 @@ function _renderSearchPills() { const pills = state._libSearchPills || []; const esc = s => String(s || '').replace(/&/g, '&').replace(/ { - let label = ''; - let leadingIcon = ''; - if (p.type === 'contact') label = p.name || p.email || '?'; - else if (p.type === 'filter') { - label = p.label || p.value; - leadingIcon = `${_libFilterIconFor(p.value)}`; + // Filter pills render as icon-only (the icon is the affordance); + // contact + text pills carry their label as text. + if (p.type === 'filter') { + const titleAttr = `${(p.label || p.value).replace(/"/g, '"')}`; + return ` + ${_libFilterIconFor(p.value)} + + `; } - else label = p.text || ''; + const label = p.type === 'contact' ? (p.name || p.email || '?') : (p.text || ''); return ` - ${leadingIcon}${esc(label)} + ${esc(label)} `; }).join('');