diff --git a/frontend/app.js b/frontend/app.js index 62f8461..b162158 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -3570,10 +3570,29 @@ async function init() { } }, 2000); + // Ready button — click to go to feed + const readyBtn = document.getElementById('welcome-ready-btn'); + const readyBar = document.getElementById('welcome-ready-bar'); + if (readyBtn) { + readyBtn.addEventListener('click', () => { + if (readyBtn.disabled) return; + document.querySelectorAll('.tab').forEach(t => t.classList.remove('active')); + document.querySelectorAll('.view').forEach(v => v.classList.remove('active')); + const feedTab = document.querySelector('.tab[data-tab="feed"]'); + if (feedTab) feedTab.classList.add('active'); + document.getElementById('view-feed').classList.add('active'); + currentTab = 'feed'; + _lastFeedViewMs = Date.now(); + updateTabBadge('feed', 0); + }); + } + // Wait for backend in the background, then load node info (async () => { for (let attempt = 0; attempt < 30; attempt++) { try { + // Animate progress bar toward 90% during readiness checks + if (readyBar) readyBar.style.width = Math.min(90, (attempt + 1) * 3) + '%'; await invoke('get_node_info'); break; } catch (e) { @@ -3586,9 +3605,19 @@ async function init() { setupOverlay.classList.remove('hidden'); setupName.focus(); } - // Reload feed now that backend is ready - loadFeed(true).catch(() => {}); + // Pre-load feed + messages from local DB (instant — no network needed) + await loadFeed(true).catch(() => {}); loadMessages(true).catch(() => {}); + // Mark ready button as clickable + if (readyBar) readyBar.style.width = '100%'; + if (readyBtn) { + readyBtn.disabled = false; + readyBtn.textContent = 'Ready — Go to Feed'; + readyBtn.style.opacity = '1'; + readyBtn.style.color = '#7fdbca'; + readyBtn.style.borderColor = '#7fdbca'; + readyBtn.style.cursor = 'pointer'; + } })(); // Mark notif ready after first welcome fetch succeeds (skip first 2 ticks to avoid spam) diff --git a/frontend/index.html b/frontend/index.html index 3a8e927..c8bef81 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -49,6 +49,12 @@