From b4d253c60b8230a7aee84c195ceb8c37dfe39d30 Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Sun, 3 May 2026 20:48:48 -0400 Subject: [PATCH 1/4] chore(ext/settings): stub settings-security.ts (DEV-C replaces implementation) --- .../src/popup/components/settings-security.ts | 324 +----------------- 1 file changed, 6 insertions(+), 318 deletions(-) diff --git a/extension/src/popup/components/settings-security.ts b/extension/src/popup/components/settings-security.ts index 71926be..9bb6da7 100644 --- a/extension/src/popup/components/settings-security.ts +++ b/extension/src/popup/components/settings-security.ts @@ -1,329 +1,17 @@ -/// Security settings section — three-state Recovery QR + Trusted Devices panel. -/// -/// Exported contract: -/// renderSecuritySection(container, sessionHandle): renders into `container` -/// teardownSecuritySection(): removes any open QR modal - -import { sendMessage, escapeHtml } from '../../shared/state'; -import type { Device } from '../../shared/types'; - -// --- Relative time helper --- - -function relativeTime(unixSec: number): string { - const now = Math.floor(Date.now() / 1000); - const diff = now - unixSec; - if (diff < 60) return 'just now'; - if (diff < 3600) return `${Math.floor(diff / 60)}m ago`; - if (diff < 86400) return `${Math.floor(diff / 3600)}h ago`; - if (diff < 2592000) return `${Math.floor(diff / 86400)}d ago`; - return `${Math.floor(diff / 2592000)}mo ago`; -} - -// --- Modal helpers --- - -const MODAL_ID = 'relicario-qr-modal'; - -function removeModal(): void { - document.getElementById(MODAL_ID)?.remove(); -} - -function showQrModal(svgContent: string): void { - removeModal(); - - const overlay = document.createElement('div'); - overlay.id = MODAL_ID; - overlay.style.cssText = [ - 'position:fixed', 'inset:0', 'z-index:9999', - 'background:rgba(0,0,0,0.85)', - 'display:flex', 'flex-direction:column', - 'align-items:center', 'justify-content:center', - 'padding:16px', 'box-sizing:border-box', - ].join(';'); - - overlay.innerHTML = ` -
-
- Recovery QR -
-
- Print or store this QR. It encodes your reference image secret, - protected by your passphrase. -
-
- ${svgContent} -
-
- - -
-
- `; - - document.body.appendChild(overlay); - - document.getElementById('relicario-qr-done')?.addEventListener('click', removeModal); - - document.getElementById('relicario-qr-print')?.addEventListener('click', () => { - const win = window.open('', '_blank', 'width=400,height=500'); - if (!win) return; - win.document.write(` - - Recovery QR - -

Relicario Recovery QR

-

Scan with the Relicario app to recover your reference image secret.
- Keep this page in a safe physical location.

- ${svgContent} -