From 7017127a111dad236dc14633c6e8cb5536b3082f Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Thu, 11 Jun 2026 07:33:04 +0900 Subject: [PATCH] Email card: drop redundant header kebab; keep bottom '...' menu in expanded state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The expanded email card painted a kebab menu in its title row because the per-card .memory-item-actions menu at the bottom was hidden while expanded. Both pointed at _showCardMenu(em). Remove the duplicate: - Drop the email-card-header-menu button (and its rightCluster wrapper) — title row now just holds the nav arrows. - Remove the CSS rule that hid .memory-item-actions on .email-card-expanded so the bottom kebab stays visible. - Unread-dot insert point retargets to .email-card-nav-arrows now that the rightCluster is gone. --- static/js/emailLibrary.js | 29 ++++++----------------------- static/style.css | 7 ++++--- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/static/js/emailLibrary.js b/static/js/emailLibrary.js index 2e337d1f8..2e3f844f7 100644 --- a/static/js/emailLibrary.js +++ b/static/js/emailLibrary.js @@ -235,9 +235,9 @@ function _syncEmailReadState(uid, isRead = true) { dot.className = 'email-card-unread-dot'; dot.style.cssText = `width:6px;height:6px;border-radius:50%;background:${_senderColor(senderName)};flex-shrink:0;margin-left:2px;`; const done = titleRow.querySelector('.email-card-done'); - const rightCluster = titleRow.querySelector('.email-card-header-menu')?.parentElement; + const navArrows = titleRow.querySelector('.email-card-nav-arrows'); if (done) done.insertAdjacentElement('afterend', dot); - else if (rightCluster) titleRow.insertBefore(dot, rightCluster); + else if (navArrows) titleRow.insertBefore(dot, navArrows); else titleRow.appendChild(dot); }); } @@ -2083,27 +2083,10 @@ function _createCard(em) { await _toggleCardPreview(sibling, nextEm); sibling.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }); - // Right cluster: expanded-only actions menu + nav arrows. The normal - // `.memory-item-actions` menu is hidden while expanded, so this keeps - // the same email actions available beside the previous/next controls. - const rightCluster = document.createElement('span'); - rightCluster.style.cssText = 'margin-left:auto;display:inline-flex;align-items:center;gap:6px;'; - const headerMenuBtn = document.createElement('button'); - headerMenuBtn.type = 'button'; - headerMenuBtn.className = 'email-card-header-menu'; - headerMenuBtn.title = 'Actions'; - headerMenuBtn.innerHTML = ''; - headerMenuBtn.addEventListener('click', (e) => { - e.stopPropagation(); - _showCardMenu(em, headerMenuBtn); - }); - // The CSS rule on .email-card-nav-arrows still sets margin-left:auto - // (needed when the arrows live alone in the title row). Inside this - // wrapper, we want the cluster's gap to apply, so cancel that auto. - navArrows.style.marginLeft = '0'; - rightCluster.appendChild(headerMenuBtn); - rightCluster.appendChild(navArrows); - titleRow.appendChild(rightCluster); + // Just the nav arrows here — the per-card `.memory-item-actions` menu + // at the bottom of the card stays visible while expanded (see the CSS + // override below), so duplicating it in the header was redundant. + titleRow.appendChild(navArrows); content.appendChild(titleRow); diff --git a/static/style.css b/static/style.css index f5c079192..3a9af7f64 100644 --- a/static/style.css +++ b/static/style.css @@ -27759,9 +27759,10 @@ button .spinner-whirlpool { flex: 0 0 auto !important; width: 100%; } -.doclib-card.email-card-expanded .memory-item-actions { - display: none !important; -} +/* Keep the per-card '...' actions menu visible while the email card is + expanded — we used to hide it and surface a duplicate menu button in + the expanded header, but that was redundant. The bottom menu now + carries the actions in both states. */ /* When expanded inline, show the subject a touch larger than the 12px card title (close to the new-tab window header) without being oversized. */ .doclib-card.email-card-expanded .memory-item-title {