mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 01:35:36 -04:00
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:
@@ -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);
|
||||
|
||||
|
||||
+4
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user