Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

feat(metrics): a11y empty states + link feedback to source research (#4793)

LearningCircuit904aff0795b8
diff --git a/changelog.d/4793.feature.md b/changelog.d/4793.feature.md
new file mode 100644
index 0000000000..89b1135aef
--- /dev/null
+++ b/changelog.d/4793.feature.md
@@ -0,0 +1 @@
+**Star Reviews dashboard polish.** Recent-feedback entries now link to their source research, and a screen-reader live region announces when the dashboard refreshes (e.g. after changing the time period), including which charts have no data yet.
diff --git a/src/local_deep_research/web/templates/pages/star_reviews.html b/src/local_deep_research/web/templates/pages/star_reviews.html
index f938b5f73a..773d36cdcc 100644
--- a/src/local_deep_research/web/templates/pages/star_reviews.html
+++ b/src/local_deep_research/web/templates/pages/star_reviews.html
@@ -46,6 +46,12 @@
<div id="error" class="ldr-error" style="display: none;"></div>
+ <!-- Screen-reader live region. Kept OUTSIDE #content (which is display:none
+ until data loads) so it stays in the accessibility tree and reliably
+ announces on each refresh / period change — a region toggled with its
+ content does not announce. -->
+ <div id="chart-status" role="status" aria-live="polite" class="sr-only"></div>
+
<div id="content" style="display: none;">
<!-- Overall Statistics with Doughnut -->
<div class="ldr-metric-card">
@@ -265,12 +271,38 @@ async function loadStarReviews() {
if (data.recent_feedback) updateRecentFeedback(data.recent_feedback);
showContent();
+ announceChartStates();
} catch (error) {
console.error('Error loading star reviews:', error);
showError('Failed to load star reviews data: ' + error.message);
}
}
+// Announce the refresh (and any empty charts) to screen readers via the
+// persistent #chart-status live region. Reads the empty-state visibility the
+// chart updaters just set, so it reflects their own emptiness decisions.
+function announceChartStates() {
+ const region = document.getElementById('chart-status');
+ if (!region) return;
+ const charts = [
+ ['mode-empty-state', 'research mode comparison'],
+ ['llm-breakdown-empty-state', 'LLM rating breakdown'],
+ ['quality-empty-state', 'quality dimensions'],
+ ];
+ const empty = charts
+ .filter(([id]) => {
+ const el = document.getElementById(id);
+ return el && el.style.display !== 'none';
+ })
+ .map(([, label]) => label);
+ // Clear first so an identical message on a subsequent refresh still
+ // registers as a change and is re-announced.
+ region.textContent = '';
+ region.textContent = empty.length
+ ? `Star reviews updated. No data yet for: ${empty.join(', ')}.`
+ : 'Star reviews updated.';
+}
+
function showLoading() {
document.getElementById('loading').style.display = 'block';
document.getElementById('content').style.display = 'none';
@@ -288,6 +320,9 @@ function showError(message) {
document.getElementById('content').style.display = 'none';
document.getElementById('error').style.display = 'block';
document.getElementById('error').textContent = message;
+ // Announce the failure (and clear any stale "updated" text) for screen readers.
+ const region = document.getElementById('chart-status');
+ if (region) region.textContent = 'Star reviews failed to load.';
}
function updateOverallStats(stats) {
@@ -762,6 +797,9 @@ function updateRecentFeedback(feedbackItems) {
const stars = '⭐'.repeat(item.rating);
const date = new Date(item.created_at).toLocaleDateString();
+ const researchLink = item.research_id
+ ? `<a href="/results/${encodeURIComponent(item.research_id)}" class="ldr-rating-link">View research <span aria-hidden="true">→</span></a>`
+ : '';
el.innerHTML = `
<div class="ldr-feedback-text">${escapeHtml(item.feedback)}</div>
@@ -769,6 +807,7 @@ function updateRecentFeedback(feedbackItems) {
<span class="ldr-star-rating">${stars}</span>
<span>${item.rating}/5</span>
<span>• ${date}</span>
+ ${researchLink}
</div>
`;