From 10a25f5959f4f7580a286b603912644ca14aee8c Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Sat, 13 Jun 2026 07:58:24 +0900 Subject: [PATCH] =?UTF-8?q?Email=20library:=20Select=20button=20matches=20?= =?UTF-8?q?brain=20memories=20(dot=E2=86=94X=20swap)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Initial button: dot-in-circle SVG + "Select" label - After click (select-mode on): X SVG + "Cancel" label + .active class - Same SVG glyphs as memory.js so the two pages feel consistent. Hooked into the toolbar Select toggle AND the bulk-bar Cancel button so both reset the icon state. --- static/js/emailLibrary.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/static/js/emailLibrary.js b/static/js/emailLibrary.js index 4e12db5ee..4077fddfb 100644 --- a/static/js/emailLibrary.js +++ b/static/js/emailLibrary.js @@ -863,7 +863,7 @@ export function openEmailLibrary(opts = {}) { - + @@ -1233,10 +1233,20 @@ export function openEmailLibrary(opts = {}) { } } - // Select mode toggle + // Select mode toggle — icon + label swap matches the brain memories + // select button (dot+Select ↔ X+Cancel). + const _SELECT_BTN_DOT_SVG = ''; + const _SELECT_BTN_X_SVG = ''; + const _setSelectBtnState = (on) => { + const btn = document.getElementById('email-lib-select-btn'); + if (!btn) return; + if (on) { btn.classList.add('active'); btn.innerHTML = _SELECT_BTN_X_SVG + 'Cancel'; } + else { btn.classList.remove('active'); btn.innerHTML = _SELECT_BTN_DOT_SVG + 'Select'; } + }; document.getElementById('email-lib-select-btn').addEventListener('click', () => { state._selectMode = !state._selectMode; state._selectedUids.clear(); + _setSelectBtnState(state._selectMode); _updateBulkBar(); _renderGrid(); }); @@ -1256,6 +1266,7 @@ export function openEmailLibrary(opts = {}) { document.getElementById('email-lib-bulk-cancel')?.addEventListener('click', () => { state._selectMode = false; state._selectedUids.clear(); + _setSelectBtnState(false); _updateBulkBar(); _renderGrid(); });