Email card: drop redundant header kebab; keep bottom '...' menu in expanded state

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.
This commit is contained in:
pewdiepie-archdaemon
2026-06-11 07:33:04 +09:00
parent 00643b5a4b
commit 7017127a11
2 changed files with 10 additions and 26 deletions
+6 -23
View File
@@ -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 = '<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/></svg>';
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);