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: post-merge cleanup from PR #1678 — memory leak, auth setup, gitignore, double waits (#2224)

LearningCircuit287d0a12b38d
diff --git a/.github/workflows/playwright-webkit-tests.yml b/.github/workflows/playwright-webkit-tests.yml
index de02da82ab..336732cea9 100644
--- a/.github/workflows/playwright-webkit-tests.yml
+++ b/.github/workflows/playwright-webkit-tests.yml
@@ -100,6 +100,12 @@ jobs:
TEST_BASE_URL: http://127.0.0.1:5000
TEST_USERNAME: test_admin
TEST_PASSWORD: testpass123
+ # Safari CI runs a critical subset (3/20 specs) for fast release gate:
+ # - all-pages-mobile: overflow, touch targets, nav clearance across all pages
+ # - desktop-layout: sidebar positioning and breakpoint testing
+ # - interactive-states: advanced options, search, help panels, mobile menus
+ # Full suite (20 files): run locally via `cd tests/ui_tests/playwright && npm test`
+ # When adding Safari-critical tests, update this filter pattern.
run: |
npx playwright test \
--project="Desktop Safari" \
@@ -221,6 +227,12 @@ jobs:
TEST_BASE_URL: http://127.0.0.1:5000
TEST_USERNAME: test_admin
TEST_PASSWORD: testpass123
+ # Safari CI runs a critical subset (3/20 specs) for fast release gate:
+ # - all-pages-mobile: overflow, touch targets, nav clearance across all pages
+ # - desktop-layout: sidebar positioning and breakpoint testing
+ # - interactive-states: advanced options, search, help panels, mobile menus
+ # Full suite (20 files): run locally via `cd tests/ui_tests/playwright && npm test`
+ # When adding Safari-critical tests, update this filter pattern.
run: |
npx playwright test \
--project="Mobile Safari" \
diff --git a/.gitignore b/.gitignore
index ec6199888d..fe773e2a19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -275,6 +275,9 @@ tests/**/*.md
!tests/ui_tests/playwright/tests/*.spec.js-snapshots/
!tests/ui_tests/playwright/tests/*.spec.js-snapshots/*.png
+# Block Playwright authentication state (contains session cookies/tokens)
+tests/ui_tests/playwright/.auth/
+
# Block Playwright generated reports and test artifacts
tests/ui_tests/playwright/playwright-report/
tests/ui_tests/playwright/test-results/
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 dcf82cf928..3459d19d3c 100644
--- a/src/local_deep_research/web/static/js/mobile-navigation.js
+++ b/src/local_deep_research/web/static/js/mobile-navigation.js
@@ -24,6 +24,8 @@
this.elements = {};
this.initialized = false;
this.closeSheetTimeout = null;
+ this.resizeHandler = null;
+ this.resizeTimer = null;
}
init() {
@@ -314,11 +316,9 @@
}
handleResize() {
- let resizeTimer;
-
- window.addEventListener('resize', () => {
- clearTimeout(resizeTimer);
- resizeTimer = setTimeout(() => {
+ this.resizeHandler = () => {
+ clearTimeout(this.resizeTimer);
+ this.resizeTimer = setTimeout(() => {
const wasVisible = this.state.isVisible;
this.checkViewport();
@@ -330,7 +330,9 @@
}
}
}, 250);
- });
+ };
+
+ window.addEventListener('resize', this.resizeHandler);
}
toggle(show) {
@@ -505,6 +507,14 @@
}
destroy() {
+ clearTimeout(this.closeSheetTimeout);
+ clearTimeout(this.resizeTimer);
+
+ if (this.resizeHandler) {
+ window.removeEventListener('resize', this.resizeHandler);
+ this.resizeHandler = null;
+ }
+
if (this.elements.nav) this.elements.nav.remove();
if (this.elements.sheet) this.elements.sheet.remove();
if (this.elements.overlay) this.elements.overlay.remove();
diff --git a/tests/ui_tests/playwright/tests/auth.setup.js b/tests/ui_tests/playwright/tests/auth.setup.js
index eef64c3948..b5785853cf 100644
--- a/tests/ui_tests/playwright/tests/auth.setup.js
+++ b/tests/ui_tests/playwright/tests/auth.setup.js
@@ -7,12 +7,20 @@
*/
import { test as setup, expect } from '@playwright/test';
+import { mkdirSync } from 'fs';
import path from 'path';
+// Fallbacks for convenience — these are non-sensitive test-only defaults that
+// match the dev/CI fixture credentials, so developers can run the suite without
+// extra setup. Override via env vars when pointing at a different test server.
const TEST_USERNAME = process.env.TEST_USERNAME || 'test_admin';
const TEST_PASSWORD = process.env.TEST_PASSWORD || 'testpass123';
-const authFile = path.join(__dirname, '../.auth/user.json');
+const authDir = path.join(__dirname, '../.auth');
+const authFile = path.join(authDir, 'user.json');
+
+// Ensure .auth directory exists before storageState() call
+mkdirSync(authDir, { recursive: true });
setup('authenticate', async ({ page }) => {
// Navigate to login page
@@ -28,8 +36,8 @@ setup('authenticate', async ({ page }) => {
// Wait for navigation to complete (authentication successful)
await page.waitForURL('/', { timeout: 60000 });
- // Verify we're logged in by checking for presence of main content
- await expect(page.locator('body')).toBeVisible();
+ // Verify we're logged in by checking for user info display
+ await expect(page.locator('.ldr-user-info')).toBeVisible();
// Save the authentication state
await page.context().storageState({ path: authFile });
diff --git a/tests/ui_tests/playwright/tests/metrics-subpages-mobile.spec.js b/tests/ui_tests/playwright/tests/metrics-subpages-mobile.spec.js
index abf624f543..e7057b9215 100644
--- a/tests/ui_tests/playwright/tests/metrics-subpages-mobile.spec.js
+++ b/tests/ui_tests/playwright/tests/metrics-subpages-mobile.spec.js
@@ -243,7 +243,6 @@ test.describe('Metrics Subpages - Common Mobile Tests', () => {
await page.goto(pageInfo.path);
await page.waitForLoadState('domcontentloaded');
await page.waitForTimeout(500);
- await page.waitForTimeout(500);
await ensureSheetsClosed(page);
// Scroll to top
@@ -591,7 +590,6 @@ test.describe('Metrics Subpages - Component Screenshots', () => {
await page.goto('/metrics/costs');
await page.waitForLoadState('domcontentloaded');
- await page.waitForTimeout(500);
await page.waitForTimeout(500);
await ensureSheetsClosed(page);
diff --git a/tests/ui_tests/playwright/tests/mobile-components.spec.js b/tests/ui_tests/playwright/tests/mobile-components.spec.js
index 4d5353c7fe..210d4faad9 100644
--- a/tests/ui_tests/playwright/tests/mobile-components.spec.js
+++ b/tests/ui_tests/playwright/tests/mobile-components.spec.js
@@ -326,7 +326,6 @@ test.describe('Card Components', () => {
await page.goto('/metrics/');
await page.waitForLoadState('domcontentloaded');
await page.waitForTimeout(500);
- await page.waitForTimeout(500);
const metricLink = page.locator('.ldr-metric-link').first();
if (await metricLink.isVisible()) {
diff --git a/tests/ui_tests/playwright/tests/research-page.spec.js b/tests/ui_tests/playwright/tests/research-page.spec.js
index e3deefd4dd..e3a77e69b5 100644
--- a/tests/ui_tests/playwright/tests/research-page.spec.js
+++ b/tests/ui_tests/playwright/tests/research-page.spec.js
@@ -252,7 +252,6 @@ test.describe('Research Page - Advanced Options', () => {
await page.goto('/');
await page.waitForLoadState('domcontentloaded');
await page.waitForTimeout(500);
- await page.waitForTimeout(500);
});
test('advanced options toggle works on mobile', async ({ page }) => {