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 pre-commit hook to check CSS in style tags and fix all violations

LearningCircuit8646c66898da
diff --git a/.pre-commit-hooks/check-css-class-prefix.py b/.pre-commit-hooks/check-css-class-prefix.py
index 2aaa42d677..6d3cbfae55 100755
--- a/.pre-commit-hooks/check-css-class-prefix.py
+++ b/.pre-commit-hooks/check-css-class-prefix.py
@@ -162,7 +162,7 @@ def check_css_file(file_path: Path) -> List[Tuple[int, str, str]]:
def check_html_file(file_path: Path) -> List[Tuple[int, str, str]]:
- """Check HTML file for non-prefixed class usage."""
+ """Check HTML file for non-prefixed class usage and CSS definitions in style tags."""
errors = []
try:
@@ -178,6 +178,11 @@ def check_html_file(file_path: Path) -> List[Tuple[int, str, str]]:
re.compile(r"class\s*=\s*'([^']*)'", re.IGNORECASE),
]
+ # 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\-_]*)")
+
+ in_style_tag = False
+
for line_num, line in enumerate(lines, 1):
# Skip HTML comments
if "<!--" in line or "-->" in line:
@@ -187,6 +192,35 @@ def check_html_file(file_path: Path) -> List[Tuple[int, str, str]]:
if "{#" in line or "#}" in line:
continue
+ # Check for style tag boundaries
+ if "<style" in line.lower():
+ in_style_tag = True
+ if "</style>" in line.lower():
+ in_style_tag = False
+
+ # If we're inside a style tag, check for CSS class definitions
+ if in_style_tag:
+ # Skip CSS comments
+ if (
+ "/*" in line
+ or "*/" in line
+ or line.strip().startswith("//")
+ ):
+ continue
+
+ # Check for CSS class definitions
+ css_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-'",
+ )
+ )
+ continue # Skip HTML class checking when in style tag
+
# Try both patterns to handle different quote types
matches = []
for pattern in class_attr_patterns:
diff --git a/src/local_deep_research/web/templates/pages/benchmark_results.html b/src/local_deep_research/web/templates/pages/benchmark_results.html
index fa273b8bed..7f679cd33a 100644
--- a/src/local_deep_research/web/templates/pages/benchmark_results.html
+++ b/src/local_deep_research/web/templates/pages/benchmark_results.html
@@ -8,7 +8,7 @@
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="app-version" content="{{ version }}">
<style>
-.benchmark-results-card {
+.ldr-benchmark-results-card {
width: 100%;
margin: 0;
padding: 0;
@@ -21,7 +21,7 @@
padding: 0;
}
-.run-card {
+.ldr-run-card {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 8px;
@@ -31,34 +31,34 @@
transition: border-color 0.2s, background-color 0.2s;
}
-.run-card:hover {
+.ldr-run-card:hover {
border-color: var(--accent-primary);
background: var(--bg-tertiary);
}
-.run-card.expanded {
+.ldr-run-card.ldr-expanded {
border-color: var(--accent-primary);
}
-.run-header {
+.ldr-run-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
-.run-title {
+.ldr-run-title {
font-size: 1.2rem;
font-weight: bold;
color: var(--text-primary);
}
-.run-date {
+.ldr-run-date {
color: var(--text-muted);
font-size: 0.9rem;
}
-.run-summary {
+.ldr-run-summary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 12px;
@@ -67,53 +67,53 @@
/* Responsive grid adjustments for more columns on wider screens */
@media (min-width: 768px) {
- .run-summary {
+ .ldr-run-summary {
grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
gap: 15px;
}
}
@media (min-width: 1200px) {
- .run-summary {
+ .ldr-run-summary {
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 16px;
}
}
@media (min-width: 1600px) {
- .run-summary {
+ .ldr-run-summary {
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 18px;
}
}
@media (min-width: 1920px) {
- .run-summary {
+ .ldr-run-summary {
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: 20px;
}
}
-.summary-item {
+.ldr-summary-item {
text-align: center;
padding: 10px;
background: var(--bg-tertiary);
border-radius: 6px;
}
-.summary-value {
+.ldr-summary-value {
font-size: 1.4rem;
font-weight: bold;
color: var(--primary-color);
}
-.summary-label {
+.ldr-summary-label {
font-size: 0.85rem;
color: #a0a0a0;
margin-top: 5px;
}
-.accuracy-indicator {
+.ldr-accuracy-indicator {
display: inline-block;
padding: 4px 8px;
border-radius: 12px;
@@ -121,22 +121,22 @@
font-weight: bold;
}
-.accuracy-high {
+.ldr-accuracy-high {
background: #1e3a1e;
color: #4caf50;
}
-.accuracy-medium {
+.ldr-accuracy-medium {
background: #3a2a1e;
color: #ff9800;
}
-.accuracy-low {
+.ldr-accuracy-low {
background: #3a1e1e;
color: #f44336;
}
-.status-indicator {
+.ldr-status-indicator {
display: inline-block;
padding: 4px 8px;
border-radius: 12px;
@@ -144,27 +144,27 @@
font-weight: bold;
}
-.status-completed {
+.ldr-status-completed {
background: #1e3a1e;
color: #4caf50;
}
-.status-in-progress {
+.ldr-status-in-progress {
background: #1e2a3a;
color: #2196f3;
}
-.status-failed {
+.ldr-status-failed {
background: #3a1e1e;
color: #f44336;
}
-.status-cancelled {
+.ldr-status-cancelled {
background: #2a2a2a;
color: #999;
}
-.run-config {
+.ldr-run-config {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 10px;
@@ -174,76 +174,76 @@
border-radius: 6px;
}
-.config-item {
+.ldr-config-item {
display: flex;
justify-content: space-between;
padding: 5px 0;
border-bottom: 1px solid #333;
}
-.config-label {
+.ldr-config-label {
color: #a0a0a0;
font-size: 0.9rem;
}
-.config-value {
+.ldr-config-value {
color: #e0e0e0;
font-weight: 500;
}
-.results-section {
+.ldr-results-section {
margin-top: 20px;
display: none;
}
-.results-section.visible {
+.ldr-results-section.ldr-visible {
display: block;
}
-.examples-grid {
+.ldr-examples-grid {
display: grid;
gap: 15px;
margin-top: 15px;
}
-.example-card {
+.ldr-example-card {
background: #1a1a1a;
border: 1px solid #333;
border-radius: 6px;
padding: 15px;
}
-.example-card.correct {
+.ldr-example-card.ldr-correct {
border-left: 4px solid #4caf50;
}
-.example-card.incorrect {
+.ldr-example-card.ldr-incorrect {
border-left: 4px solid #f44336;
}
-.example-header {
+.ldr-example-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
-.example-status {
+.ldr-example-status {
display: flex;
align-items: center;
gap: 5px;
font-weight: 600;
}
-.example-status.correct {
+.ldr-example-status.ldr-correct {
color: #4caf50;
}
-.example-status.incorrect {
+.ldr-example-status.ldr-incorrect {
color: #f44336;
}
-.example-question {
+.ldr-example-question {
background: #2a2a2a;
padding: 12px;
border-radius: 4px;
@@ -252,30 +252,30 @@
color: #e0e0e0;
}
-.example-answers {
+.ldr-example-answers {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
-.answer-section {
+.ldr-answer-section {
padding: 10px;
border-radius: 4px;
font-size: 0.9rem;
line-height: 1.4;
}
-.model-answer-section {
+.ldr-model-answer-section {
background: #1e2a3a;
border-left: 3px solid #2196f3;
}
-.correct-answer-section {
+.ldr-correct-answer-section {
background: #1e3a1e;
border-left: 3px solid #4caf50;
}
-.answer-label {
+.ldr-answer-label {
font-size: 0.75rem;
font-weight: 600;
color: #a0a0a0;
@@ -283,45 +283,45 @@
margin-bottom: 6px;
}
-.answer-text {
+.ldr-answer-text {
color: #e0e0e0;
}
-.no-results {
+.ldr-no-results {
text-align: center;
color: #a0a0a0;
padding: 40px;
font-style: italic;
}
-.expand-indicator {
+.ldr-expand-indicator {
color: #a0a0a0;
font-size: 0.9rem;
margin-top: 10px;
text-align: center;
}
-.dataset-breakdown {
+.ldr-dataset-breakdown {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 10px;
margin-top: 10px;
}
-.dataset-item {
+.ldr-dataset-item {
text-align: center;
padding: 8px;
background: #2a2a2a;
border-radius: 4px;
}
-.dataset-name {
+.ldr-dataset-name {
font-size: 0.8rem;
color: #a0a0a0;
margin-bottom: 4px;
}
-.dataset-accuracy {
+.ldr-dataset-accuracy {
font-weight: bold;
color: var(--primary-color);
}
@@ -336,7 +336,7 @@
padding: 0;
}
-.pagination {
+.ldr-pagination {
display: flex;
justify-content: center;
align-items: center;
@@ -344,7 +344,7 @@
margin-top: 30px;
}
-.pagination button {
+.ldr-pagination button {
padding: 8px 12px;
background: #2a2a2a;
border: 1px solid #333;
@@ -353,16 +353,16 @@
cursor: pointer;
}
-.pagination button:hover {
+.ldr-pagination button:hover {
background: var(--primary-color);
}
-.pagination button:disabled {
+.ldr-pagination button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
-.delete-btn {
+.ldr-delete-btn {
background: #3a1e1e !important;
border-color: #f44336 !important;
color: #f44336 !important;
@@ -371,19 +371,19 @@
transition: all 0.2s;
}
-.delete-btn:hover:not(:disabled) {
+.ldr-delete-btn:hover:not(:disabled) {
background: #f44336 !important;
color: white !important;
}
-.delete-btn:disabled {
+.ldr-delete-btn:disabled {
background: #2a2a2a !important;
border-color: #555 !important;
color: #888 !important;
cursor: not-allowed;
}
-.filters {
+.ldr-filters {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 15px;
@@ -392,34 +392,34 @@
/* Responsive filter adjustments for full-width layout */
@media (max-width: 767px) {
- .filters {
+ .ldr-filters {
grid-template-columns: 1fr 1fr;
gap: 12px;
}
}
@media (min-width: 768px) {
- .filters {
+ .ldr-filters {
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: 16px;
}
}
@media (min-width: 1200px) {
- .filters {
+ .ldr-filters {
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 18px;
}
}
@media (min-width: 1600px) {
- .filters {
+ .ldr-filters {
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
}
}
-.processing-time {
+.ldr-processing-time {
background: #2a3f2a;
color: #90ee90;
padding: 2px 6px;
@@ -492,7 +492,7 @@
margin-right: 0.5rem;
}
-.search-stats-section {
+.ldr-search-stats-section {
margin-bottom: 20px;
padding: 15px;
background: #1e1e1e;
@@ -500,7 +500,7 @@
border-radius: 6px;
}
-.section-title {
+.ldr-section-title {
display: flex;
align-items: center;
gap: 8px;
@@ -510,48 +510,48 @@
font-weight: 600;
}
-.search-stats-grid {
+.ldr-search-stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 15px;
}
-.stat-item {
+.ldr-stat-item {
text-align: center;
padding: 12px;
background: #2a2a2a;
border-radius: 6px;
}
-.stat-value {
+.ldr-stat-value {
font-size: 1.4rem;
font-weight: bold;
color: var(--primary-color);
margin-bottom: 5px;
}
-.stat-label {
+.ldr-stat-label {
font-size: 0.85rem;
color: #a0a0a0;
}
-.results-divider {
+.ldr-results-divider {
height: 1px;
background: #333;
margin: 20px 0;
}
-.examples-section {
+.ldr-examples-section {
margin-top: 15px;
}
-.example-metrics {
+.ldr-example-metrics {
display: flex;
gap: 10px;
align-items: center;
}
-.search-results-count {
+.ldr-search-results-count {
background: #2a3a3a;
color: #81c784;
padding: 2px 6px;
@@ -560,6 +560,16 @@
font-weight: 500;
white-space: nowrap;
}
+
+.ldr-dataset-badge {
+ background: var(--bg-tertiary);
+ color: var(--text-secondary);
+ padding: 2px 6px;
+ border-radius: 3px;
+ font-size: 0.8rem;
+ font-weight: 500;
+ text-transform: uppercase;
+}
</style>
{% endblock %}
@@ -754,12 +764,12 @@ function displayResults() {
function createRunCard(run) {
const accuracy = run.overall_accuracy || 0;
- const accuracyClass = accuracy >= 90 ? 'accuracy-high' :
- accuracy >= 70 ? 'accuracy-medium' : 'accuracy-low';
+ const accuracyClass = accuracy >= 90 ? 'ldr-accuracy-high' :
+ accuracy >= 70 ? 'ldr-accuracy-medium' : 'ldr-accuracy-low';
// Status handling
const status = run.status || 'unknown';
- const statusClass = `status-${status.replace('_', '-')}`;
+ const statusClass = `ldr-status-${status.replace('_', '-')}`;
const statusText = status.replace('_', ' ').replace(/\b\w/g, l => l.toUpperCase());
const date = new Date(run.created_at).toLocaleDateString();
@@ -870,16 +880,16 @@ function createRunCard(run) {
async function toggleRunDetails(runId) {
const resultsSection = document.getElementById(`results-${runId}`);
- const runCard = resultsSection.closest('.run-card');
+ const runCard = resultsSection.closest('.ldr-run-card');
- if (resultsSection.classList.contains('visible')) {
- resultsSection.classList.remove('visible');
- runCard.classList.remove('expanded');
+ if (resultsSection.classList.contains('ldr-visible')) {
+ resultsSection.classList.remove('ldr-visible');
+ runCard.classList.remove('ldr-expanded');
return;
}
- resultsSection.classList.add('visible');
- runCard.classList.add('expanded');
+ resultsSection.classList.add('ldr-visible');
+ runCard.classList.add('ldr-expanded');
// Load examples if not already loaded
const examplesContainer = document.getElementById(`examples-${runId}`);
@@ -1004,7 +1014,7 @@ function formatAvgProcessingTime(run) {
}
function createExampleCard(result) {
- const statusClass = result.is_correct ? 'correct' : 'incorrect';
+ const statusClass = result.is_correct ? 'ldr-correct' : 'ldr-incorrect';
const statusIcon = result.is_correct ? '<i class="fas fa-check-circle"></i>' : '<i class="fas fa-times-circle"></i>';
const statusText = result.is_correct ? 'Correct' : 'Incorrect';