From 13a00e544ebbefd4114d4da1f8ecb4a99e4680f2 Mon Sep 17 00:00:00 2001 From: gramps Date: Tue, 14 Jul 2026 15:12:55 -0700 Subject: [PATCH] RAG admin: better empty-state message for empty corpus vs no search match --- templates/index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/index.html b/templates/index.html index 4fa7d3c..4789ec5 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1377,7 +1377,7 @@ async function loadRagPoints() { try { const search = document.getElementById('ragSearchInput').value.trim(); const source = document.getElementById('ragSourceFilter').value; - let url = `/api/rag/points?limit=20`; + let url = `/api/rag/points?limit=20&sort=date&order=desc`; if (search) url += `&search=${encodeURIComponent(search)}`; if (source) url += `&source=${encodeURIComponent(source)}`; if (_ragPageOffset !== null && !search) url += `&offset=${encodeURIComponent(_ragPageOffset)}`; @@ -1389,7 +1389,10 @@ async function loadRagPoints() { table.innerHTML = ''; if (!data.points || data.points.length === 0) { - table.innerHTML = 'No points found'; + const emptyMsg = document.getElementById('ragSearchInput').value.trim() + ? 'No results match your search query.' + : 'RAG corpus is empty. Upload a file with the 📎 button (mode=ingest or both), or use /api/ingest from the terminal.'; + table.innerHTML = `${emptyMsg}`; document.getElementById('ragPagination').style.display = 'none'; return; }