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: Fix test failures caused by CSS prefix migration

LearningCircuit133680bdfa75
diff --git a/.pre-commit-hooks/check-css-class-prefix.py b/.pre-commit-hooks/check-css-class-prefix.py
index c83a74b16f..ed7618fe62 100755
--- a/.pre-commit-hooks/check-css-class-prefix.py
+++ b/.pre-commit-hooks/check-css-class-prefix.py
@@ -130,9 +130,11 @@ def check_html_file(file_path: Path) -> List[Tuple[int, str, str]]:
lines = content.split("\n")
# Pattern to match class attributes in HTML
- # Matches: class="..." or class='...'
+ # This pattern handles Jinja2 templates with nested quotes
+ # Matches: class="..." or class='...' including Jinja2 expressions
class_attr_pattern = re.compile(
- r'class\s*=\s*["\']([^"\']*)["\']', re.IGNORECASE
+ r'class\s*=\s*"([^"]*(?:\{[^}]*\}[^"]*)*)"|class\s*=\s*\'([^\']*(?:\{[^}]*\}[^\']*)*)\'',
+ re.IGNORECASE,
)
for line_num, line in enumerate(lines, 1):
@@ -145,12 +147,32 @@ def check_html_file(file_path: Path) -> List[Tuple[int, str, str]]:
continue
matches = class_attr_pattern.findall(line)
- for class_attr in matches:
- # Split multiple classes
- classes = class_attr.split()
+ for match in matches:
+ # The regex has two groups - one for double quotes, one for single quotes
+ # Get whichever one matched
+ class_attr = match[0] if match[0] else match[1]
+ # Skip if the entire class attribute contains Jinja2 template variables
+ # This handles cases like class="alert alert-{{ category }}"
+ if "{{" in class_attr or "{%" in class_attr:
+ # Extract only the static class names (those not part of Jinja2 expressions)
+ # Remove the Jinja2 parts and check remaining static classes
+ # Remove Jinja2 expressions but keep the rest
+ cleaned_attr = re.sub(
+ r"\{\{[^}]*\}\}|\{%[^%]*%\}", "", class_attr
+ )
+ classes = cleaned_attr.split()
+ else:
+ # No Jinja2 in this attribute, check all classes
+ classes = class_attr.split()
+
for class_name in classes:
- # Skip Jinja2 variables and expressions
- if "{{" in class_name or "{%" in class_name:
+ # Additional safety check for individual class names
+ if (
+ "{{" in class_name
+ or "{%" in class_name
+ or "{" in class_name
+ or "}" in class_name
+ ):
continue
# Skip JavaScript template literals and variables
@@ -158,8 +180,6 @@ def check_html_file(file_path: Path) -> List[Tuple[int, str, str]]:
char in class_name
for char in [
"$",
- "{",
- "}",
"=",
"!",
"<",
diff --git a/src/local_deep_research/web/templates/auth/change_password.html b/src/local_deep_research/web/templates/auth/change_password.html
index 93c548a87e..3b8aad8551 100644
--- a/src/local_deep_research/web/templates/auth/change_password.html
+++ b/src/local_deep_research/web/templates/auth/change_password.html
@@ -105,7 +105,7 @@
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
- <div class="alert alert-{{ 'danger' if category == 'error' else ldr-category }} alert-dismissible fade show" role="alert">
+ <div class="alert alert-{{ 'danger' if category == 'error' else category }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
diff --git a/src/local_deep_research/web/templates/auth/login.html b/src/local_deep_research/web/templates/auth/login.html
index 6f51677aa4..3d6e5c55f9 100644
--- a/src/local_deep_research/web/templates/auth/login.html
+++ b/src/local_deep_research/web/templates/auth/login.html
@@ -47,21 +47,21 @@
opacity: 0.8;
}
- .visual-container {
+ .ldr-visual-container {
position: relative;
width: 300px;
height: 300px;
}
/* DNA Helix Animation */
- .dna-helix {
+ .ldr-dna-helix {
position: absolute;
width: 100%;
height: 100%;
transform: rotateX(60deg) rotateZ(45deg);
}
- .helix-line {
+ .ldr-helix-line {
position: absolute;
width: 2px;
height: 100%;
@@ -75,16 +75,16 @@
transform: translateX(-50%);
}
- .helix-1 {
+ .ldr-helix-1 {
animation: rotate-helix 8s linear infinite;
}
- .helix-2 {
+ .ldr-helix-2 {
animation: rotate-helix 8s linear infinite;
animation-delay: -4s;
}
- .helix-dot {
+ .ldr-helix-dot {
position: absolute;
width: 8px;
height: 8px;
@@ -95,12 +95,12 @@
box-shadow: 0 0 20px var(--accent-primary);
}
- .dot-1 { top: 10%; animation: helix-dots 8s linear infinite; }
- .dot-2 { top: 30%; animation: helix-dots 8s linear infinite 1.3s; }
- .dot-3 { top: 50%; animation: helix-dots 8s linear infinite 2.6s; }
- .dot-4 { top: 70%; animation: helix-dots 8s linear infinite 3.9s; }
- .dot-5 { top: 90%; animation: helix-dots 8s linear infinite 5.2s; }
- .dot-6 { top: 50%; animation: helix-dots 8s linear infinite 6.5s; }
+ .ldr-dot-1 { top: 10%; animation: helix-dots 8s linear infinite; }
+ .ldr-dot-2 { top: 30%; animation: helix-dots 8s linear infinite 1.3s; }
+ .ldr-dot-3 { top: 50%; animation: helix-dots 8s linear infinite 2.6s; }
+ .ldr-dot-4 { top: 70%; animation: helix-dots 8s linear infinite 3.9s; }
+ .ldr-dot-5 { top: 90%; animation: helix-dots 8s linear infinite 5.2s; }
+ .ldr-dot-6 { top: 50%; animation: helix-dots 8s linear infinite 6.5s; }
@keyframes rotate-helix {
0% { transform: translateX(-50%) rotateY(0deg); }
@@ -123,23 +123,23 @@
}
/* Neural Network */
- .neural-network {
+ .ldr-neural-network {
position: absolute;
width: 100%;
height: 100%;
opacity: 0.6;
}
- .network-svg {
+ .ldr-network-svg {
width: 100%;
height: 100%;
}
- .node {
+ .ldr-node {
animation: pulse-node 3s ease-in-out infinite;
}
- .node:nth-child(odd) {
+ .ldr-node:nth-child(odd) {
animation-delay: 0.5s;
}
@@ -149,14 +149,14 @@
}
/* Floating Symbols */
- .floating-symbols {
+ .ldr-floating-symbols {
position: absolute;
width: 100%;
height: 100%;
pointer-events: none;
}
- .symbol {
+ .ldr-symbol {
position: absolute;
font-size: 1.5rem;
font-weight: 600;
@@ -165,32 +165,32 @@
font-family: 'Courier New', monospace;
}
- .symbol-1 {
+ .ldr-symbol-1 {
top: 10%;
left: 10%;
animation: float-symbol 6s ease-in-out infinite;
}
- .symbol-2 {
+ .ldr-symbol-2 {
top: 20%;
right: 15%;
animation: float-symbol 8s ease-in-out infinite 1s;
}
- .symbol-3 {
+ .ldr-symbol-3 {
bottom: 30%;
left: 20%;
animation: float-symbol 7s ease-in-out infinite 2s;
}
- .symbol-4 {
+ .ldr-symbol-4 {
bottom: 20%;
right: 10%;
animation: float-symbol 9s ease-in-out infinite 1.5s;
}
- .symbol-5 {
+ .ldr-symbol-5 {
top: 50%;
left: 5%;
animation: float-symbol 8s ease-in-out infinite 3s;
}
- .symbol-6 {
+ .ldr-symbol-6 {
top: 40%;
right: 5%;
animation: float-symbol 7s ease-in-out infinite 2.5s;
@@ -293,7 +293,7 @@
padding: 3rem;
}
- .encryption-banner {
+ .ldr-encryption-banner {
background: linear-gradient(135deg, rgba(110, 79, 246, 0.1) 0%, rgba(64, 191, 255, 0.1) 100%);
border: 1px solid rgba(110, 79, 246, 0.3);
border-radius: 12px;
@@ -304,29 +304,29 @@
gap: 1.25rem;
}
- .encryption-banner i {
+ .ldr-encryption-banner i {
color: var(--accent-primary);
font-size: 2rem;
}
- .encryption-banner-content {
+ .ldr-encryption-banner-content {
flex: 1;
}
- .encryption-banner-content strong {
+ .ldr-encryption-banner-content strong {
color: var(--text-primary);
display: block;
margin-bottom: 0.5rem;
font-size: 1.1rem;
}
- .encryption-banner-content span {
+ .ldr-encryption-banner-content span {
color: var(--text-secondary);
font-size: 1rem;
line-height: 1.5;
}
- .security-warning {
+ .ldr-security-warning {
background: rgba(249, 188, 11, 0.1);
border: 1px solid rgba(249, 188, 11, 0.3);
border-radius: 8px;
@@ -335,7 +335,7 @@
color: var(--warning-color);
}
- .security-warning i {
+ .ldr-security-warning i {
margin-right: 0.5rem;
}
@@ -495,7 +495,7 @@
color: var(--accent-secondary);
}
- .browser-hint {
+ .ldr-browser-hint {
display: flex;
align-items: center;
justify-content: center;
@@ -505,7 +505,7 @@
margin-top: 1rem;
}
- .browser-hint i {
+ .ldr-browser-hint i {
font-size: 1rem;
}
</style>
@@ -520,16 +520,16 @@
<div class="ldr-card">
<div class="ldr-card-content">
- <div class="encryption-banner">
+ <div class="ldr-encryption-banner">
<i class="fas fa-shield-alt"></i>
- <div class="encryption-banner-content">
+ <div class="ldr-encryption-banner-content">
<strong>Your data is encrypted</strong>
<span>Each user has their own encrypted database protected by their password</span>
</div>
</div>
{% if not has_encryption %}
- <div class="security-warning">
+ <div class="ldr-security-warning">
<i class="fas fa-exclamation-triangle"></i>
<strong>Security Warning:</strong>
Database encryption is not available. Your data will be stored unencrypted.
@@ -540,7 +540,7 @@
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
- <div class="alert alert-{{ 'success' if category == 'success' else 'info' if ldr-category == 'info' else '' }} alert-dismissible">
+ <div class="alert alert-{{ 'success' if category == 'success' else 'info' if category == 'info' else '' }} alert-dismissible">
{{ message }}
<button type="button" class="btn-close" onclick="this.parentElement.style.display='none'">×</button>
</div>
@@ -592,7 +592,7 @@
{% if allow_registrations %}
<p>Don't have an account? <a href="{{ url_for('auth.register') }}">Register here</a></p>
{% endif %}
- <div class="browser-hint">
+ <div class="ldr-browser-hint">
<i class="fas fa-info-circle"></i>
<span>Your browser can save your password for easy login</span>
</div>
@@ -601,19 +601,19 @@
</div>
<div class="ldr-auth-visual">
- <div class="visual-container">
- <div class="dna-helix">
- <div class="helix-line helix-1"></div>
- <div class="helix-line helix-2"></div>
- <div class="helix-dot dot-1"></div>
- <div class="helix-dot dot-2"></div>
- <div class="helix-dot dot-3"></div>
- <div class="helix-dot dot-4"></div>
- <div class="helix-dot dot-5"></div>
- <div class="helix-dot dot-6"></div>
+ <div class="ldr-visual-container">
+ <div class="ldr-dna-helix">
+ <div class="ldr-helix-line ldr-helix-1"></div>
+ <div class="ldr-helix-line ldr-helix-2"></div>
+ <div class="ldr-helix-dot ldr-dot-1"></div>
+ <div class="ldr-helix-dot ldr-dot-2"></div>
+ <div class="ldr-helix-dot ldr-dot-3"></div>
+ <div class="ldr-helix-dot ldr-dot-4"></div>
+ <div class="ldr-helix-dot ldr-dot-5"></div>
+ <div class="ldr-helix-dot ldr-dot-6"></div>
</div>
- <div class="neural-network">
- <svg viewBox="0 0 200 200" class="network-svg">
+ <div class="ldr-neural-network">
+ <svg viewBox="0 0 200 200" class="ldr-network-svg">
<defs>
<linearGradient id="gradient1" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:var(--accent-primary);stop-opacity:0.6" />
@@ -631,22 +631,22 @@
<line x1="100" y1="170" x2="150" y2="125" stroke="url(#gradient1)" stroke-width="1" opacity="0.5" />
<!-- Network nodes -->
- <circle cx="50" cy="50" r="4" fill="var(--accent-primary)" class="node" />
- <circle cx="50" cy="150" r="4" fill="var(--accent-primary)" class="node" />
- <circle cx="100" cy="30" r="4" fill="var(--accent-secondary)" class="node" />
- <circle cx="100" cy="100" r="4" fill="var(--accent-secondary)" class="node" />
- <circle cx="100" cy="170" r="4" fill="var(--accent-secondary)" class="node" />
- <circle cx="150" cy="75" r="4" fill="var(--accent-tertiary)" class="node" />
- <circle cx="150" cy="125" r="4" fill="var(--accent-tertiary)" class="node" />
+ <circle cx="50" cy="50" r="4" fill="var(--accent-primary)" class="ldr-node" />
+ <circle cx="50" cy="150" r="4" fill="var(--accent-primary)" class="ldr-node" />
+ <circle cx="100" cy="30" r="4" fill="var(--accent-secondary)" class="ldr-node" />
+ <circle cx="100" cy="100" r="4" fill="var(--accent-secondary)" class="ldr-node" />
+ <circle cx="100" cy="170" r="4" fill="var(--accent-secondary)" class="ldr-node" />
+ <circle cx="150" cy="75" r="4" fill="var(--accent-tertiary)" class="ldr-node" />
+ <circle cx="150" cy="125" r="4" fill="var(--accent-tertiary)" class="ldr-node" />
</svg>
</div>
- <div class="floating-symbols">
- <div class="symbol symbol-1">{ }</div>
- <div class="symbol symbol-2">&lt;/&gt;</div>
- <div class="symbol symbol-3">∞</div>
- <div class="symbol symbol-4">λ</div>
- <div class="symbol symbol-5">∇</div>
- <div class="symbol symbol-6">Σ</div>
+ <div class="ldr-floating-symbols">
+ <div class="ldr-symbol ldr-symbol-1">{ }</div>
+ <div class="ldr-symbol ldr-symbol-2">&lt;/&gt;</div>
+ <div class="ldr-symbol ldr-symbol-3">∞</div>
+ <div class="ldr-symbol ldr-symbol-4">λ</div>
+ <div class="ldr-symbol ldr-symbol-5">∇</div>
+ <div class="ldr-symbol ldr-symbol-6">Σ</div>
</div>
</div>
<div class="ldr-visual-text">
diff --git a/src/local_deep_research/web/templates/settings_dashboard.html b/src/local_deep_research/web/templates/settings_dashboard.html
index 23ccae86e1..eec385be71 100644
--- a/src/local_deep_research/web/templates/settings_dashboard.html
+++ b/src/local_deep_research/web/templates/settings_dashboard.html
@@ -33,8 +33,8 @@
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
- <div class="alert alert-{{ ldr-category }}">
- <i class="fas {% if ldr-category == 'success' %}fa-check-circle{% else %}fa-exclamation-circle{% endif %}"></i> {{ message }}
+ <div class="alert alert-{{ category }}">
+ <i class="fas {% if category == 'success' %}fa-check-circle{% else %}fa-exclamation-circle{% endif %}"></i> {{ message }}
</div>
{% endfor %}
{% endif %}