From 6e6b860f0401e6928163d87f002e1c212393a24f Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Thu, 11 Jun 2026 19:19:12 +0900 Subject: [PATCH] Email reader: collapse To/Cc behind Gmail-style chevron MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the From row shows by default. When the email has To and/or Cc recipients, a small chevron sits next to the From chip — click it to inline-expand the To/Cc rows below (rotates 180deg open). Trims the header to a single visible row in the common case, leaving the action cluster plenty of vertical headroom to stay on a single row. --- static/js/emailLibrary.js | 41 ++++++++++++++++++++++++++++++--------- static/style.css | 28 ++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/static/js/emailLibrary.js b/static/js/emailLibrary.js index 31f052f05..4d616e1bb 100644 --- a/static/js/emailLibrary.js +++ b/static/js/emailLibrary.js @@ -129,6 +129,20 @@ async function _copyTextToClipboard(text) { } } +function _wireMetaToggle(root) { + const toggle = root && root.querySelector('.email-reader-meta-toggle'); + const details = root && root.querySelector('.email-reader-meta-details'); + if (!toggle || !details) return; + toggle.addEventListener('click', (ev) => { + ev.stopPropagation(); + const open = details.hasAttribute('hidden'); + if (open) details.removeAttribute('hidden'); + else details.setAttribute('hidden', ''); + toggle.setAttribute('aria-expanded', String(open)); + toggle.classList.toggle('open', open); + }); +} + function _recipientChipHtml(full, label, extraClass = '') { const fullText = String(full || '').trim(); const addr = _emailAddressFromRecipientText(fullText); @@ -2874,9 +2888,11 @@ async function _toggleCardPreview(card, em) { reader.innerHTML = `