From df908b4c11e5c0a138eee2ff1a9e2ab847b601cc Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Thu, 11 Jun 2026 12:50:47 +0900 Subject: [PATCH] Email reader: regroup More menu + reshuffle toolbar rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More menu reorganization: - Group 1: Open in new tab, Remind to reply - Group 2 (state): Mark as Unread/Read, Mark as Done/Not Done, Move to Archive, Save sender to contacts - Group 3 (destructive, unchanged): Move to Spam, Move to Trash, Delete Permanently - Renames: Done→'Mark as Done', Archive→'Move to Archive', Mark Read/Unread→'Mark as Read'/'Mark as Unread'. - Mark Unread moves out of group 1 down into the state-change group alongside Done; Save sender to contacts moves down into the same state group. Toolbar row reshuffle (applies to both the email-list card reader and the email document view): - Row 1 (primary): Reply, Reply all, Forward, Search, More — Forward no longer has to fight Search/More for space in the secondary row. - Row 2 (secondary): AI reply, Summary — gets its own dedicated row. --- static/js/emailLibrary.js | 82 +++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/static/js/emailLibrary.js b/static/js/emailLibrary.js index 0c6352d15..f29f798dd 100644 --- a/static/js/emailLibrary.js +++ b/static/js/emailLibrary.js @@ -2428,15 +2428,15 @@ async function _toggleCardPreview(card, em) { ${_hasMultipleRecipients(data) ? `` : ''} - -
- -
+
+ + +
${attsHtml} @@ -4278,15 +4278,15 @@ async function _openEmailWindow(em, folder) { ${_hasMultipleRecipients(data) ? `` : ''} - -
- -
+
+ + +
${attsHtml} @@ -4657,7 +4657,13 @@ function _showReaderMoreMenu(em, card, reader, anchor) { }, }, { - label: em.is_read ? 'Mark Unread' : 'Mark Read', + label: 'Remind to reply', + icon: _bellIcon, + submenu: 'remind', + }, + { separator: true }, + { + label: em.is_read ? 'Mark as Unread' : 'Mark as Read', icon: _unreadIcon, action: async () => { const newRead = !em.is_read; @@ -4673,11 +4679,33 @@ function _showReaderMoreMenu(em, card, reader, anchor) { }, }, { - label: 'Remind to reply', - icon: _bellIcon, - submenu: 'remind', + label: em.is_answered ? 'Mark as Not Done' : 'Mark as Done', + icon: _checkIcon, + action: async () => { + const newState = !em.is_answered; + em.is_answered = newState; + if (newState) _syncEmailReadState(em.uid, true); + try { + if (newState) { + await fetch(`${API_BASE}/api/email/mark-answered/${em.uid}?folder=${encodeURIComponent(state._libFolder)}${_acct()}`, { method: 'POST' }); + await fetch(`${API_BASE}/api/email/mark-read/${em.uid}?folder=${encodeURIComponent(state._libFolder)}${_acct()}`, { method: 'POST' }); + } else { + await fetch(`${API_BASE}/api/email/clear-answered/${em.uid}?folder=${encodeURIComponent(state._libFolder)}${_acct()}`, { method: 'POST' }); + } + } catch (e) { console.error('Failed to toggle done:', e); } + _renderGrid(); + }, + }, + { + label: 'Move to Archive', + icon: _archIcon, + action: async () => { + try { + await fetch(`${API_BASE}/api/email/archive/${em.uid}?folder=${encodeURIComponent(state._libFolder)}${_acct()}`, { method: 'POST' }); + } catch (e) { console.error(e); } + await closeAndRemove(); + }, }, - { separator: true }, { // Save the sender to CardDAV contacts. Pulls name + address off the // list-item (em); falls back to splitting the local-part for a name. @@ -4708,34 +4736,6 @@ function _showReaderMoreMenu(em, card, reader, anchor) { } }, }, - { - label: em.is_answered ? 'Not Done' : 'Done', - icon: _checkIcon, - action: async () => { - const newState = !em.is_answered; - em.is_answered = newState; - if (newState) _syncEmailReadState(em.uid, true); - try { - if (newState) { - await fetch(`${API_BASE}/api/email/mark-answered/${em.uid}?folder=${encodeURIComponent(state._libFolder)}${_acct()}`, { method: 'POST' }); - await fetch(`${API_BASE}/api/email/mark-read/${em.uid}?folder=${encodeURIComponent(state._libFolder)}${_acct()}`, { method: 'POST' }); - } else { - await fetch(`${API_BASE}/api/email/clear-answered/${em.uid}?folder=${encodeURIComponent(state._libFolder)}${_acct()}`, { method: 'POST' }); - } - } catch (e) { console.error('Failed to toggle done:', e); } - _renderGrid(); - }, - }, - { - label: 'Archive', - icon: _archIcon, - action: async () => { - try { - await fetch(`${API_BASE}/api/email/archive/${em.uid}?folder=${encodeURIComponent(state._libFolder)}${_acct()}`, { method: 'POST' }); - } catch (e) { console.error(e); } - await closeAndRemove(); - }, - }, { separator: true }, { label: 'Move to Spam',