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.

cleanup: remove dead checkForCompletedNewsSearches code (#2943)

LearningCircuit8f94b9285d70
diff --git a/src/local_deep_research/web/static/js/pages/news.js b/src/local_deep_research/web/static/js/pages/news.js
index cfb1dd09b9..c297cea667 100644
--- a/src/local_deep_research/web/static/js/pages/news.js
+++ b/src/local_deep_research/web/static/js/pages/news.js
@@ -1455,42 +1455,6 @@ async function checkPriorityStatus() {
SafeLogger.error('Error checking priority status:', error);
}
- // Also check for completed news searches to display
- // Commented out to prevent duplicate rendering - news items are already shown in the main feed
- // checkForCompletedNewsSearches();
-}
-
-// Check for completed news searches
-async function checkForCompletedNewsSearches() {
- try {
- const response = await fetch('/api/history');
- if (response.ok) {
- const data = await response.json();
- // Find recent completed news searches
- const newsSearches = data.items?.filter(item =>
- item.status === 'completed' &&
- item.metadata?.is_news_search &&
- // Only show searches from last 24 hours
- new Date(item.completed_at) > new Date(Date.now() - 24 * 60 * 60 * 1000)
- ) || [];
-
- if (newsSearches.length > 0) {
- // Display them as news cards
- for (const search of newsSearches) {
- // Check if already displayed
- if (!document.querySelector(`[data-research-id="${search.id}"]`)) {
- const reportResponse = await fetch(`/api/report/${search.id}`);
- if (reportResponse.ok) {
- const report = await reportResponse.json();
- displayNewsResearchAsCard(search.id, search.query, report);
- }
- }
- }
- }
- }
- } catch (error) {
- SafeLogger.error('Error checking completed news searches:', error);
- }
}
// Extract trending topics
@@ -2354,95 +2318,7 @@ async function pollForNewsResearchResults(researchId, originalQuery, isResume =
}, 5000); // Poll every 5 seconds
}
-// Display news research as a card
-function displayNewsResearchAsCard(researchId, query, report) {
- const container = document.getElementById('news-feed-content');
-
- // Extract key findings from the report
- const content = report.content || '';
- const lines = content.split('\n');
-
- // Find the summary or key findings section
- let summary = '';
- let inSummary = false;
- for (const line of lines) {
- if (line.includes('Summary') || line.includes('Key Findings') || line.includes('THE BIG PICTURE')) {
- inSummary = true;
- continue;
- }
- if (inSummary && line.trim() && !line.startsWith('#')) {
- summary += line + ' ';
- if (summary.length > 300) break; // Limit summary length
- }
- }
- // If no summary found, take first few lines
- if (!summary) {
- summary = lines.filter(l => l.trim() && !l.startsWith('#')).slice(0, 3).join(' ');
- }
-
- // Create news card
- const newsCard = `
- <div class="ldr-news-card ldr-priority-high" data-research-id="${escapeHtml(researchId)}">
- <div class="ldr-impact-score ldr-impact-high">
- <i class="bi bi-stars"></i> News Analysis
- </div>
- <div class="ldr-news-header">
- <h2 class="ldr-news-title">${escapeHtml(query)}</h2>
- </div>
- <div class="ldr-news-meta">
- <span><i class="bi bi-check-circle"></i> Analysis Complete</span>
- <span><i class="bi bi-clock"></i> Just now</span>
- <span><i class="bi bi-file-text"></i> Full Report Available</span>
- </div>
- <div class="ldr-news-summary">
- <p>${escapeHtml(summary.substring(0, 300))}...</p>
- </div>
- <div class="ldr-news-actions">
- <div class="ldr-vote-buttons">
- <button class="ldr-vote-btn" onclick="vote('news-${researchId}', 'up')">
- <i class="bi bi-hand-thumbs-up"></i> 0
- </button>
- <button class="ldr-vote-btn" onclick="vote('news-${researchId}', 'down')">
- <i class="bi bi-hand-thumbs-down"></i> 0
- </button>
- </div>
- <div>
- <a href="/results/${researchId}" class="btn btn-sm btn-primary">
- <i class="bi bi-arrow-right"></i> View Full Analysis
- </a>
- <button class="btn btn-sm btn-outline-secondary" onclick="saveNewsAnalysis('${researchId}')">
- <i class="bi bi-bookmark"></i>
- </button>
- </div>
- </div>
- </div>
- `;
-
- // Append to existing content instead of replacing
- const existingCard = document.querySelector(`[data-research-id="${researchId}"]`);
- if (existingCard) {
- // bearer:disable javascript_lang_dangerous_insert_html
- existingCard.outerHTML = newsCard;
- } else {
- // Create a temporary div to hold the new card
- const tempDiv = document.createElement('div');
- // bearer:disable javascript_lang_dangerous_insert_html
- tempDiv.innerHTML = newsCard;
- container.insertBefore(tempDiv.firstElementChild, container.firstChild);
- }
-
- // Show success message
- showAlert('News analysis complete! Click "View Full Analysis" for detailed report.', 'success');
-}
-
-// Save news analysis
-function saveNewsAnalysis(researchId) {
- const saved = JSON.parse(localStorage.getItem('saved_news_analyses') || '[]');
- saved.push({ id: researchId, timestamp: new Date().toISOString() });
- localStorage.setItem('saved_news_analyses', JSON.stringify(saved));
- showAlert('Analysis saved for later', 'success');
-}
// Search history functions
async function loadSearchHistory() {