~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.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix: detect compound CSS selectors in class prefix hook (#3103)
LearningCircuit3e1113e6d9ea
diff --git a/.pre-commit-hooks/check-css-class-prefix.py b/.pre-commit-hooks/check-css-class-prefix.pyindex b180231acf..8e750ceebe 100755--- a/.pre-commit-hooks/check-css-class-prefix.py+++ b/.pre-commit-hooks/check-css-class-prefix.py@@ -139,10 +139,13 @@ def check_css_file(file_path: Path) -> List[Tuple[int, str, str]]:content = file_path.read_text()lines = content.split("\n")- # Pattern to match CSS class definitions- # Matches: .classname { or .classname:hover { or .classname.other {- # But not URLs like www.w3.org- class_pattern = re.compile(r"(?<![\w/])\.([a-zA-Z][a-zA-Z0-9\-_]*)")+ # Pattern to match CSS class selectors, including compound+ # selectors like .class1.class2+ # First match the leading dot (not preceded by a word char or /)+ # then capture everything including subsequent .class segments+ class_pattern = re.compile(+ r"(?<![\w/])\.([a-zA-Z][a-zA-Z0-9\-_]*(?:\.[a-zA-Z][a-zA-Z0-9\-_]*)*)"+ )for line_num, line in enumerate(lines, 1):# Skip comments@@ -154,15 +157,20 @@ def check_css_file(file_path: Path) -> List[Tuple[int, str, str]]:continuematches = class_pattern.findall(line)- for class_name in matches:- if not is_allowed_class(class_name):- errors.append(- (- line_num,- class_name,- f"CSS class '.{class_name}' should be prefixed with 'ldr-'",+ for match in matches:+ # Split compound selectors like "class1.class2" into+ # individual class names for separate validation+ for class_name in match.split("."):+ if not class_name:+ continue+ if not is_allowed_class(class_name):+ errors.append(+ (+ line_num,+ class_name,+ f"CSS class '.{class_name}' should be prefixed with 'ldr-'",+ ))- )except Exception as e:print(f"Error reading {file_path}: {e}", file=sys.stderr)@@ -188,7 +196,9 @@ def check_html_file(file_path: Path) -> List[Tuple[int, str, str]]:]# Pattern to match CSS class definitions (same as in check_css_file)- css_class_pattern = re.compile(r"(?<![\w/])\.([a-zA-Z][a-zA-Z0-9\-_]*)")+ css_class_pattern = re.compile(+ r"(?<![\w/])\.([a-zA-Z][a-zA-Z0-9\-_]*(?:\.[a-zA-Z][a-zA-Z0-9\-_]*)*)"+ )in_style_tag = False@@ -219,15 +229,19 @@ def check_html_file(file_path: Path) -> List[Tuple[int, str, str]]:# Check for CSS class definitionscss_matches = css_class_pattern.findall(line)- for class_name in css_matches:- if not is_allowed_class(class_name):- errors.append(- (- line_num,- class_name,- f"CSS class '.{class_name}' in style tag should be prefixed with 'ldr-'",+ for match in css_matches:+ # Split compound selectors like "class1.class2"+ for class_name in match.split("."):+ if not class_name:+ continue+ if not is_allowed_class(class_name):+ errors.append(+ (+ line_num,+ class_name,+ f"CSS class '.{class_name}' in style tag should be prefixed with 'ldr-'",+ ))- )continue # Skip HTML class checking when in style tag# Try both patterns to handle different quote typesdiff --git a/src/local_deep_research/web/static/css/benchmark.css b/src/local_deep_research/web/static/css/benchmark.cssindex fdd84a1e52..12352af7f8 100644--- a/src/local_deep_research/web/static/css/benchmark.css+++ b/src/local_deep_research/web/static/css/benchmark.css@@ -555,7 +555,7 @@margin-bottom: 15px;}-.ldr-form-group.half {+.ldr-form-group.ldr-half {margin-bottom: 0;}diff --git a/src/local_deep_research/web/static/css/collection_details.css b/src/local_deep_research/web/static/css/collection_details.cssindex 5afe888c58..a6dcb03116 100644--- a/src/local_deep_research/web/static/css/collection_details.css+++ b/src/local_deep_research/web/static/css/collection_details.css@@ -589,11 +589,11 @@transform: translateX(5px);}-.ldr-document-item.indexed {+.ldr-document-item.ldr-indexed {border-left: 4px solid var(--success-color);}-.ldr-document-item.unindexed {+.ldr-document-item.ldr-unindexed {border-left: 4px solid var(--warning-color);}diff --git a/src/local_deep_research/web/static/css/collections.css b/src/local_deep_research/web/static/css/collections.cssindex f034cabfc1..d78d0205a4 100644--- a/src/local_deep_research/web/static/css/collections.css+++ b/src/local_deep_research/web/static/css/collections.css@@ -210,11 +210,11 @@font-size: 1rem;}-.ldr-stat-item.embedding-info i {+.ldr-stat-item.ldr-embedding-info i {color: var(--success-color);}-.ldr-stat-item.embedding-warning i {+.ldr-stat-item.ldr-embedding-warning i {color: var(--warning-color);animation: pulse 2s infinite;}@@ -574,12 +574,12 @@}/* Loading States */-.ldr-collection-card.loading {+.ldr-collection-card.ldr-loading {opacity: 0.7;pointer-events: none;}-.ldr-collection-card.loading::after {+.ldr-collection-card.ldr-loading::after {content: '';position: absolute;top: 50%;@@ -689,7 +689,7 @@}}-.ldr-collection-card.new {+.ldr-collection-card.ldr-new {animation: slideInRight 0.5s ease;}@@ -706,7 +706,7 @@}}-.ldr-collection-card.success {+.ldr-collection-card.ldr-success {animation: successPulse 0.6s ease;}diff --git a/src/local_deep_research/web/static/css/context_overflow.css b/src/local_deep_research/web/static/css/context_overflow.cssindex 3e9ed207fe..c6e17ff0bb 100644--- a/src/local_deep_research/web/static/css/context_overflow.css+++ b/src/local_deep_research/web/static/css/context_overflow.css@@ -93,11 +93,11 @@background-color: var(--border-color);}-.ldr-truncated-item.critical {+.ldr-truncated-item.ldr-critical {border-left: 4px solid var(--error-color);}-.ldr-truncated-item.warning {+.ldr-truncated-item.ldr-warning {border-left: 4px solid var(--warning-color);}diff --git a/src/local_deep_research/web/static/css/custom_dropdown.css b/src/local_deep_research/web/static/css/custom_dropdown.cssindex c2ec0e5b15..79232de22d 100644--- a/src/local_deep_research/web/static/css/custom_dropdown.css+++ b/src/local_deep_research/web/static/css/custom_dropdown.css@@ -213,8 +213,8 @@ body.ldr-dropdown-active {}/* Loading state for dropdowns */-.ldr-custom-dropdown.loading input,-.form-group.loading input {+.ldr-custom-dropdown.ldr-loading input,+.form-group.ldr-loading input {background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%236e4ff6' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z' opacity='0.3'/%3E%3Cpath fill='%236e4ff6' d='M20 12h2A10 10 0 0 0 12 2v2a8 8 0 0 1 8 8z'%3E%3CanimateTransform attributeName='transform' dur='1s' from='0 12 12' repeatCount='indefinite' to='360 12 12' type='rotate'/%3E%3C/path%3E%3C/svg%3E");background-position: right 10px center;background-repeat: no-repeat;diff --git a/src/local_deep_research/web/static/css/download_manager.css b/src/local_deep_research/web/static/css/download_manager.cssindex c6df25d1eb..97cb2a3b67 100644--- a/src/local_deep_research/web/static/css/download_manager.css+++ b/src/local_deep_research/web/static/css/download_manager.css@@ -665,7 +665,7 @@color: var(--text-primary, #e4e4e4);}-.ldr-download-entry.success {+.ldr-download-entry.ldr-success {border-left-color: var(--success-color);background: rgba(var(--success-color-rgb), 0.1);}@@ -675,11 +675,11 @@background: rgba(var(--error-color-rgb), 0.1);}-.ldr-download-entry.cancelled {+.ldr-download-entry.ldr-cancelled {border-left-color: var(--warning-color);background: rgba(var(--warning-color-rgb), 0.1);}-.ldr-download-entry.skipped {+.ldr-download-entry.ldr-skipped {border-left-color: var(--warning-color);background: rgba(var(--warning-color-rgb), 0.1);}diff --git a/src/local_deep_research/web/static/css/library.css b/src/local_deep_research/web/static/css/library.cssindex 8bd1dc54d3..2318090a7a 100644--- a/src/local_deep_research/web/static/css/library.css+++ b/src/local_deep_research/web/static/css/library.css@@ -594,15 +594,15 @@border: 1px solid var(--border-color, #333);}-.ldr-download-entry.success {+.ldr-download-entry.ldr-success {border-left: 3px solid var(--success-color);}-.ldr-download-entry.failed {+.ldr-download-entry.ldr-failed {border-left: 3px solid var(--error-color);}-.ldr-download-entry.skipped {+.ldr-download-entry.ldr-skipped {border-left: 3px solid var(--warning-color);}diff --git a/src/local_deep_research/web/static/css/styles.css b/src/local_deep_research/web/static/css/styles.cssindex a293480fed..9b5756da84 100644--- a/src/local_deep_research/web/static/css/styles.css+++ b/src/local_deep_research/web/static/css/styles.css@@ -996,19 +996,19 @@ textarea:focus, input[type="text"]:focus {border-left: 3px solid var(--border-color);}-.ldr-agent-step.thought {+.ldr-agent-step.ldr-thought {border-left-color: var(--accent-primary);}-.ldr-agent-step.action {+.ldr-agent-step.ldr-action {border-left-color: var(--warning-color);}-.ldr-agent-step.result {+.ldr-agent-step.ldr-result {border-left-color: var(--success-color);}-.ldr-agent-step.error {+.ldr-agent-step.ldr-error {border-left-color: var(--error-color);}@@ -1020,19 +1020,19 @@ textarea:focus, input[type="text"]:focus {letter-spacing: 0.5px;}-.ldr-agent-step.thought .ldr-agent-step-label {+.ldr-agent-step.ldr-thought .ldr-agent-step-label {color: var(--accent-primary);}-.ldr-agent-step.action .ldr-agent-step-label {+.ldr-agent-step.ldr-action .ldr-agent-step-label {color: var(--warning-color);}-.ldr-agent-step.result .ldr-agent-step-label {+.ldr-agent-step.ldr-result .ldr-agent-step-label {color: var(--success-color);}-.ldr-agent-step.error .ldr-agent-step-label {+.ldr-agent-step.ldr-error .ldr-agent-step-label {color: var(--error-color);}diff --git a/src/local_deep_research/web/static/js/collection_details.js b/src/local_deep_research/web/static/js/collection_details.jsindex 3660421fa3..c2bbb892bf 100644--- a/src/local_deep_research/web/static/js/collection_details.js+++ b/src/local_deep_research/web/static/js/collection_details.js@@ -202,7 +202,7 @@ function renderDocuments() {// eslint-disable-next-line no-unsanitized/property -- audited 2026-03-28: all interpolations use escapeHtml/esc, numeric coercion, or hardcoded stringscontainer.innerHTML = filteredDocs.map(doc => `- <div class="ldr-document-item ${doc.indexed ? 'indexed' : 'unindexed'}">+ <div class="ldr-document-item ${doc.indexed ? 'ldr-indexed' : 'ldr-unindexed'}"><a href="/library/document/${encodeURIComponent(doc.id)}" class="ldr-document-link" style="text-decoration: none; color: inherit; display: block; flex: 1;"><div class="ldr-document-info"><div class="ldr-document-title">diff --git a/src/local_deep_research/web/static/js/components/progress.js b/src/local_deep_research/web/static/js/components/progress.jsindex f692d20023..16ca02c519 100644--- a/src/local_deep_research/web/static/js/components/progress.js+++ b/src/local_deep_research/web/static/js/components/progress.js@@ -1241,7 +1241,7 @@// Create the step elementconst step = document.createElement('div');- step.className = `ldr-agent-step ${stepType}`;+ step.className = `ldr-agent-step ldr-${stepType}`;step.innerHTML = `<div class="ldr-agent-step-label">${escapeHtml(label)}</div><div class="ldr-agent-step-content">${escapeHtml(stepContent)}</div>diff --git a/src/local_deep_research/web/templates/pages/download_manager.html b/src/local_deep_research/web/templates/pages/download_manager.htmlindex 4b795c2416..8649ba7e1d 100644--- a/src/local_deep_research/web/templates/pages/download_manager.html+++ b/src/local_deep_research/web/templates/pages/download_manager.html@@ -573,7 +573,7 @@ async function startBulkDownload(researchIds, mode = 'pdf') {console.log('Download cancelled by user');const log = document.getElementById('download-log');const entry = document.createElement('div');- entry.className = 'ldr-download-entry cancelled';+ entry.className = 'ldr-download-entry ldr-cancelled';entry.innerHTML = '<strong>Download cancelled by user</strong>';log.appendChild(entry);} else {@@ -597,7 +597,7 @@ function updateProgress(data) {if (data.file) {const entry = document.createElement('div');- entry.className = `ldr-download-entry ${data.status === 'error' ? 'ldr-error' : data.status}`;+ entry.className = `ldr-download-entry ldr-${data.status}`;entry.innerHTML = `<strong>${window.escapeHtml(data.file)}</strong><span>${window.escapeHtml(data.status)}</span>@@ -675,7 +675,7 @@ function cancelDownloads() {// Add cancellation messageconst log = document.getElementById('download-log');const entry = document.createElement('div');- entry.className = 'ldr-download-entry cancelled';+ entry.className = 'ldr-download-entry ldr-cancelled';entry.innerHTML = '<strong class="ldr-error-text">Download process cancelled</strong>';log.appendChild(entry);@@ -866,7 +866,7 @@ function updateTextExtractionProgress(data) {if (data.file) {const entry = document.createElement('div');- entry.className = `ldr-download-entry ${data.status}`;+ entry.className = `ldr-download-entry ldr-${data.status}`;let statusIcon = data.status === 'success' ? '✓' : '✗';let statusText = data.status === 'success' ? 'Text extracted' : (data.error || 'Extraction failed');diff --git a/src/local_deep_research/web/templates/pages/library.html b/src/local_deep_research/web/templates/pages/library.htmlindex dbe19753b1..297faf05c2 100644--- a/src/local_deep_research/web/templates/pages/library.html+++ b/src/local_deep_research/web/templates/pages/library.html@@ -769,7 +769,7 @@ async function downloadAllAsText() {console.log('Text extraction cancelled by user');const log = document.getElementById('ldr-download-log');const entry = document.createElement('div');- entry.className = 'ldr-download-entry cancelled';+ entry.className = 'ldr-download-entry ldr-cancelled';entry.innerHTML = '<strong>Text extraction cancelled by user</strong>';log.appendChild(entry);} else {@@ -798,7 +798,7 @@ function updateTextExtractionProgress(data) {if (data.file) {const entry = document.createElement('div');- entry.className = `ldr-download-entry ${data.status}`;+ entry.className = `ldr-download-entry ldr-${data.status}`;let statusIcon = '';let statusText = '';@@ -913,7 +913,7 @@ async function downloadAllNew() {console.log('Download cancelled by user');const log = document.getElementById('ldr-download-log');const entry = document.createElement('div');- entry.className = 'ldr-download-entry cancelled';+ entry.className = 'ldr-download-entry ldr-cancelled';entry.innerHTML = '<strong>Download cancelled by user</strong>';log.appendChild(entry);} else {@@ -948,7 +948,7 @@ function updateDownloadProgress(data) {if (data.file) {const entry = document.createElement('div');- entry.className = `ldr-download-entry ${data.status}`;+ entry.className = `ldr-download-entry ldr-${data.status}`;let statusIcon = '';let statusText = '';diff --git a/src/local_deep_research/web/templates/pages/news-subscription-form.html b/src/local_deep_research/web/templates/pages/news-subscription-form.htmlindex 098128da89..33d8ce6d39 100644--- a/src/local_deep_research/web/templates/pages/news-subscription-form.html+++ b/src/local_deep_research/web/templates/pages/news-subscription-form.html@@ -507,7 +507,7 @@ document.addEventListener('DOMContentLoaded', async function() {e.stopPropagation();// Add loading class- modelRefreshBtn.classList.add('loading');+ modelRefreshBtn.classList.add('ldr-loading');try {// Reload models for current provider@@ -516,7 +516,7 @@ document.addEventListener('DOMContentLoaded', async function() {}// Remove loading class- modelRefreshBtn.classList.remove('loading');+ modelRefreshBtn.classList.remove('ldr-loading');// Click the input to show refreshed optionsconst modelInput = document.getElementById('subscription-model');@@ -526,7 +526,7 @@ document.addEventListener('DOMContentLoaded', async function() {}} catch (error) {console.error('Error refreshing models:', error);- modelRefreshBtn.classList.remove('loading');+ modelRefreshBtn.classList.remove('ldr-loading');}});}