From b11e3b50483ae254caccebe220275863eb762a47 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 26 Aug 2026 22:34:42 -0700 Subject: The Google button keeps its own counsel: no flickering narration beneath it — just a quiet spinner in place of the label while the popup does the talking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_019eA8JRq9Wr7z2fRQk99HLi --- src/features/nostrlogin.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/features') diff --git a/src/features/nostrlogin.js b/src/features/nostrlogin.js index ac991c8..981491e 100644 --- a/src/features/nostrlogin.js +++ b/src/features/nostrlogin.js @@ -221,18 +221,20 @@ export function nostrLoginFeature(ctx) { async function googleLogin(run) { const popup = window.open('about:blank', 'OAuth', 'width=600,height=600'); ui.nostrLoginError = ''; + // no status narration — a quiet spinner on the button itself is the whole + // story (the popup is where anything needing the user's eyes happens) + ui.nostrLoginVia = 'google'; + busy(true); try { const pome = await import('../pomegranate.js'); - const { uri } = await pome.loginWithGoogle(popup, { - onStatus: (s) => { ui.nostrLoginStatus = t('nlGoogleStatus_' + s); render(); }, - }); - ui.nostrLoginStatus = ''; + const { uri } = await pome.loginWithGoogle(popup); await run(() => bunkerSigner(uri, { onAuth: (url) => { ui.nostrLoginAuthUrl = url; render(); } })); } catch (e) { try { popup && popup.close(); } catch {} - ui.nostrLoginStatus = ''; ui.nostrLoginError = e.message; - render(); + } finally { + ui.nostrLoginVia = null; + busy(false); } } @@ -281,9 +283,8 @@ export function nostrLoginFeature(ctx) { const pad = big ? 'padding:14px' : ''; return [ h('button', { class: 'btn-block', style: pad, disabled: ui.nostrLoginBusy, - onClick: () => googleLogin(run) }, markedLabel(GOOGLE_MARK, t('nlGoogle'))), - ui.nostrLoginStatus ? h('div', { class: 'row gap6', style: 'align-items:center;justify-content:center' }, - h('span', { class: 'spinner sm' }), h('span', { class: 'small muted' }, ui.nostrLoginStatus)) : null, + onClick: () => googleLogin(run) }, + ui.nostrLoginVia === 'google' ? h('span', { class: 'spinner sm' }) : markedLabel(GOOGLE_MARK, t('nlGoogle'))), hasPasskey ? h('button', { class: 'btn-block', style: pad, disabled: ui.nostrLoginBusy, onClick: () => passkeyLogin(run) }, markedLabel(PASSKEY_MARK, t('nlPasskey'))) -- cgit v1.2.3