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.

feat: Major mobile responsive improvements

LearningCircuitd8cbe750e32e
diff --git a/src/local_deep_research/web/static/css/mobile-ui-fixes.css b/src/local_deep_research/web/static/css/mobile-responsive.css
similarity index 59%
rename from src/local_deep_research/web/static/css/mobile-ui-fixes.css
rename to src/local_deep_research/web/static/css/mobile-responsive.css
index 875d2f6135..f19c35ec56 100644
--- a/src/local_deep_research/web/static/css/mobile-ui-fixes.css
+++ b/src/local_deep_research/web/static/css/mobile-responsive.css
@@ -261,7 +261,39 @@
}
}
-/* 10. Fix metrics/charts on mobile */
+/* 10. Force hide desktop sidebar on mobile */
+@media (max-width: 767px) {
+ /* Desktop sidebar must be hidden on mobile unless explicitly shown */
+ .ldr-sidebar:not(.active),
+ aside.ldr-sidebar:not(.active),
+ .ldr-app-container > aside,
+ body aside.ldr-sidebar {
+ display: none !important;
+ visibility: hidden !important;
+ width: 0 !important;
+ height: 0 !important;
+ overflow: hidden !important;
+ position: absolute !important;
+ left: -9999px !important;
+ pointer-events: none !important;
+ opacity: 0 !important;
+ }
+
+ /* Main content takes full width */
+ .ldr-main-content {
+ margin-left: 0 !important;
+ width: 100% !important;
+ padding-left: 1rem !important;
+ padding-right: 1rem !important;
+ }
+
+ /* Make sure the app container doesn't have grid/flex that shows sidebar */
+ .ldr-app-container {
+ display: block !important;
+ }
+}
+
+/* 11. Fix metrics/charts on mobile */
@media (max-width: 767px) {
.ldr-chart-container,
canvas {
@@ -269,14 +301,53 @@
height: auto;
}
- .ldr-metrics-grid {
- grid-template-columns: 1fr;
- }
-
- .ldr-stat-card {
+ /* Force ALL grid layouts to single column on mobile */
+ .ldr-metrics-grid,
+ .ldr-stats-overview,
+ .ldr-settings-cards,
+ .ldr-settings-row,
+ .ldr-subscriptions-grid,
+ .ldr-breakdown-grid,
+ .ldr-engine-stats-grid,
+ .ldr-json-property-controls,
+ .ldr-research-metadata {
+ grid-template-columns: 1fr !important;
+ }
+
+ /* Handle inline styles with grid-template-columns */
+ div[style*="grid-template-columns: 1fr 1fr"],
+ div[style*="grid-template-columns: repeat"],
+ div[style*="minmax(300px"],
+ div[style*="minmax(350px"],
+ div[style*="minmax(250px"],
+ div[style*="minmax(200px"] {
+ grid-template-columns: 1fr !important;
+ }
+
+ /* Ensure all cards take full width */
+ .ldr-metric-card,
+ .ldr-stat-card,
+ .ldr-settings-card,
+ .ldr-subscription-card {
+ width: 100% !important;
+ min-width: unset !important;
+ max-width: 100% !important;
min-height: auto;
padding: 1rem;
}
+
+ /* Fix time period selectors to wrap */
+ .ldr-time-selector,
+ .ldr-time-period-buttons {
+ flex-wrap: wrap !important;
+ }
+
+ .ldr-time-selector button,
+ .ldr-time-period-buttons button {
+ flex: 1 1 auto;
+ min-width: 80px;
+ margin: 0.25rem;
+ }
}
/* 11. Safe area insets for iPhone notch/home indicator */
@@ -353,3 +424,120 @@
bottom: 90px; /* Above mobile nav */
}
}
+
+/* 16. Improve text readability on mobile */
+@media (max-width: 767px) {
+ /* Base font size adjustments */
+ body {
+ font-size: 16px; /* Prevent zoom on iOS */
+ }
+
+ /* Make small text more readable */
+ .ldr-metric-label,
+ .ldr-hint-text,
+ .text-muted,
+ .text-secondary,
+ small {
+ font-size: 0.875rem !important; /* 14px minimum */
+ line-height: 1.5;
+ }
+
+ /* Keyboard shortcuts should be visible */
+ .ldr-keyboard-shortcut-hint kbd {
+ font-size: 1rem !important;
+ padding: 0.3rem 0.5rem;
+ }
+
+ /* Headers should be appropriately sized */
+ h1 { font-size: 1.75rem; }
+ h2 { font-size: 1.5rem; }
+ h3 { font-size: 1.25rem; }
+ h4 { font-size: 1.125rem; }
+
+ /* Code blocks and pre elements */
+ pre, code {
+ font-size: 0.875rem;
+ }
+}
+
+/* 17. Improve touch targets on mobile */
+@media (max-width: 767px) {
+ /* Minimum 44x44px touch targets (Apple HIG) */
+ button,
+ a,
+ input[type="checkbox"],
+ input[type="radio"],
+ .ldr-clickable {
+ min-height: 44px;
+ min-width: 44px;
+ }
+
+ /* Buttons need proper padding */
+ button,
+ .btn,
+ .ldr-btn,
+ .ldr-button {
+ padding: 0.75rem 1rem !important;
+ font-size: 1rem !important;
+ }
+
+ /* Form inputs */
+ input[type="text"],
+ input[type="email"],
+ input[type="password"],
+ input[type="search"],
+ input[type="url"],
+ textarea,
+ select {
+ min-height: 44px !important;
+ padding: 0.75rem !important;
+ font-size: 16px !important; /* Prevents zoom on iOS */
+ }
+
+ /* Links in lists need padding */
+ .ldr-sidebar a,
+ .ldr-nav-link,
+ .nav-link {
+ padding: 0.75rem 1rem !important;
+ display: block;
+ }
+
+ /* Dropdown items */
+ .dropdown-item,
+ .ldr-dropdown-item {
+ padding: 0.75rem 1rem !important;
+ min-height: 44px;
+ }
+
+ /* Icon buttons need proper sizing */
+ .icon-btn,
+ .ldr-icon-btn,
+ button.icon-only {
+ width: 44px !important;
+ height: 44px !important;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+}
+
+/* 18. Fix card spacing on mobile */
+@media (max-width: 767px) {
+ .ldr-card,
+ .card {
+ margin-bottom: 1rem !important;
+ padding: 1rem !important;
+ }
+
+ .ldr-card-header,
+ .card-header {
+ padding: 1rem !important;
+ margin: -1rem -1rem 1rem -1rem !important;
+ }
+
+ /* Metric cards specific spacing */
+ .ldr-metric-card {
+ padding: 1.25rem 1rem !important;
+ margin-bottom: 1rem !important;
+ }
+}
diff --git a/src/local_deep_research/web/static/css/styles.css b/src/local_deep_research/web/static/css/styles.css
index bf57f42522..fdc72d2cd9 100644
--- a/src/local_deep_research/web/static/css/styles.css
+++ b/src/local_deep_research/web/static/css/styles.css
@@ -1209,8 +1209,14 @@ textarea:focus, input[type="text"]:focus {
padding-bottom: 60px; /* Add padding to body for the tab bar */
}
+ /* Override flex container to not show sidebar */
+ .ldr-app-container {
+ display: block !important;
+ }
+
/* Hide desktop sidebar completely on mobile */
- aside.ldr-sidebar {
+ aside.ldr-sidebar,
+ .ldr-sidebar:not(.active) {
display: none !important;
visibility: hidden !important;
}
diff --git a/src/local_deep_research/web/templates/base.html b/src/local_deep_research/web/templates/base.html
index 0cfaec26a1..142edbaa2d 100644
--- a/src/local_deep_research/web/templates/base.html
+++ b/src/local_deep_research/web/templates/base.html
@@ -14,7 +14,7 @@
<!-- Keep local styles that aren't in npm packages -->
<link rel="stylesheet" href="/static/css/styles.css">
<link rel="stylesheet" href="/static/css/mobile-navigation.css">
- <link rel="stylesheet" href="/static/css/mobile-ui-fixes.css">
+ <link rel="stylesheet" href="/static/css/mobile-responsive.css">
{% block extra_head %}{% endblock %}
</head>
<body>
diff --git a/tests/ui_tests/mobile/test_mobile_navigation_ci.js b/tests/ui_tests/mobile/test_mobile_navigation_ci.js
index c9334b5bd0..51fd9b04a2 100644
--- a/tests/ui_tests/mobile/test_mobile_navigation_ci.js
+++ b/tests/ui_tests/mobile/test_mobile_navigation_ci.js
@@ -143,17 +143,35 @@ class MobileNavAssertions {
}
static async assertSidebarHidden(page, device, shouldBeHidden) {
- const isHidden = await page.evaluate(() => {
- const sidebar = document.querySelector('.sidebar');
- if (!sidebar) return true;
+ const sidebarInfo = await page.evaluate(() => {
+ const sidebar = document.querySelector('.ldr-sidebar, aside.ldr-sidebar');
+ if (!sidebar) return { exists: false, isHidden: true };
+
const style = window.getComputedStyle(sidebar);
- return style.display === 'none' ||
- style.transform.includes('translateX(-100%)') ||
- style.transform.includes('translateX(-');
+ const rect = sidebar.getBoundingClientRect();
+
+ return {
+ exists: true,
+ isHidden: style.display === 'none' ||
+ style.visibility === 'hidden' ||
+ style.transform.includes('translateX(-100%)') ||
+ style.transform.includes('translateX(-') ||
+ rect.left < -100,
+ display: style.display,
+ visibility: style.visibility,
+ transform: style.transform,
+ position: `${rect.left},${rect.top}`
+ };
});
- if (isHidden !== shouldBeHidden) {
- throw new Error(`Sidebar visibility mismatch on ${device}. Expected hidden: ${shouldBeHidden}, Got: ${isHidden}`);
+ if (!sidebarInfo.exists) {
+ console.log(` ✓ Sidebar doesn't exist in DOM (good for mobile)`);
+ return true;
+ }
+
+ if (sidebarInfo.isHidden !== shouldBeHidden) {
+ const details = `Display: ${sidebarInfo.display}, Visibility: ${sidebarInfo.visibility}, Transform: ${sidebarInfo.transform}, Position: ${sidebarInfo.position}`;
+ throw new Error(`Sidebar visibility mismatch on ${device}. Expected hidden: ${shouldBeHidden}, Got: ${!sidebarInfo.isHidden}\nDetails: ${details}`);
}
return true;
}
@@ -298,12 +316,60 @@ class MobileNavTestRunner {
try {
const screenshotPath = `./test-failures/${context.device}_${testName.replace(/\s+/g, '_')}.png`;
await fs.mkdir('./test-failures', { recursive: true });
+
+ // Add visual debugging based on test type
+ if (testName.includes('sidebar') || testName.includes('overlap')) {
+ await context.page.evaluate(() => {
+ // Highlight sidebar in red if it exists
+ const sidebar = document.querySelector('.ldr-sidebar, aside.ldr-sidebar');
+ if (sidebar) {
+ sidebar.style.outline = '3px solid red';
+ sidebar.style.outlineOffset = '2px';
+ }
+
+ // Highlight mobile nav in green
+ const mobileNav = document.querySelector('.ldr-mobile-bottom-nav');
+ if (mobileNav) {
+ mobileNav.style.outline = '3px solid lime';
+ }
+
+ // Highlight any overlapping elements
+ const inputs = document.querySelectorAll('input, textarea, select');
+ inputs.forEach(el => {
+ el.style.outline = '2px dashed blue';
+ });
+ });
+ }
+
+ if (testName.includes('tab') || testName.includes('navigation')) {
+ await context.page.evaluate(() => {
+ // Highlight active tab
+ const activeTab = document.querySelector('.ldr-mobile-nav-tab.active');
+ if (activeTab) {
+ activeTab.style.backgroundColor = 'yellow';
+ activeTab.style.color = 'black';
+ }
+
+ // Number all tabs
+ const tabs = document.querySelectorAll('.ldr-mobile-nav-tab');
+ tabs.forEach((tab, i) => {
+ const badge = document.createElement('span');
+ badge.textContent = `${i + 1}`;
+ badge.style.cssText = 'position:absolute;top:0;right:0;background:red;color:white;border-radius:50%;width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px;';
+ tab.style.position = 'relative';
+ tab.appendChild(badge);
+ });
+ });
+ }
+
// Add timeout to screenshot to prevent hanging
await context.page.screenshot({
path: screenshotPath,
+ fullPage: true,
timeout: 5000 // 5 second timeout for screenshot
});
test.screenshot = screenshotPath;
+ console.log(` 📸 Screenshot saved: ${screenshotPath}`);
} catch (screenshotError) {
console.error(`Warning: Failed to capture screenshot: ${screenshotError.message}`);
// Don't fail the test because of screenshot failure
diff --git a/tests/ui_tests/test_responsive_ui_comprehensive.js b/tests/ui_tests/test_responsive_ui_comprehensive.js
index c1abac1f27..8fb8e24638 100644
--- a/tests/ui_tests/test_responsive_ui_comprehensive.js
+++ b/tests/ui_tests/test_responsive_ui_comprehensive.js
@@ -16,13 +16,30 @@ const VIEWPORTS = {
desktop: { width: 1280, height: 720, deviceScaleFactor: 1, isMobile: false, hasTouch: false }
};
-// Pages to test
+// Pages to test - expanded to include subpages
const TEST_PAGES = [
+ // Main pages
{ name: 'Home', path: '/' },
{ name: 'Settings', path: '/settings/' },
{ name: 'Metrics', path: '/metrics/' },
{ name: 'History', path: '/history/' },
- { name: 'News', path: '/news/' }
+ { name: 'News', path: '/news/' },
+
+ // Metrics subpages (actual routes from metrics_routes.py)
+ { name: 'Metrics-ContextOverflow', path: '/metrics/context-overflow' },
+ { name: 'Metrics-Costs', path: '/metrics/costs' },
+ { name: 'Metrics-StarReviews', path: '/metrics/star-reviews' },
+ { name: 'Metrics-Links', path: '/metrics/links' },
+
+ // News subpages
+ { name: 'News-Subscriptions', path: '/news/subscriptions' },
+
+ // Other important pages
+ { name: 'Benchmark', path: '/benchmark/' },
+ { name: 'BenchmarkResults', path: '/benchmark/results' },
+
+ // Note: Research results pages require a research_id so can't be tested generically
+ // e.g. /results/<research_id>, /progress/<research_id>, /details/<research_id>
];
class ResponsiveUITester {
@@ -93,11 +110,17 @@ class ResponsiveUITester {
console.log(`Testing ${pageInfo.name} at ${this.viewport} viewport...`);
try {
- await this.page.goto(url, {
+ const response = await this.page.goto(url, {
waitUntil: 'networkidle2',
timeout: 30000
});
+ // Check if page exists (skip 404s)
+ if (response && response.status() === 404) {
+ console.log(` ⚠️ Skipping ${pageInfo.name} - page not found (404)`);
+ return;
+ }
+
// Check for horizontal overflow
const hasHorizontalOverflow = await this.page.evaluate(() => {
return document.body.scrollWidth > window.innerWidth;