From 1e5f04398b6c182d9b3ca709aa146a09b6981dec Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 13 Apr 2026 09:15:17 -0400 Subject: [PATCH 1/2] feat(identity): add notification dot on My Account + remove postal address Show red alert dot on "My Account" dropdown item when email, multi-device, or social recovery tasks are incomplete. Remove postal address section from the account modal (render, state, loader, listeners). Co-Authored-By: Claude Opus 4.6 --- shared/components/rstack-identity.ts | 156 ++++----------------------- 1 file changed, 22 insertions(+), 134 deletions(-) diff --git a/shared/components/rstack-identity.ts b/shared/components/rstack-identity.ts index b64ac89e..bc9320db 100644 --- a/shared/components/rstack-identity.ts +++ b/shared/components/rstack-identity.ts @@ -470,9 +470,10 @@ export class RStackIdentity extends HTMLElement { const cached = localStorage.getItem(CACHE_KEY); if (cached) { try { - const { ts, ok } = JSON.parse(cached); - if (Date.now() - ts < 30 * 60 * 1000) { - if (!ok) this.#showRecoveryDot(); + const c = JSON.parse(cached); + if (Date.now() - c.ts < 30 * 60 * 1000) { + if (!c.socialRecovery) this.#showRecoveryDot(); + if (!c.email || !c.multiDevice || !c.socialRecovery) this.#showAccountDot(); return; } } catch { /* stale cache */ } @@ -484,9 +485,9 @@ export class RStackIdentity extends HTMLElement { }); if (!res.ok) return; const status = await res.json(); - const recoveryOk = status.socialRecovery === true; - localStorage.setItem(CACHE_KEY, JSON.stringify({ ts: Date.now(), ok: recoveryOk })); - if (!recoveryOk) this.#showRecoveryDot(); + localStorage.setItem(CACHE_KEY, JSON.stringify({ ts: Date.now(), email: !!status.email, multiDevice: !!status.multiDevice, socialRecovery: !!status.socialRecovery })); + if (!status.socialRecovery) this.#showRecoveryDot(); + if (!status.email || !status.multiDevice || !status.socialRecovery) this.#showAccountDot(); } catch { /* offline */ } } @@ -499,6 +500,14 @@ export class RStackIdentity extends HTMLElement { wrap.appendChild(dot); } + #showAccountDot() { + const btn = this.#shadow.querySelector('[data-action="my-account"]'); + if (!btn || btn.querySelector(".acct-alert-dot")) return; + const dot = document.createElement("span"); + dot.className = "acct-alert-dot"; + btn.appendChild(dot); + } + async #checkDeviceNudge() { const session = getSession(); if (!session?.accessToken) return; @@ -1360,10 +1369,6 @@ export class RStackIdentity extends HTMLElement { let devicesLoaded = false; let devicesLoading = false; - let addresses: { id: string; street: string; city: string; state: string; zip: string; country: string }[] = []; - let addressesLoaded = false; - let addressesLoading = false; - // Connections data let connectionsLoaded = false; let connectionsLoading = false; @@ -1418,7 +1423,6 @@ export class RStackIdentity extends HTMLElement { ${renderEmailSection()} ${renderDeviceSection()} ${renderRecoverySection()} - ${renderAddressSection()}