~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
fix: Fix invisible text labels due to opacity issues
LearningCircuit45ddf1497e30
diff --git a/src/local_deep_research/web/static/css/styles.css b/src/local_deep_research/web/static/css/styles.cssindex f06ef352d1..8c0b7c404f 100644--- a/src/local_deep_research/web/static/css/styles.css+++ b/src/local_deep_research/web/static/css/styles.css@@ -776,6 +776,7 @@ textarea:focus, input[type="text"]:focus {font-size: 0.85rem;color: var(--text-muted);margin-bottom: 0.25rem;+ opacity: 1 !important;}.metadata-value {diff --git a/src/local_deep_research/web/templates/pages/details.html b/src/local_deep_research/web/templates/pages/details.htmlindex 5b828f2844..610261ccdb 100644--- a/src/local_deep_research/web/templates/pages/details.html+++ b/src/local_deep_research/web/templates/pages/details.html@@ -19,6 +19,7 @@font-size: 0.875rem;color: var(--text-secondary);margin-bottom: 0.5rem;+ opacity: 1 !important;}.metric-value {@@ -54,6 +55,7 @@font-size: 0.875rem;text-transform: uppercase;letter-spacing: 0.05em;+ opacity: 1 !important;}.chart-container {diff --git a/src/local_deep_research/web/templates/pages/metrics.html b/src/local_deep_research/web/templates/pages/metrics.htmlindex 60d94fffa3..71b0774e72 100644--- a/src/local_deep_research/web/templates/pages/metrics.html+++ b/src/local_deep_research/web/templates/pages/metrics.html@@ -37,6 +37,7 @@font-size: 0.875rem;text-transform: uppercase;letter-spacing: 0.05em;+ opacity: 1 !important;}.metric-icon {@@ -128,6 +129,7 @@.breakdown-label {font-size: 0.875rem;color: var(--text-muted); /* Changed to more visible grey */+ opacity: 1 !important;}.breakdown-value {@@ -374,6 +376,8 @@margin-left: 0.25rem;font-size: 0.875rem;cursor: help;+ opacity: 1 !important;+ display: inline-block;}.info-icon:hover {diff --git a/tests/ui_tests/package.json b/tests/ui_tests/package.jsonindex f834e7b84d..0916ad67cd 100644--- a/tests/ui_tests/package.json+++ b/tests/ui_tests/package.json@@ -23,5 +23,12 @@},"dependencies": {"puppeteer": "^22.8.2"- }+ },+ "main": "auth_helper.js",+ "directories": {+ "test": "tests"+ },+ "keywords": [],+ "author": "",+ "license": "ISC"}diff --git a/tests/ui_tests/test_metrics_visibility.js b/tests/ui_tests/test_metrics_visibility.jsnew file mode 100644index 0000000000..7928e89aea--- /dev/null+++ b/tests/ui_tests/test_metrics_visibility.js@@ -0,0 +1,212 @@+const puppeteer = require('puppeteer');+const path = require('path');+const fs = require('fs');+const AuthHelper = require('./auth_helper');++// Test configuration+const BASE_URL = 'http://127.0.0.1:5000';+const SCREENSHOTS_DIR = path.join(__dirname, 'screenshots', 'metrics_visibility');++// Create screenshots directory if it doesn't exist+if (!fs.existsSync(SCREENSHOTS_DIR)) {+ fs.mkdirSync(SCREENSHOTS_DIR, { recursive: true });+}++async function delay(ms) {+ return new Promise(resolve => setTimeout(resolve, ms));+}++async function testMetricsPage() {+ const browser = await puppeteer.launch({+ headless: false, // Set to false to see the browser+ args: ['--no-sandbox', '--disable-setuid-sandbox']+ });++ const page = await browser.newPage();++ // Set viewport to standard desktop size+ await page.setViewport({ width: 1920, height: 1080 });++ // Initialize auth helper+ const auth = new AuthHelper(page, BASE_URL);++ try {+ // Register or login+ console.log('Attempting to authenticate...');+ await auth.ensureAuthenticated();+ console.log('Authentication successful!');++ // Take screenshot after login+ await page.screenshot({ path: path.join(SCREENSHOTS_DIR, '01_after_auth.png'), fullPage: true });++ // Navigate to metrics page+ console.log('Navigating to metrics page...');+ await page.goto(`${BASE_URL}/metrics/`, { waitUntil: 'networkidle0' });++ // Wait a bit for any dynamic content to load+ await delay(2000);++ // Take full page screenshot+ await page.screenshot({ path: path.join(SCREENSHOTS_DIR, '02_metrics_page.png'), fullPage: true });++ // Check if metrics page loaded+ const metricsTitle = await page.$('h1');+ if (metricsTitle) {+ const titleText = await page.evaluate(el => el.textContent, metricsTitle);+ console.log('Page title:', titleText);+ }++ // Check for the total-tokens element+ console.log('\n=== Checking Token Display ===');+ const tokenElement = await page.$('#total-tokens');++ if (tokenElement) {+ // Get all the relevant information about the element+ const tokenInfo = await page.evaluate(() => {+ const elem = document.getElementById('total-tokens');+ const computed = window.getComputedStyle(elem);+ const parentComputed = window.getComputedStyle(elem.parentElement);++ return {+ exists: true,+ textContent: elem.textContent,+ innerHTML: elem.innerHTML,+ color: computed.color,+ backgroundColor: computed.backgroundColor,+ fontSize: computed.fontSize,+ display: computed.display,+ visibility: computed.visibility,+ opacity: computed.opacity,+ parentBgColor: parentComputed.backgroundColor,+ // Check CSS variables+ primaryColor: getComputedStyle(document.documentElement).getPropertyValue('--primary-color'),+ accentPrimary: getComputedStyle(document.documentElement).getPropertyValue('--accent-primary'),+ textPrimary: getComputedStyle(document.documentElement).getPropertyValue('--text-primary'),+ textSecondary: getComputedStyle(document.documentElement).getPropertyValue('--text-secondary'),+ textMuted: getComputedStyle(document.documentElement).getPropertyValue('--text-muted'),+ bgPrimary: getComputedStyle(document.documentElement).getPropertyValue('--bg-primary'),+ bgSecondary: getComputedStyle(document.documentElement).getPropertyValue('--bg-secondary')+ };+ });++ console.log('Token element info:');+ console.log(' - Text content:', tokenInfo.textContent);+ console.log(' - Color:', tokenInfo.color);+ console.log(' - Background:', tokenInfo.backgroundColor);+ console.log(' - Font size:', tokenInfo.fontSize);+ console.log(' - Display:', tokenInfo.display);+ console.log(' - Visibility:', tokenInfo.visibility);+ console.log(' - Opacity:', tokenInfo.opacity);+ console.log(' - Parent background:', tokenInfo.parentBgColor);+ console.log('\nCSS Variables:');+ console.log(' - --primary-color:', tokenInfo.primaryColor);+ console.log(' - --accent-primary:', tokenInfo.accentPrimary);+ console.log(' - --text-primary:', tokenInfo.textPrimary);+ console.log(' - --text-secondary:', tokenInfo.textSecondary);+ console.log(' - --text-muted:', tokenInfo.textMuted);+ console.log(' - --bg-primary:', tokenInfo.bgPrimary);+ console.log(' - --bg-secondary:', tokenInfo.bgSecondary);++ // Highlight the element for screenshot+ await page.evaluate(() => {+ const elem = document.getElementById('total-tokens');+ elem.style.border = '3px solid red';+ elem.style.padding = '5px';+ });++ await page.screenshot({ path: path.join(SCREENSHOTS_DIR, '03_token_element_highlighted.png'), fullPage: true });++ // Try to make the text visible by changing color+ await page.evaluate(() => {+ const elem = document.getElementById('total-tokens');+ elem.style.color = 'red';+ elem.style.fontSize = '3rem';+ elem.textContent = 'TEST: ' + elem.textContent;+ });++ await page.screenshot({ path: path.join(SCREENSHOTS_DIR, '04_token_element_red.png'), fullPage: true });++ } else {+ console.log('❌ Token element (#total-tokens) not found!');+ }++ // Check all metric-label elements (the titles like "Total Tokens Used")+ console.log('\n=== Checking Metric Labels ===');+ const metricLabels = await page.$$eval('.metric-label', elements => {+ return elements.map(el => ({+ text: el.textContent.trim(),+ color: window.getComputedStyle(el).color,+ backgroundColor: window.getComputedStyle(el).backgroundColor,+ display: window.getComputedStyle(el).display,+ visibility: window.getComputedStyle(el).visibility,+ fontSize: window.getComputedStyle(el).fontSize,+ opacity: window.getComputedStyle(el).opacity+ }));+ });++ console.log('Found metric labels:', metricLabels.length);+ metricLabels.forEach(ml => {+ console.log(` - "${ml.text}" (color: ${ml.color}, bg: ${ml.backgroundColor}, display: ${ml.display}, visibility: ${ml.visibility}, opacity: ${ml.opacity})`);+ });++ // Check all metric-value elements+ console.log('\n=== Checking All Metric Values ===');+ const metricValues = await page.$$eval('.metric-value', elements => {+ return elements.map(el => ({+ id: el.id,+ text: el.textContent,+ color: window.getComputedStyle(el).color,+ display: window.getComputedStyle(el).display,+ visibility: window.getComputedStyle(el).visibility+ }));+ });++ console.log('Found metric values:', metricValues.length);+ metricValues.forEach(mv => {+ console.log(` - ${mv.id}: "${mv.text}" (color: ${mv.color}, display: ${mv.display}, visibility: ${mv.visibility})`);+ });++ // Check if Vite CSS is loaded+ console.log('\n=== Checking Vite Assets ===');+ const viteAssets = await page.evaluate(() => {+ const stylesheets = Array.from(document.querySelectorAll('link[rel="stylesheet"]')).map(link => link.href);+ const scripts = Array.from(document.querySelectorAll('script[src]')).map(script => script.src);++ return {+ stylesheets,+ scripts,+ hasViteCss: stylesheets.some(href => href.includes('/static/dist/css/')),+ hasViteJs: scripts.some(src => src.includes('/static/dist/js/'))+ };+ });++ console.log('Stylesheets loaded:');+ viteAssets.stylesheets.forEach(href => console.log(' -', href));+ console.log('Scripts loaded:');+ viteAssets.scripts.forEach(src => console.log(' -', src));+ console.log('Has Vite CSS:', viteAssets.hasViteCss);+ console.log('Has Vite JS:', viteAssets.hasViteJs);++ // Take a screenshot with DevTools open to show computed styles+ const client = await page.target().createCDPSession();+ await client.send('Inspector.enable');++ console.log('\n✅ Test completed! Check screenshots in:', SCREENSHOTS_DIR);++ } catch (error) {+ console.error('Error during test:', error);+ await page.screenshot({ path: path.join(SCREENSHOTS_DIR, 'error_state.png'), fullPage: true });+ } finally {+ // Keep browser open for manual inspection+ console.log('\nPress Ctrl+C to close the browser and exit...');+ // await browser.close();+ }+}++// Run the test+console.log('Starting metrics visibility test...');+console.log('Screenshots will be saved to:', SCREENSHOTS_DIR);+console.log('Base URL:', BASE_URL);+console.log('---\n');++testMetricsPage().catch(console.error);