diff --git a/frontend/dashboard.css b/frontend/dashboard.css index 9972189..b056965 100644 --- a/frontend/dashboard.css +++ b/frontend/dashboard.css @@ -28,6 +28,11 @@ button { background: linear-gradient(180deg,#1f3a5f,#15324d); border:1px solid # .device-setup-step { min-width:0; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; padding:12px; border:1px solid #2a496e; border-radius:12px; background:#10233a; overflow-wrap:anywhere; } .device-setup-step p { margin:5px 0 0; } .device-setup-ready { margin:0; padding:12px; border-radius:10px; background:#0f2237; color:#bfdbfe; font-weight:700; } +.device-readiness-card { display:none; min-width:0; margin:10px 0; padding:12px; border:1px solid #3b82b8; border-radius:12px; background:#102b46; overflow-x:hidden; } +.device-readiness-card p { margin:5px 0 0; overflow-wrap:anywhere; } +.device-readiness-summary { color:#bfdbfe; font-weight:700; } +.device-readiness-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } +.device-readiness-actions button { min-height:44px; min-width:0; } .active-device { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; padding:12px; border:1px solid #2a496e; border-radius:12px; background:#0f2237; } .active-device strong, .active-device span { display:block; overflow-wrap:anywhere; } .active-device-current { color:#55d6be; font-weight:700; } @@ -476,6 +481,7 @@ textarea { resize: vertical; min-height: 120px; } .device-setup-panel { width:100%; padding:14px; padding-bottom:calc(14px + env(safe-area-inset-bottom)); } .device-setup-step { grid-template-columns:1fr; } .device-setup-action { width:100%; } + .device-readiness-card:not([hidden]) { display:grid; gap:12px; margin-left:max(0px,env(safe-area-inset-left)); margin-right:max(0px,env(safe-area-inset-right)); } .my-work { margin:0; } .my-work-header { align-items:flex-start; } .my-work-actions { width:100%; flex-wrap:nowrap; } diff --git a/frontend/dashboard.js b/frontend/dashboard.js index 4bc6592..6ebedb3 100644 --- a/frontend/dashboard.js +++ b/frontend/dashboard.js @@ -5290,6 +5290,7 @@ await controller.init(); return controller; }).catch(error => { + qs('#push-updates').disabled = true; qs('#push-update-status').textContent = 'Update notification settings unavailable.'; console.warn('Push notifications unavailable', error); return null; @@ -5304,8 +5305,8 @@ deferredInstallPrompt = event; }); let deviceSetup = null; - qs('#open-device-setup').addEventListener('click', async event => { - if (deviceSetup) return; + async function ensureDeviceSetup() { + if (deviceSetup) return deviceSetup; await issueCaptureFeatures.load('device-setup'); const isIosDevice = /iPad|iPhone|iPod/.test(navigator.userAgent) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1); @@ -5319,7 +5320,7 @@ }); installApp.start(); deviceSetup = createMobileDeviceSetup.mount({ - document, installApp, + document, installApp, promptStorage:localStorage, offlineAvailable:() => offlineStorageReady, offlineEnabled:() => offlineWorkStore.enabled(), enableOffline:() => setOfflineWorkEnabled(true), @@ -5330,12 +5331,17 @@ await controller.change(); }, }); - deviceSetup.start(); - await deviceSetup.open(event); + await deviceSetup.start(); + return deviceSetup; + } + qs('#open-device-setup').addEventListener('click', async event => { + if (!deviceSetup) await (await ensureDeviceSetup()).open(event); }); + pushControllerReady.then(ensureDeviceSetup).catch(console.warn); contextPoller.start(); document.addEventListener('visibilitychange', () => { contextPoller.setVisible(!document.hidden); + if (!document.hidden) deviceSetup?.render(); }); /* Widgets */ diff --git a/frontend/index.html b/frontend/index.html index c0f22e3..e5ebb5f 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -146,6 +146,17 @@ +