abinazebinoy commited on
Commit
833acfb
·
1 Parent(s): 7ef1e95

fix(BUG-12): show user-friendly callout when feed is empty due to unpopulated DB instead of swallowing backend message

Browse files
Files changed (1) hide show
  1. frontend/js/app.js +10 -0
frontend/js/app.js CHANGED
@@ -200,6 +200,16 @@ const Views = {
200
  source: item.source || "BharatGraph",
201
  }));
202
  });
 
 
 
 
 
 
 
 
 
 
203
  } else {
204
  container.appendChild(Components.FeedItem({
205
  headline: data.message || "New intelligence available",
 
200
  source: item.source || "BharatGraph",
201
  }));
202
  });
203
+ } else if (data.message && data.message.includes("pipeline")) {
204
+ // BUG-12 FIX: "run /admin/pipeline" is a backend message that
205
+ // was never shown to users -- show a friendly callout instead
206
+ if (!document.getElementById("feed-empty-callout")) {
207
+ const callout = document.createElement("div");
208
+ callout.id = "feed-empty-callout";
209
+ callout.style.cssText = "padding:16px;background:rgba(255,153,51,0.08);border:1px solid rgba(255,153,51,0.25);border-radius:8px;font-size:12px;color:var(--color-saffron);text-align:center;margin:8px";
210
+ callout.textContent = "Database is being populated. Intelligence data will appear here after the pipeline completes.";
211
+ container.appendChild(callout);
212
+ }
213
  } else {
214
  container.appendChild(Components.FeedItem({
215
  headline: data.message || "New intelligence available",