~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.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
test(ui): chunk mobile-nav overlap DOM walk; drop WebKit skip (#4060) (#4076)
LearningCircuit8b98dfc2378c
diff --git a/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js b/tests/ui_tests/playwright/tests/all-pages-mobile.spec.jsindex 8e9940132f..7fb154eb93 100644--- a/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js+++ b/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js@@ -44,6 +44,92 @@ const PAGES = [{ path: '/metrics/links', name: 'Link Analytics', priority: 'medium' },];+/**+ * Walk interactive elements and report any that overlap the fixed mobile nav.+ *+ * Returns at most `maxReported` hits. Split into small page.evaluate calls+ * so no single in-page DOM walk runs long enough to race WebKit's+ * context-close (issue #4060).+ */+async function findElementsBehindMobileNav(page, navSelector, options = {}) {+ const {+ overlapTolerance = 20,+ batchSize = 50,+ maxReported = 5,+ } = options;++ const navInfo = await page.evaluate((sel) => {+ const mobileNav = document.querySelector(sel);+ if (!mobileNav) return { hasNav: false };+ const navStyle = window.getComputedStyle(mobileNav);+ if (navStyle.display === 'none') return { hasNav: false };+ const navRect = mobileNav.getBoundingClientRect();+ return {+ hasNav: true,+ navTop: navRect.top,+ navBottom: navRect.bottom,+ };+ }, navSelector);++ if (!navInfo.hasNav) return [];++ const totalCount = await page.evaluate(() =>+ document.querySelectorAll(+ 'button, a, input, select, textarea, [role="button"]'+ ).length+ );++ const hits = [];+ for (let start = 0; start < totalCount; start += batchSize) {+ const remaining = maxReported - hits.length;+ if (remaining <= 0) break;+ const batch = await page.evaluate(+ ({ sel, navTop, navBottom, batchStart, size, tolerance, cap }) => {+ const mobileNav = document.querySelector(sel);+ const all = document.querySelectorAll(+ 'button, a, input, select, textarea, [role="button"]'+ );+ const issues = [];+ const end = Math.min(batchStart + size, all.length);+ for (let i = batchStart; i < end; i++) {+ if (issues.length >= cap) break;+ const el = all[i];+ const rect = el.getBoundingClientRect();+ const style = window.getComputedStyle(el);+ if (style.display === 'none' || style.visibility === 'hidden') continue;+ if (rect.width === 0 || rect.height === 0) continue;+ if (el.closest('.modal:not(.show)')) continue;+ if (el.closest('.ldr-help-panel-dismiss')) continue;+ if (rect.bottom > navTop + tolerance && rect.top < navBottom) {+ if (mobileNav && !mobileNav.contains(el)) {+ issues.push({+ tag: el.tagName.toLowerCase(),+ class: el.className?.toString().slice(0, 50),+ text: (el.textContent || '').trim().slice(0, 30),+ bottom: Math.round(rect.bottom),+ navTop: Math.round(navTop),+ });+ }+ }+ }+ return issues;+ },+ {+ sel: navSelector,+ navTop: navInfo.navTop,+ navBottom: navInfo.navBottom,+ batchStart: start,+ size: batchSize,+ tolerance: overlapTolerance,+ cap: remaining,+ }+ );+ hits.push(...batch);+ }++ return hits;+}+/*** Wait for a page to load with appropriate state*/@@ -251,7 +337,7 @@ test.describe('All Pages - Touch Targets', () => {test.describe('All Pages - Content Above Mobile Nav', () => {for (const pageInfo of PAGES) {- test(`${pageInfo.name} content not hidden behind mobile nav`, async ({ page, isMobile, browserName }) => {+ test(`${pageInfo.name} content not hidden behind mobile nav`, async ({ page, isMobile }) => {if (!isMobile) {test.skip();return;@@ -301,97 +387,17 @@ test.describe('All Pages - Content Above Mobile Nav', () => {return (window.innerHeight + window.scrollY) >= document.body.scrollHeight - 1;}, { timeout: 5000 }).catch(() => {});- // The big DOM walk below has been observed to hit Mobile Safari's- // 30s test timeout when the WebKit context closes mid-evaluate- // (`Target page, context or browser has been closed`). That's a- // platform-side flake, not a code regression — wrap so we skip- // gracefully instead of failing the gate. If the page is healthy,- // the assertion still runs as before.- let result;- try {- result = await page.evaluate((navSelector) => {- const mobileNav = document.querySelector(navSelector);- if (!mobileNav) return { hasNav: false, issue: null };-- const navStyle = window.getComputedStyle(mobileNav);- if (navStyle.display === 'none') return { hasNav: false, issue: null };-- const navRect = mobileNav.getBoundingClientRect();-- // Find interactive elements that might be hidden behind the nav- const interactiveElements = document.querySelectorAll(- 'button, a, input, select, textarea, [role="button"]'- );- const hiddenElements = [];-- interactiveElements.forEach((el) => {- const rect = el.getBoundingClientRect();- const style = window.getComputedStyle(el);-- // Skip hidden elements- if (style.display === 'none' || style.visibility === 'hidden') return;- if (rect.width === 0 || rect.height === 0) return;-- // Skip elements inside hidden modals (WebKit returns non-zero rects for these)- if (el.closest('.modal:not(.show)')) return;-- // Skip help panel dismiss checkboxes - they're inside collapsible panels- // and users can collapse the panel instead of using the dismiss checkbox- if (el.closest('.ldr-help-panel-dismiss')) return;-- // Check if element is behind the nav (with tolerance for edge cases)- // Allow 20px overlap tolerance for rendering variations and borderline cases- // This catches real issues (content completely hidden) while allowing minor edge overlaps- const OVERLAP_TOLERANCE = 20;- if (rect.bottom > navRect.top + OVERLAP_TOLERANCE && rect.top < navRect.bottom) {- // Element significantly overlaps with nav vertically- // Check if it's not part of the nav itself- if (!mobileNav.contains(el)) {- hiddenElements.push({- tag: el.tagName.toLowerCase(),- class: el.className?.toString().slice(0, 50),- text: (el.textContent || '').trim().slice(0, 30),- bottom: Math.round(rect.bottom),- navTop: Math.round(navRect.top),- });- }- }- });-- return {- hasNav: true,- navTop: navRect.top,- hiddenElements: hiddenElements.slice(0, 5),- };- }, MOBILE_NAV_SELECTOR);- } catch (evalError) {- const msg = String(evalError && evalError.message || evalError);- // Same upstream WebKit race surfaces under two wordings depending on- // Playwright version; treat both as the documented flake (issue #4060).- if (- msg.includes('Target page, context or browser has been closed') ||- msg.includes('Execution context was destroyed')- ) {- // Only WebKit/Mobile Safari is known to hit this race. For every other- // browser, the error is a real regression — let it surface. `test.skip`- // throws internally to halt the test, so no explicit return is needed.- test.skip(- browserName === 'webkit',- `WebKit closed the context mid-evaluate on ${pageInfo.name} — flake (issue #4060)`- );- }- throw evalError;- }+ const hiddenElements = await findElementsBehindMobileNav(page, MOBILE_NAV_SELECTOR);- if (result.hasNav && result.hiddenElements && result.hiddenElements.length > 0) {+ if (hiddenElements.length > 0) {console.log(`Elements hidden behind nav on ${pageInfo.name}:`,- JSON.stringify(result.hiddenElements, null, 2)+ JSON.stringify(hiddenElements, null, 2));}expect(- result.hiddenElements?.length || 0,+ hiddenElements.length,`${pageInfo.name} should have no interactive elements behind mobile nav`).toBe(0);});