From 5e2b1b2de36fc63cfa677705388f5701c62ee138 Mon Sep 17 00:00:00 2001
From: Adam Mathes <adam@adammathes.com>
Date: Sat, 14 Feb 2026 21:20:32 -0800
Subject: feat: add manual crawl button and E2E test for crawl cycle

---
 frontend/src/components/Settings.tsx | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

(limited to 'frontend/src/components/Settings.tsx')

diff --git a/frontend/src/components/Settings.tsx b/frontend/src/components/Settings.tsx
index b218775..ec432ba 100644
--- a/frontend/src/components/Settings.tsx
+++ b/frontend/src/components/Settings.tsx
@@ -111,6 +111,25 @@ export default function Settings({ fontTheme, setFontTheme }: SettingsProps) {
       });
   };
 
+  const handleCrawl = () => {
+    setLoading(true);
+    apiFetch('/api/crawl', {
+      method: 'POST',
+    })
+      .then((res) => {
+        if (!res.ok) throw new Error('Failed to start crawl');
+        return res.json();
+      })
+      .then(() => {
+        setLoading(false);
+        alert('Crawl started!');
+      })
+      .catch((err) => {
+        setError(err.message);
+        setLoading(false);
+      });
+  };
+
   return (
     <div className="settings-page variant-glass">
       <h2>Settings</h2>
@@ -178,6 +197,13 @@ export default function Settings({ fontTheme, setFontTheme }: SettingsProps) {
             <a href="/api/export/json" className="export-btn">JSON</a>
           </div>
         </div>
+
+        <div className="crawl-section">
+          <h3>Actions</h3>
+          <button onClick={handleCrawl} disabled={loading} className="crawl-btn">
+            Crawl All Feeds Now
+          </button>
+        </div>
       </div>
 
       {error && <p className="error-message">{error}</p>}
-- 
cgit v1.2.3

