Email accounts strip: nudge default-dot 1px left + shrink 10→8px

This commit is contained in:
pewdiepie-archdaemon
2026-06-11 09:49:03 +09:00
parent 6fc79e90ac
commit 070ec4c711
+5 -6
View File
@@ -1333,11 +1333,10 @@ function _renderAccountsStrip() {
// 'Default' rather than 'All (default)' — this view shows the account
// marked is_default; cross-account aggregation is a separate feature.
let html = `<button class="memory-toolbar-btn gallery-chip${allActive}" data-acc-id="">Default</button>`;
// Match the 6px sidebar notification dot's visual presence — render as
// a 10x10 SVG so the rendered glyph reads as a 'dot' next to the chip
// label rather than the previous thin 8px ring.
const _dotFilled = '<svg width="10" height="10" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="10"/></svg>';
const _dotHollow = '<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><circle cx="12" cy="12" r="9"/></svg>';
// Small default-account dot — slightly smaller than the previous 10px
// version so it doesn't dominate the chip's right edge.
const _dotFilled = '<svg width="8" height="8" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="10"/></svg>';
const _dotHollow = '<svg width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><circle cx="12" cy="12" r="9"/></svg>';
for (const a of state._libAccounts) {
const active = state._libAccountId === a.id ? ' active' : '';
const label = a.name || a.from_address || a.imap_user || 'account';
@@ -1345,7 +1344,7 @@ function _renderAccountsStrip() {
const dotTitle = a.is_default ? 'Default account' : 'Set as default';
html += `<span class="gallery-chip-wrap" style="position:relative;display:inline-flex;align-items:center;">`
+ `<button class="memory-toolbar-btn gallery-chip${active}" data-acc-id="${esc(a.id)}" title="${esc(a.from_address || a.imap_user || '')}${a.is_default ? ' (default)' : ''}" style="padding-right:24px;">${esc(label)}</button>`
+ `<button class="email-lib-default-dot${a.is_default ? ' is-default' : ''}" data-set-default="${esc(a.id)}" title="${dotTitle}" aria-label="${dotTitle}" style="position:absolute;right:6px;top:calc(50% - 2px);transform:translateY(-50%);background:none;border:0;padding:2px;cursor:pointer;color:${a.is_default ? 'var(--accent, var(--red))' : 'inherit'};opacity:${a.is_default ? '1' : '0.45'};display:inline-flex;align-items:center;line-height:0;">${dot}</button>`
+ `<button class="email-lib-default-dot${a.is_default ? ' is-default' : ''}" data-set-default="${esc(a.id)}" title="${dotTitle}" aria-label="${dotTitle}" style="position:absolute;right:7px;top:calc(50% - 2px);transform:translateY(-50%);background:none;border:0;padding:2px;cursor:pointer;color:${a.is_default ? 'var(--accent, var(--red))' : 'inherit'};opacity:${a.is_default ? '1' : '0.45'};display:inline-flex;align-items:center;line-height:0;">${dot}</button>`
+ `</span>`;
}
strip.innerHTML = html;