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: Add ldr- prefix to all CSS classes per project requirements

LearningCircuitd31ec0a3b410
diff --git a/src/local_deep_research/web/static/css/mobile-navigation.css b/src/local_deep_research/web/static/css/mobile-navigation.css
index ad991f9e50..145d910757 100644
--- a/src/local_deep_research/web/static/css/mobile-navigation.css
+++ b/src/local_deep_research/web/static/css/mobile-navigation.css
@@ -21,7 +21,7 @@
/* ========================================
Bottom Navigation Bar
======================================== */
-.mobile-bottom-nav {
+.ldr-mobile-bottom-nav {
display: none;
position: fixed;
bottom: 0;
@@ -38,19 +38,19 @@
padding-bottom: env(safe-area-inset-bottom);
}
-.mobile-bottom-nav.visible {
+.ldr-mobile-bottom-nav.visible {
transform: translateY(0);
}
/* Navigation tabs container */
-.mobile-bottom-nav {
+.ldr-mobile-bottom-nav {
display: flex;
justify-content: space-around;
align-items: center;
}
/* Individual tab button */
-.mobile-nav-tab {
+.ldr-mobile-nav-tab {
flex: 1;
display: flex;
flex-direction: column;
@@ -69,24 +69,24 @@
}
/* Tab hover/focus states */
-.mobile-nav-tab:hover,
-.mobile-nav-tab:focus {
+.ldr-mobile-nav-tab:hover,
+.ldr-mobile-nav-tab:focus {
background: rgba(110, 79, 246, 0.1);
outline: none;
}
-.mobile-nav-tab:focus-visible {
+.ldr-mobile-nav-tab:focus-visible {
outline: 2px solid var(--mobile-nav-active);
outline-offset: -2px;
}
/* Active tab */
-.mobile-nav-tab.active {
+.ldr-mobile-nav-tab.active {
color: var(--mobile-nav-text-active);
}
/* Active indicator bar */
-.mobile-nav-tab.active::before {
+.ldr-mobile-nav-tab.active::before {
content: '';
position: absolute;
top: 0;
@@ -98,17 +98,17 @@
}
/* Tab icon */
-.mobile-nav-tab i {
+.ldr-mobile-nav-tab i {
font-size: 20px;
transition: transform 0.2s ease;
}
-.mobile-nav-tab:active i {
+.ldr-mobile-nav-tab:active i {
transform: scale(0.9);
}
/* Tab label */
-.mobile-nav-label {
+.ldr-mobile-nav-label {
font-size: 10px;
font-weight: 500;
letter-spacing: 0.01em;
@@ -117,7 +117,7 @@
/* ========================================
Sheet Menu
======================================== */
-.mobile-sheet-menu {
+.ldr-mobile-sheet-menu {
position: fixed;
bottom: 0;
left: 0;
@@ -136,12 +136,12 @@
padding-bottom: env(safe-area-inset-bottom);
}
-.mobile-sheet-menu.active {
+.ldr-mobile-sheet-menu.active {
transform: translateY(0);
}
/* Drag handle */
-.mobile-sheet-handle {
+.ldr-mobile-sheet-handle {
width: 36px;
height: 4px;
background: var(--mobile-sheet-handle);
@@ -151,12 +151,12 @@
flex-shrink: 0;
}
-.mobile-sheet-handle:active {
+.ldr-mobile-sheet-handle:active {
cursor: grabbing;
}
/* Sheet content */
-.mobile-sheet-content {
+.ldr-mobile-sheet-content {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
@@ -170,30 +170,30 @@
scrollbar-color: var(--mobile-sheet-handle) transparent;
}
-.mobile-sheet-content::-webkit-scrollbar {
+.ldr-mobile-sheet-content::-webkit-scrollbar {
width: 4px;
}
-.mobile-sheet-content::-webkit-scrollbar-track {
+.ldr-mobile-sheet-content::-webkit-scrollbar-track {
background: transparent;
}
-.mobile-sheet-content::-webkit-scrollbar-thumb {
+.ldr-mobile-sheet-content::-webkit-scrollbar-thumb {
background: var(--mobile-sheet-handle);
border-radius: 2px;
}
/* Sheet sections */
-.mobile-sheet-section {
+.ldr-mobile-sheet-section {
padding: 16px 16px 8px;
border-bottom: 1px solid var(--mobile-nav-border);
}
-.mobile-sheet-section:last-child {
+.ldr-mobile-sheet-section:last-child {
border-bottom: none;
}
-.mobile-sheet-title {
+.ldr-mobile-sheet-title {
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
@@ -204,14 +204,14 @@
}
/* Sheet items container */
-.mobile-sheet-items {
+.ldr-mobile-sheet-items {
display: flex;
flex-direction: column;
gap: 4px;
}
/* Sheet item button */
-.mobile-sheet-item {
+.ldr-mobile-sheet-item {
display: flex;
align-items: center;
gap: 16px;
@@ -228,23 +228,23 @@
width: 100%;
}
-.mobile-sheet-item:hover,
-.mobile-sheet-item:focus {
+.ldr-mobile-sheet-item:hover,
+.ldr-mobile-sheet-item:focus {
background: rgba(110, 79, 246, 0.1);
outline: none;
}
-.mobile-sheet-item:focus-visible {
+.ldr-mobile-sheet-item:focus-visible {
outline: 2px solid var(--mobile-nav-active);
outline-offset: -2px;
}
-.mobile-sheet-item:active {
+.ldr-mobile-sheet-item:active {
background: rgba(110, 79, 246, 0.2);
}
/* Sheet item icon */
-.mobile-sheet-item i {
+.ldr-mobile-sheet-item i {
width: 24px;
font-size: 18px;
text-align: center;
@@ -252,13 +252,13 @@
}
/* Sheet item label */
-.mobile-sheet-label {
+.ldr-mobile-sheet-label {
flex: 1;
font-weight: 400;
}
/* Sheet item badge */
-.mobile-sheet-badge {
+.ldr-mobile-sheet-badge {
background: var(--mobile-nav-active);
color: white;
font-size: 10px;
@@ -272,7 +272,7 @@
/* ========================================
Overlay
======================================== */
-.mobile-sheet-overlay {
+.ldr-mobile-sheet-overlay {
position: fixed;
top: 0;
left: 0;
@@ -285,7 +285,7 @@
z-index: 1999;
}
-.mobile-sheet-overlay.active {
+.ldr-mobile-sheet-overlay.active {
opacity: 1;
pointer-events: all;
}
@@ -297,11 +297,11 @@
/* Show mobile navigation on small screens */
@media (max-width: 767px) {
/* Show mobile nav */
- .mobile-bottom-nav {
+ .ldr-mobile-bottom-nav {
display: flex;
}
- .mobile-bottom-nav.visible {
+ .ldr-mobile-bottom-nav.visible {
display: flex;
}
@@ -316,18 +316,18 @@
}
/* Adjust main content */
- .main-content {
+ .ldr-main-content {
margin-left: 0 !important;
width: 100% !important;
}
/* Hide mobile tab bar that was in the template */
- .mobile-tab-bar {
+ .ldr-mobile-tab-bar {
display: none !important;
}
/* Ensure content doesn't go under nav */
- .page.active {
+ .ldr-page.active {
padding-bottom: calc(var(--mobile-nav-height) + 20px + env(safe-area-inset-bottom));
}
@@ -345,16 +345,16 @@
}
/* Hide mobile navigation */
- .mobile-bottom-nav {
+ .ldr-mobile-bottom-nav {
display: none !important;
}
}
/* Desktop - ensure mobile nav is hidden */
@media (min-width: 992px) {
- .mobile-bottom-nav,
- .mobile-sheet-menu,
- .mobile-sheet-overlay {
+ .ldr-mobile-bottom-nav,
+ .ldr-mobile-sheet-menu,
+ .ldr-mobile-sheet-overlay {
display: none !important;
}
}
@@ -398,8 +398,8 @@
}
/* Add ripple on tap (optional enhancement) */
-.mobile-nav-tab::after,
-.mobile-sheet-item::after {
+.ldr-mobile-nav-tab::after,
+.ldr-mobile-sheet-item::after {
content: '';
position: absolute;
top: 50%;
@@ -412,8 +412,8 @@
opacity: 0;
}
-.mobile-nav-tab:active::after,
-.mobile-sheet-item:active::after {
+.ldr-mobile-nav-tab:active::after,
+.ldr-mobile-sheet-item:active::after {
animation: ripple 0.6s ease-out;
}
@@ -423,23 +423,23 @@
/* High contrast mode support */
@media (prefers-contrast: high) {
- .mobile-nav-tab.active {
+ .ldr-mobile-nav-tab.active {
text-decoration: underline;
font-weight: bold;
}
- .mobile-sheet-item:focus {
+ .ldr-mobile-sheet-item:focus {
outline: 3px solid;
}
}
/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
- .mobile-bottom-nav,
- .mobile-sheet-menu,
- .mobile-sheet-overlay,
- .mobile-nav-tab,
- .mobile-sheet-item {
+ .ldr-mobile-bottom-nav,
+ .ldr-mobile-sheet-menu,
+ .ldr-mobile-sheet-overlay,
+ .ldr-mobile-nav-tab,
+ .ldr-mobile-sheet-item {
transition: none !important;
animation: none !important;
}
diff --git a/src/local_deep_research/web/static/css/mobile-ui-fixes.css b/src/local_deep_research/web/static/css/mobile-ui-fixes.css
index 9c8f5f507f..875d2f6135 100644
--- a/src/local_deep_research/web/static/css/mobile-ui-fixes.css
+++ b/src/local_deep_research/web/static/css/mobile-ui-fixes.css
@@ -4,7 +4,7 @@
*/
/* 1. Fix duplicate navigation - hide old nav */
-.mobile-tab-bar {
+.ldr-mobile-tab-bar {
display: none !important;
}
@@ -14,8 +14,8 @@
padding-bottom: 80px; /* Height of mobile nav + safe area */
}
- .main-content,
- .page.active,
+ .ldr-main-content,
+ .ldr-page.active,
main {
padding-bottom: 100px !important; /* Extra padding for content */
margin-bottom: 0;
@@ -23,7 +23,7 @@
/* Fix for modals and overlays */
.modal-content,
- .sheet-content {
+ .ldr-sheet-content {
max-height: calc(100vh - 160px); /* Account for nav and safe areas */
overflow-y: auto;
}
@@ -46,14 +46,14 @@
margin-left: auto;
}
- .user-menu {
+ .ldr-user-menu {
display: flex;
align-items: center;
gap: 0.5rem;
max-width: 100%;
}
- .user-info {
+ .ldr-user-info {
font-size: 13px;
white-space: nowrap;
overflow: hidden;
@@ -61,7 +61,7 @@
max-width: 150px;
}
- .logout-btn {
+ .ldr-logout-btn {
font-size: 13px;
padding: 0.25rem 0.5rem;
white-space: nowrap;
@@ -69,7 +69,7 @@
/* Hide icon on very small screens */
@media (max-width: 380px) {
- .user-info i {
+ .ldr-user-info i {
display: none;
}
}
@@ -79,7 +79,7 @@
@media (max-width: 767px) {
/* Make tab navigation scrollable */
.nav-tabs,
- .tab-navigation,
+ .ldr-tab-navigation,
[role="tablist"] {
display: flex;
overflow-x: auto;
@@ -95,13 +95,13 @@
}
.nav-tabs::-webkit-scrollbar,
- .tab-navigation::-webkit-scrollbar {
+ .ldr-tab-navigation::-webkit-scrollbar {
display: none;
}
.nav-tabs .nav-link,
- .tab-navigation button,
- .tab-button {
+ .ldr-tab-navigation button,
+ .ldr-tab-button {
flex-shrink: 0;
white-space: nowrap;
padding: 0.5rem 1rem;
@@ -109,13 +109,13 @@
}
/* Settings content width fix */
- .settings-content,
- .settings-page {
+ .ldr-settings-content,
+ .ldr-settings-page {
max-width: 100%;
overflow-x: hidden;
}
- .settings-grid {
+ .ldr-settings-grid {
display: block;
}
@@ -181,7 +181,7 @@
}
/* Links in navigation */
- .mobile-nav-tab {
+ .ldr-mobile-nav-tab {
min-height: 56px;
}
}
@@ -203,7 +203,7 @@
}
/* Prevent text truncation where possible */
- .truncate-mobile-false {
+ .ldr-truncate-mobile-false {
white-space: normal;
overflow: visible;
text-overflow: clip;
@@ -211,15 +211,15 @@
}
/* 7. Fix modal and sheet menu z-index */
-.mobile-sheet-menu {
+.ldr-mobile-sheet-menu {
z-index: 2000 !important;
}
-.mobile-sheet-overlay {
+.ldr-mobile-sheet-overlay {
z-index: 1999 !important;
}
-.mobile-bottom-nav {
+.ldr-mobile-bottom-nav {
z-index: 1500 !important;
}
@@ -247,7 +247,7 @@
/* 9. Fix News page cards */
@media (max-width: 767px) {
- .news-card,
+ .ldr-news-card,
.card {
margin-left: 0;
margin-right: 0;
@@ -263,17 +263,17 @@
/* 10. Fix metrics/charts on mobile */
@media (max-width: 767px) {
- .chart-container,
+ .ldr-chart-container,
canvas {
max-width: 100%;
height: auto;
}
- .metrics-grid {
+ .ldr-metrics-grid {
grid-template-columns: 1fr;
}
- .stat-card {
+ .ldr-stat-card {
min-height: auto;
padding: 1rem;
}
@@ -281,7 +281,7 @@
/* 11. Safe area insets for iPhone notch/home indicator */
@supports (padding: max(0px)) {
- .mobile-bottom-nav {
+ .ldr-mobile-bottom-nav {
padding-bottom: max(0px, env(safe-area-inset-bottom));
}
@@ -289,7 +289,7 @@
padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
- .mobile-sheet-menu {
+ .ldr-mobile-sheet-menu {
padding-bottom: max(20px, env(safe-area-inset-bottom));
}
}
@@ -311,33 +311,33 @@
/* Stack form buttons */
.form-buttons,
- .button-group {
+ .ldr-button-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.form-buttons button,
- .button-group button {
+ .ldr-button-group button {
width: 100%;
}
}
/* 13. Improve mobile navigation visibility */
-.mobile-bottom-nav {
+.ldr-mobile-bottom-nav {
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
border-top: 1px solid var(--border-color);
}
/* 14. Fix research mode selection on mobile */
@media (max-width: 767px) {
- .research-mode-options {
+ .ldr-research-mode-options {
display: flex;
flex-direction: column;
gap: 1rem;
}
- .research-mode-option {
+ .ldr-research-mode-option {
min-height: 60px;
padding: 1rem;
}
@@ -345,11 +345,11 @@
/* 15. Loading states and spinners positioning */
@media (max-width: 767px) {
- .loading-overlay {
+ .ldr-loading-overlay {
bottom: 80px; /* Above mobile nav */
}
- .toast-container {
+ .ldr-toast-container {
bottom: 90px; /* Above mobile nav */
}
}
diff --git a/src/local_deep_research/web/static/js/mobile-navigation.js b/src/local_deep_research/web/static/js/mobile-navigation.js
index 9f0599ecb1..df2906ac3c 100644
--- a/src/local_deep_research/web/static/js/mobile-navigation.js
+++ b/src/local_deep_research/web/static/js/mobile-navigation.js
@@ -56,10 +56,10 @@
createNavigation() {
// Don't create if already exists
- if (document.querySelector('.mobile-bottom-nav')) {
- this.elements.nav = document.querySelector('.mobile-bottom-nav');
- this.elements.sheet = document.querySelector('.mobile-sheet-menu');
- this.elements.overlay = document.querySelector('.mobile-sheet-overlay');
+ if (document.querySelector('.ldr-mobile-bottom-nav')) {
+ this.elements.nav = document.querySelector('.ldr-mobile-bottom-nav');
+ this.elements.sheet = document.querySelector('.ldr-mobile-sheet-menu');
+ this.elements.overlay = document.querySelector('.ldr-mobile-sheet-overlay');
return;
}
@@ -85,7 +85,7 @@
createBottomNav() {
const nav = document.createElement('nav');
- nav.className = 'mobile-bottom-nav';
+ nav.className = 'ldr-mobile-bottom-nav';
nav.setAttribute('role', 'navigation');
nav.setAttribute('aria-label', 'Mobile navigation');
@@ -98,7 +98,7 @@
];
nav.innerHTML = tabs.map(tab => `
- <button class="mobile-nav-tab ${this.isCurrentPage(tab) ? 'active' : ''}"
+ <button class="ldr-mobile-nav-tab ${this.isCurrentPage(tab) ? 'active' : ''}"
data-tab-id="${tab.id}"
data-action="${tab.action || 'navigate'}"
data-path="${tab.path || ''}"
@@ -106,7 +106,7 @@
aria-selected="${this.isCurrentPage(tab) ? 'true' : 'false'}"
aria-label="${tab.label}">
<i class="${tab.icon}"></i>
- <span class="mobile-nav-label">${tab.label}</span>
+ <span class="ldr-mobile-nav-label">${tab.label}</span>
</button>
`).join('');
@@ -115,7 +115,7 @@
createSheetMenu() {
const sheet = document.createElement('div');
- sheet.className = 'mobile-sheet-menu';
+ sheet.className = 'ldr-mobile-sheet-menu';
sheet.setAttribute('role', 'dialog');
sheet.setAttribute('aria-label', 'More options menu');
sheet.setAttribute('aria-hidden', 'true');
@@ -123,58 +123,58 @@
const username = this.getUsername();
sheet.innerHTML = `
- <div class="mobile-sheet-handle" aria-label="Drag to dismiss"></div>
+ <div class="ldr-mobile-sheet-handle" aria-label="Drag to dismiss"></div>
- <div class="mobile-sheet-content">
+ <div class="ldr-mobile-sheet-content">
<!-- User Section -->
- <div class="mobile-sheet-section">
- <h3 class="mobile-sheet-title">Account</h3>
- <div class="mobile-sheet-items">
- <button class="mobile-sheet-item" data-item-id="user" data-action="#">
+ <div class="ldr-mobile-sheet-section">
+ <h3 class="ldr-mobile-sheet-title">Account</h3>
+ <div class="ldr-mobile-sheet-items">
+ <button class="ldr-mobile-sheet-item" data-item-id="user" data-action="#">
<i class="fas fa-user"></i>
- <span class="mobile-sheet-label">${username}</span>
+ <span class="ldr-mobile-sheet-label">${username}</span>
</button>
- <button class="mobile-sheet-item" data-item-id="settings" data-action="/settings/">
+ <button class="ldr-mobile-sheet-item" data-item-id="settings" data-action="/settings/">
<i class="fas fa-cog"></i>
- <span class="mobile-sheet-label">Settings</span>
+ <span class="ldr-mobile-sheet-label">Settings</span>
</button>
- <button class="mobile-sheet-item" data-item-id="logout" data-action="#logout">
+ <button class="ldr-mobile-sheet-item" data-item-id="logout" data-action="#logout">
<i class="fas fa-sign-out-alt"></i>
- <span class="mobile-sheet-label">Logout</span>
+ <span class="ldr-mobile-sheet-label">Logout</span>
</button>
</div>
</div>
<!-- Features Section -->
- <div class="mobile-sheet-section">
- <h3 class="mobile-sheet-title">Features</h3>
- <div class="mobile-sheet-items">
- <button class="mobile-sheet-item" data-item-id="subscriptions" data-action="/subscriptions/">
+ <div class="ldr-mobile-sheet-section">
+ <h3 class="ldr-mobile-sheet-title">Features</h3>
+ <div class="ldr-mobile-sheet-items">
+ <button class="ldr-mobile-sheet-item" data-item-id="subscriptions" data-action="/subscriptions/">
<i class="fas fa-bell"></i>
- <span class="mobile-sheet-label">Subscriptions</span>
+ <span class="ldr-mobile-sheet-label">Subscriptions</span>
</button>
- <button class="mobile-sheet-item" data-item-id="benchmark" data-action="/benchmark/">
+ <button class="ldr-mobile-sheet-item" data-item-id="benchmark" data-action="/benchmark/">
<i class="fas fa-tachometer-alt"></i>
- <span class="mobile-sheet-label">Benchmark</span>
+ <span class="ldr-mobile-sheet-label">Benchmark</span>
</button>
- <button class="mobile-sheet-item" data-item-id="benchmark-results" data-action="/benchmark/results/">
+ <button class="ldr-mobile-sheet-item" data-item-id="benchmark-results" data-action="/benchmark/results/">
<i class="fas fa-chart-line"></i>
- <span class="mobile-sheet-label">Benchmark Results</span>
+ <span class="ldr-mobile-sheet-label">Benchmark Results</span>
</button>
</div>
</div>
<!-- Help Section -->
- <div class="mobile-sheet-section">
- <h3 class="mobile-sheet-title">Help & Info</h3>
- <div class="mobile-sheet-items">
- <button class="mobile-sheet-item" data-item-id="help" data-action="#help">
+ <div class="ldr-mobile-sheet-section">
+ <h3 class="ldr-mobile-sheet-title">Help & Info</h3>
+ <div class="ldr-mobile-sheet-items">
+ <button class="ldr-mobile-sheet-item" data-item-id="help" data-action="#help">
<i class="fas fa-question-circle"></i>
- <span class="mobile-sheet-label">Help</span>
+ <span class="ldr-mobile-sheet-label">Help</span>
</button>
- <button class="mobile-sheet-item" data-item-id="about" data-action="#about">
+ <button class="ldr-mobile-sheet-item" data-item-id="about" data-action="#about">
<i class="fas fa-info-circle"></i>
- <span class="mobile-sheet-label">About</span>
+ <span class="ldr-mobile-sheet-label">About</span>
</button>
</div>
</div>
@@ -186,7 +186,7 @@
createOverlay() {
const overlay = document.createElement('div');
- overlay.className = 'mobile-sheet-overlay';
+ overlay.className = 'ldr-mobile-sheet-overlay';
overlay.setAttribute('aria-hidden', 'true');
this.elements.overlay = overlay;
}
@@ -195,7 +195,7 @@
// Tab navigation
if (this.elements.nav) {
this.elements.nav.addEventListener('click', (e) => {
- const tab = e.target.closest('.mobile-nav-tab');
+ const tab = e.target.closest('.ldr-mobile-nav-tab');
if (!tab) return;
const action = tab.dataset.action;
@@ -213,7 +213,7 @@
// Sheet menu items
if (this.elements.sheet) {
this.elements.sheet.addEventListener('click', (e) => {
- const item = e.target.closest('.mobile-sheet-item');
+ const item = e.target.closest('.ldr-mobile-sheet-item');
if (!item) return;
this.handleSheetItem(item.dataset.action, item.dataset.itemId);
@@ -240,7 +240,7 @@
let currentY = 0;
let isDragging = false;
- const handle = this.elements.sheet.querySelector('.mobile-sheet-handle');
+ const handle = this.elements.sheet.querySelector('.ldr-mobile-sheet-handle');
const handleTouchStart = (e) => {
startY = e.touches[0].clientY;
@@ -324,7 +324,7 @@
setActiveTab(tabId) {
if (this.elements.nav) {
- this.elements.nav.querySelectorAll('.mobile-nav-tab').forEach(tab => {
+ this.elements.nav.querySelectorAll('.ldr-mobile-nav-tab').forEach(tab => {
tab.classList.remove('active');
tab.setAttribute('aria-selected', 'false');
});
@@ -399,7 +399,7 @@
}
getUsername() {
- const userInfo = document.querySelector('.user-info');
+ const userInfo = document.querySelector('.ldr-user-info');
if (userInfo) {
const text = userInfo.textContent || '';
return text.trim().replace(/[^\w\s@._-]/g, '').trim() || 'User';
diff --git a/tests/ui_tests/mobile/test_mobile_navigation_ci.js b/tests/ui_tests/mobile/test_mobile_navigation_ci.js
index b9c181c490..5e2e20e483 100644
--- a/tests/ui_tests/mobile/test_mobile_navigation_ci.js
+++ b/tests/ui_tests/mobile/test_mobile_navigation_ci.js
@@ -115,7 +115,7 @@ class TestResults {
// Test assertions
class MobileNavAssertions {
static async assertMobileNavExists(page, device) {
- const navElement = await page.$('.mobile-bottom-nav');
+ const navElement = await page.$('.ldr-mobile-bottom-nav');
if (!navElement) {
throw new Error(`Mobile navigation not found on ${device}`);
}
@@ -124,7 +124,7 @@ class MobileNavAssertions {
static async assertMobileNavVisible(page, device, shouldBeVisible) {
const isVisible = await page.evaluate(() => {
- const nav = document.querySelector('.mobile-bottom-nav');
+ const nav = document.querySelector('.ldr-mobile-bottom-nav');
if (!nav) return false;
const style = window.getComputedStyle(nav);
return style.display !== 'none' && nav.classList.contains('visible');
@@ -154,7 +154,7 @@ class MobileNavAssertions {
static async assertTabCount(page, expectedCount) {
const tabCount = await page.evaluate(() => {
- const tabs = document.querySelectorAll('.mobile-nav-tab');
+ const tabs = document.querySelectorAll('.ldr-mobile-nav-tab');
return tabs.length;
});
@@ -166,7 +166,7 @@ class MobileNavAssertions {
static async assertActiveTab(page, expectedTab) {
const activeTab = await page.evaluate(() => {
- const active = document.querySelector('.mobile-nav-tab.active');
+ const active = document.querySelector('.ldr-mobile-nav-tab.active');
return active ? active.dataset.tabId : null;
});
@@ -178,12 +178,12 @@ class MobileNavAssertions {
static async assertSheetMenuToggle(page) {
// Click More button
- await page.click('.mobile-nav-tab[data-tab-id="more"]');
+ await page.click('.ldr-mobile-nav-tab[data-tab-id="more"]');
await new Promise(resolve => setTimeout(resolve, 500));
// Check if sheet is open
const sheetOpen = await page.evaluate(() => {
- const sheet = document.querySelector('.mobile-sheet-menu');
+ const sheet = document.querySelector('.ldr-mobile-sheet-menu');
return sheet && sheet.classList.contains('active');
});
@@ -192,11 +192,11 @@ class MobileNavAssertions {
}
// Close sheet
- await page.click('.mobile-sheet-overlay');
+ await page.click('.ldr-mobile-sheet-overlay');
await new Promise(resolve => setTimeout(resolve, 500));
const sheetClosed = await page.evaluate(() => {
- const sheet = document.querySelector('.mobile-sheet-menu');
+ const sheet = document.querySelector('.ldr-mobile-sheet-menu');
return sheet && !sheet.classList.contains('active');
});
@@ -397,7 +397,7 @@ class MobileNavTestRunner {
// Click History tab
const [response] = await Promise.all([
page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 10000 }),
- page.click('.mobile-nav-tab[data-tab-id="history"]')
+ page.click('.ldr-mobile-nav-tab[data-tab-id="history"]')
]);
const url = page.url();
diff --git a/tests/ui_tests/test_mobile_metrics.js b/tests/ui_tests/test_mobile_metrics.js
new file mode 100644
index 0000000000..08ee5d64f3
--- /dev/null
+++ b/tests/ui_tests/test_mobile_metrics.js
@@ -0,0 +1,88 @@
+const puppeteer = require('puppeteer');
+const AuthHelper = require('./auth_helper');
+
+async function testMobileMetrics() {
+ const browser = await puppeteer.launch({
+ headless: false,
+ args: ['--no-sandbox', '--disable-setuid-sandbox']
+ });
+
+ try {
+ const page = await browser.newPage();
+
+ // Set mobile viewport (iPhone 12 Pro)
+ await page.setViewport({
+ width: 390,
+ height: 844,
+ isMobile: true,
+ hasTouch: true
+ });
+
+ const auth = new AuthHelper(page);
+ await auth.ensureAuthenticated();
+
+ // Pages to test on mobile
+ const pages = [
+ { url: 'http://127.0.0.1:5000/metrics/', name: 'metrics-main-mobile' },
+ { url: 'http://127.0.0.1:5000/metrics/context-overflow', name: 'context-overflow-mobile' },
+ { url: 'http://127.0.0.1:5000/metrics/star-reviews', name: 'star-reviews-mobile' },
+ { url: 'http://127.0.0.1:5000/settings/', name: 'settings-mobile' }
+ ];
+
+ for (const pageInfo of pages) {
+ console.log(`\nTesting ${pageInfo.name}...`);
+
+ await page.goto(pageInfo.url, {
+ waitUntil: 'networkidle2',
+ timeout: 30000
+ });
+
+ // Wait for content to load
+ await new Promise(resolve => setTimeout(resolve, 3000));
+
+ // Take full page screenshot
+ await page.screenshot({
+ path: `./${pageInfo.name}.png`,
+ fullPage: true
+ });
+ console.log(`📱 Screenshot saved: ${pageInfo.name}.png`);
+
+ // Check viewport and scroll info
+ const mobileInfo = await page.evaluate(() => {
+ const body = document.body;
+ const html = document.documentElement;
+
+ return {
+ viewportWidth: window.innerWidth,
+ viewportHeight: window.innerHeight,
+ scrollWidth: body.scrollWidth,
+ scrollHeight: Math.max(
+ body.scrollHeight,
+ body.offsetHeight,
+ html.clientHeight,
+ html.scrollHeight,
+ html.offsetHeight
+ ),
+ hasHorizontalScroll: body.scrollWidth > window.innerWidth,
+ bodyHeight: body.offsetHeight,
+ overflow: window.getComputedStyle(body).overflow
+ };
+ });
+
+ console.log(`Mobile dimensions for ${pageInfo.name}:`, mobileInfo);
+
+ if (mobileInfo.hasHorizontalScroll) {
+ console.log(`⚠️ WARNING: Horizontal scroll detected on ${pageInfo.name}`);
+ }
+
+ if (mobileInfo.scrollHeight > 10000) {
+ console.log(`⚠️ WARNING: Excessive height (${mobileInfo.scrollHeight}px) on ${pageInfo.name}`);
+ }
+ }
+
+ } finally {
+ await browser.close();
+ }
+}
+
+testMobileMetrics().catch(console.error);