From 0dd15d3541c9b9e7fe77671ec12de523cbad34ec Mon Sep 17 00:00:00 2001 From: gitadmin Date: Sat, 2 May 2026 14:40:53 +0000 Subject: [PATCH] fix: improved email send feedback (prominent success banner, loading state) --- routes/agentify-help.ts | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/routes/agentify-help.ts b/routes/agentify-help.ts index 2a44a7e..b68542b 100644 --- a/routes/agentify-help.ts +++ b/routes/agentify-help.ts @@ -3200,7 +3200,7 @@ h1{font-size:1.6rem;color:#f0e8d0;margin-bottom:4px}

Are you the steward or a collaborator for this agent? Enter your email to receive a secure link to your corpus portal.

- +
@@ -3232,9 +3232,16 @@ document.getElementById('q')?.addEventListener('keydown', e => { if (e.key === ' async function requestPortfolioAccess() { const emailEl = document.getElementById('steward-email'); const result = document.getElementById('steward-access-result'); + const btn = document.getElementById('steward-access-btn'); const email = emailEl.value.trim(); - if (!email || !email.includes('@')) { result.textContent = 'Please enter a valid email address.'; result.style.color = '#f87171'; return; } - result.textContent = 'Sending…'; result.style.color = '#6b7f99'; + if (!email || !email.includes('@')) { + result.style.cssText = 'margin-top:10px;font-size:.85rem;color:#f87171;font-weight:500'; + result.textContent = 'Please enter a valid email address.'; + return; + } + result.style.cssText = 'margin-top:8px;font-size:.82rem;color:#6b7f99'; + result.textContent = 'Sending…'; + if (btn) { btn.disabled = true; btn.textContent = 'Sending…'; } try { const r = await fetch('/api/agentify-help/portfolio-access', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -3242,15 +3249,19 @@ async function requestPortfolioAccess() { }); const d = await r.json(); if (d.ok && d.sent !== false) { - result.textContent = '✓ Check your inbox — your steward link is on the way.'; - result.style.color = '#22c55e'; + result.style.cssText = 'margin-top:12px;font-size:.88rem;color:#22c55e;font-weight:600;padding:10px 14px;background:rgba(34,197,94,0.08);border:1px solid rgba(34,197,94,0.25);border-radius:6px;display:block'; + result.textContent = '✓ Link sent! Check your inbox — and your spam folder if you don\'t see it within a minute.'; + if (btn) { btn.disabled = true; btn.textContent = 'Sent ✓'; btn.style.opacity = '0.6'; } + emailEl.value = ''; } else { + result.style.cssText = 'margin-top:10px;font-size:.85rem;color:#f87171;font-weight:500'; result.textContent = d.message || 'No steward account found for that email.'; - result.style.color = '#f87171'; + if (btn) { btn.disabled = false; btn.textContent = 'Send my link →'; } } } catch(e) { - result.textContent = 'Error sending link. Please try again.'; - result.style.color = '#f87171'; + result.style.cssText = 'margin-top:10px;font-size:.85rem;color:#f87171;font-weight:500'; + result.textContent = 'Network error — please try again.'; + if (btn) { btn.disabled = false; btn.textContent = 'Send my link →'; } } }