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.

fix: Update remaining CSS class references to use ldr- prefix

LearningCircuit5332ec863514
diff --git a/.pre-commit-hooks/check-css-class-prefix.py b/.pre-commit-hooks/check-css-class-prefix.py
index 9587592595..61ded90228 100755
--- a/.pre-commit-hooks/check-css-class-prefix.py
+++ b/.pre-commit-hooks/check-css-class-prefix.py
@@ -239,7 +239,7 @@ def check_js_file(file_path: Path) -> List[Tuple[int, str, str]]:
content = file_path.read_text()
lines = content.split("\n")
- # Patterns to match class usage in JavaScript
+ # Patterns to match class usage in JavaScript (excluding querySelector/jQuery)
patterns = [
# classList.add('classname')
re.compile(
@@ -249,16 +249,18 @@ def check_js_file(file_path: Path) -> List[Tuple[int, str, str]]:
re.compile(r'className\s*[:=]\s*["\']([^"\']+)["\']'),
# getElementsByClassName('classname')
re.compile(r'getElementsByClassName\s*\(\s*["\']([^"\']+)["\']'),
- # querySelector('.classname')
- re.compile(r'querySelector(?:All)?\s*\(\s*["\']\.([^"\']+)["\']'),
- # jQuery $('.classname')
- re.compile(r'\$\s*\(\s*["\']\.([^"\']+)["\']'),
# hasClass('classname'), addClass('classname'), removeClass('classname')
re.compile(
r'\.(hasClass|addClass|removeClass|toggleClass)\s*\(\s*["\']([^"\']+)["\']'
),
]
+ # Special patterns for querySelector and jQuery that need different handling
+ querySelector_pattern = re.compile(
+ r'querySelector(?:All)?\s*\(\s*["\']([^"\']+)["\']'
+ )
+ jquery_pattern = re.compile(r'\$\s*\(\s*["\']([^"\']+)["\']')
+
for line_num, line in enumerate(lines, 1):
# Skip comments
if "//" in line or "/*" in line or "*/" in line:
@@ -267,6 +269,37 @@ def check_js_file(file_path: Path) -> List[Tuple[int, str, str]]:
if comment_start >= 0:
line = line[:comment_start]
+ # Handle querySelector and jQuery selectors specially
+ for selector_match in querySelector_pattern.findall(line):
+ # Extract class names from CSS selectors (e.g., '.class1 .class2', '.class1.class2')
+ # Only match class selectors (starting with .)
+ class_matches = re.findall(
+ r"\.([a-zA-Z0-9_-]+)", selector_match
+ )
+ for cls in class_matches:
+ if not is_allowed_class(cls):
+ errors.append(
+ (
+ line_num,
+ cls,
+ f"JavaScript class '.{cls}' should be prefixed with 'ldr-'",
+ )
+ )
+
+ for jquery_match in jquery_pattern.findall(line):
+ # Extract class names from jQuery selectors
+ class_matches = re.findall(r"\.([a-zA-Z0-9_-]+)", jquery_match)
+ for cls in class_matches:
+ if not is_allowed_class(cls):
+ errors.append(
+ (
+ line_num,
+ cls,
+ f"JavaScript class '.{cls}' should be prefixed with 'ldr-'",
+ )
+ )
+
+ # Handle other patterns
for pattern in patterns:
matches = pattern.findall(line)
for match in matches:
diff --git a/src/local_deep_research/web/static/js/components/logpanel.js b/src/local_deep_research/web/static/js/components/logpanel.js
index a09129f775..04eeadfe64 100644
--- a/src/local_deep_research/web/static/js/components/logpanel.js
+++ b/src/local_deep_research/web/static/js/components/logpanel.js
@@ -200,7 +200,7 @@
}
// Set up filter button click handlers
- const filterButtons = document.querySelectorAll('.log-filter .filter-buttons button');
+ const filterButtons = document.querySelectorAll('.ldr-log-filter .ldr-filter-buttons button');
filterButtons.forEach(button => {
button.addEventListener('click', function() {
const type = this.textContent.toLowerCase();
@@ -219,7 +219,7 @@
logPanelContent.classList.add('collapsed');
const initialToggleIcon = logPanelToggle.querySelector('.ldr-toggle-icon');
if (initialToggleIcon) {
- initialToggleIcon.className = 'fas fa-chevron-right toggle-icon';
+ initialToggleIcon.className = 'fas fa-chevron-right ldr-toggle-icon';
}
// Initialize the log count
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 11fe4c8ac8..cd39782531 100644
--- a/src/local_deep_research/web/static/js/pages/news.js
+++ b/src/local_deep_research/web/static/js/pages/news.js
@@ -277,7 +277,7 @@ function setupEventListeners() {
}
// Time filter buttons
- const timeFilters = document.querySelectorAll('.time-filter-group .filter-btn');
+ const timeFilters = document.querySelectorAll('.ldr-time-filter-group .ldr-filter-btn');
timeFilters.forEach(btn => {
btn.addEventListener('click', (e) => {
// Remove active class from all buttons
@@ -1098,8 +1098,8 @@ async function loadVotesForNewsItems() {
for (const [cardId, voteInfo] of Object.entries(data.votes)) {
const item = document.querySelector(`[data-news-id="${cardId}"]`);
if (item) {
- const upBtn = item.querySelector('.vote-btn:first-child');
- const downBtn = item.querySelector('.vote-btn:last-child');
+ const upBtn = item.querySelector('.ldr-vote-btn:first-child');
+ const downBtn = item.querySelector('.ldr-vote-btn:last-child');
if (upBtn && downBtn) {
// Update vote counts
@@ -1146,8 +1146,8 @@ async function vote(newsId, voteType) {
// Update UI
const item = document.querySelector(`[data-news-id="${newsId}"]`);
if (item) {
- const upBtn = item.querySelector('.vote-btn:first-child');
- const downBtn = item.querySelector('.vote-btn:last-child');
+ const upBtn = item.querySelector('.ldr-vote-btn:first-child');
+ const downBtn = item.querySelector('.ldr-vote-btn:last-child');
upBtn.innerHTML = `<i class="fas fa-thumbs-up"></i> ${data.upvotes}`;
downBtn.innerHTML = `<i class="fas fa-thumbs-down"></i> ${data.downvotes}`;
@@ -1652,7 +1652,7 @@ function updateFilterStatusBar() {
// Update feed header based on active subscription
function updateFeedHeader() {
- const feedTitle = document.querySelector('.feed-header h2');
+ const feedTitle = document.querySelector('.ldr-feed-header h2');
if (!feedTitle) return;
if (activeSubscription === 'all') {
@@ -1680,7 +1680,7 @@ function clearAllFilters() {
updateActiveTopicUI();
// Reset filter chips
- document.querySelectorAll('#time-filters .filter-chip').forEach(chip => {
+ document.querySelectorAll('#time-filters .ldr-filter-chip').forEach(chip => {
chip.classList.remove('active');
if (chip.dataset.time === 'all') chip.classList.add('active');
});
@@ -2066,7 +2066,7 @@ async function monitorResearch(researchId, query = null) {
if (!progressCard) {
// Create new progress card at the top
const newCard = document.createElement('div');
- newCard.className = 'news-card priority-high active-research-card';
+ newCard.className = 'ldr-news-card ldr-priority-high ldr-active-research-card';
newCard.setAttribute('data-research-id', researchId);
newCard.innerHTML = `
<div class="news-header">
@@ -2115,7 +2115,7 @@ async function monitorResearch(researchId, query = null) {
if (progressBar) {
progressBar.style.width = `${data.progress || 10}%`;
}
- const progressText = progressCard.querySelector('.news-summary p');
+ const progressText = progressCard.querySelector('.ldr-news-summary p');
if (progressText && data.message) {
progressText.textContent = data.message;
}
@@ -3403,7 +3403,7 @@ async function handleNewsSubscriptionSubmit(e) {
// Show loading state in news feed with progress visualization
const container = document.getElementById('news-feed-content');
const progressCard = document.createElement('div');
- progressCard.className = 'news-card priority-high active-research-card';
+ progressCard.className = 'ldr-news-card ldr-priority-high ldr-active-research-card';
progressCard.innerHTML = `
<div class="news-header">
<h2 class="news-title">