From e354ccc38881bb9086edd4a815d6617e7ce4a434 Mon Sep 17 00:00:00 2001 From: Scott Reimers Date: Sun, 5 Apr 2026 16:41:50 -0400 Subject: [PATCH] Welcome screen: add Ready button with loading bar for instant feed access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Progress bar animates during backend readiness check. Once local feed is loaded from SQLite, button enables with teal highlight. Click switches to feed tab with cached content — no network wait needed for returning users. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/app.js | 33 +++++++++++++++++++++++++++++++-- frontend/index.html | 6 ++++++ 2 files changed, 37 insertions(+), 2 deletions(-) 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 @@
-Reacts
-Comments
+
+
+
+
+ +