diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bab5edf..399a160 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,10 +85,15 @@ jobs: - name: Verify HTTP headers, browser OCR and downloads on built artifact run: node tests/production/local-smoke.mjs + - name: Verify responsive navigation, metadata layouts and accessibility + run: node tests/browser/responsive.mjs + - name: Retain artifact browser diagnostics if: failure() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: artifact-browser-diagnostics - path: .ts-build/production-smoke + path: | + .ts-build/production-smoke + .ts-build/responsive retention-days: 7 diff --git a/404.html b/404.html index f8b9386..afdc408 100644 --- a/404.html +++ b/404.html @@ -21,7 +21,9 @@ - +

404

This page is not here.

The address may be outdated or mistyped.

Return home
diff --git a/about/index.html b/about/index.html index a1d4607..47f146e 100644 --- a/about/index.html +++ b/about/index.html @@ -34,21 +34,17 @@ - + +

About

diff --git a/css/base.css b/css/base.css index e3f4b1b..14cfca5 100644 --- a/css/base.css +++ b/css/base.css @@ -68,11 +68,11 @@ } *, *::before, *::after { box-sizing: border-box; } -html { scroll-behavior: smooth; scroll-padding-top: 6rem; } +html { font-family: var(--font-sans); scroll-behavior: smooth; scroll-padding-top: 6rem; } body { margin: 0; - min-width: 20rem; + min-width: 0; min-height: 100vh; background: var(--bg-primary); color: var(--text-primary); diff --git a/css/categories.css b/css/categories.css index 29f8db0..8993a12 100644 --- a/css/categories.css +++ b/css/categories.css @@ -24,3 +24,8 @@ a.category-tool:hover { border-color: var(--border-strong); transform: translate .category-tool { min-height: 10rem; } } @media (prefers-reduced-motion: reduce) { a.category-tool:hover { transform: none; } } + +@media (max-width: 38rem) { + .category-nav__inner { flex-wrap: nowrap; padding-block: var(--space-1); gap: var(--space-1); } + .category-nav a { white-space: nowrap; padding-inline: var(--space-3); } +} diff --git a/css/components.css b/css/components.css index 745d046..170516f 100644 --- a/css/components.css +++ b/css/components.css @@ -25,7 +25,7 @@ .button:disabled { border-color: var(--border); background: var(--bg-subtle); color: var(--status-muted); cursor: not-allowed; } .control { - min-height: 2.5rem; + min-height: 2.75rem; min-width: 0; max-width: 7.5rem; padding: 0.4rem 1.8rem 0.4rem 0.65rem; @@ -59,6 +59,41 @@ .header-inner > *, .header-controls > *, .control-label > span { min-width: 0; } .header-controls { display: flex; min-width: 0; flex: 0 1 auto; align-items: center; gap: var(--space-3); } +.header-menu { min-width: 0; flex: 1; margin: 0; } +.header-menu > summary { width: fit-content; min-height: 2.75rem; margin-left: auto; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-secondary); font-weight: var(--font-weight-semibold); cursor: pointer; } +.header-menu__content { display: flex; align-items: center; gap: var(--space-5); } +.header-menu[data-desktop] > summary { display: none; } + +/* Keep native form semantics and mobile pickers; inherit the resolved theme. */ +select.control, .field select { + appearance: none; + padding-inline-end: var(--space-7); + background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%); + background-position: right 1rem center, right .7rem center; + background-size: .3rem .3rem; + background-repeat: no-repeat; + color-scheme: inherit; + text-overflow: ellipsis; +} +select option, select optgroup { background: var(--bg-secondary); color: var(--text-primary); } +.field select { max-width: 100%; padding-inline-start: .7rem; } +.field select:disabled { background-color: var(--bg-subtle); color: var(--status-muted); cursor: not-allowed; } +select:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; } + +/* Enhance only fine-pointer desktop pickers where the browser supports it. */ +@supports (appearance: base-select) { + @media (min-width: 38.001rem) and (pointer: fine) { + select.control, .field select, ::picker(select) { appearance: base-select; } + select.control, .field select { background-image: none; padding-inline-end: var(--space-3); } + ::picker(select) { padding: var(--space-1); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-primary); box-shadow: var(--shadow-sm); } + select::picker-icon { color: var(--text-secondary); } + select option { min-height: 2.75rem; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); overflow-wrap: anywhere; } + select option:checked { background: var(--accent-soft); color: var(--text-primary); } + select option:hover, select option:focus { background: var(--bg-subtle); outline: 2px solid var(--focus); outline-offset: -2px; } + } +} +@media (forced-colors: active) { select.control, .field select { appearance: auto; background-image: none; } } + .site-footer { padding-block: var(--space-7); border-top: 1px solid var(--border); } .footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-6); } .footer-inner p { margin: var(--space-3) 0 0; color: var(--text-secondary); font-size: var(--font-size-sm); } @@ -66,15 +101,21 @@ @media (max-width: 68rem) { .header-inner { flex-wrap: wrap; padding-block: var(--space-3); gap: var(--space-3) var(--space-5); } + .header-menu__content { flex-wrap: wrap; gap: var(--space-3); } .site-nav { order: 3; width: 100%; padding-top: var(--space-3); border-top: 1px solid var(--border); } .header-controls { margin-left: auto; } } @media (max-width: 38rem) { + .header-inner { position: relative; min-height: 4.25rem; gap: var(--space-3); } + .header-menu { flex: 0 0 auto; margin-left: auto; } + .header-menu[open] { flex-basis: 100%; } + .header-menu[open] > summary { position: absolute; top: var(--space-3); right: 0; } + .header-menu__content { flex-direction: column; align-items: stretch; padding-block: var(--space-4); gap: var(--space-5); } .header-controls { width: 100%; align-items: stretch; flex-direction: column; margin-left: 0; } .control-label { width: 100%; justify-content: space-between; } .control, .control[data-language-select] { width: min(100%, 12rem); max-width: none; } - .site-nav { justify-content: flex-start; gap: var(--space-2) var(--space-4); } + .site-nav { order: 0; justify-content: flex-start; gap: var(--space-2) var(--space-4); } .site-nav a { font-size: 0.8rem; } .footer-inner { flex-direction: column; } } diff --git a/docs/v2.3-mobile-ux.md b/docs/v2.3-mobile-ux.md new file mode 100644 index 0000000..aee4277 --- /dev/null +++ b/docs/v2.3-mobile-ux.md @@ -0,0 +1,87 @@ +# Mobile UX pass — Issue #128 + +This development pass follows the PR #127 normal merge into `v2.3` at +`91e89a70fe37452b3e2b767135a387f400f04436`. It does not promote production +or close the security audit's outstanding activation/coverage/live-delivery limits. + +## Shared UI inventory and decisions + +- The 19 canonical pages and 404 page repeat one header structure. Navigation + and language/theme controls now share one native `details` disclosure, with + a translated Menu summary in all six catalogs. No duplicate controls or IDs. + Without JavaScript it remains a working disclosure at every width. With JS, + desktop/tablet navigation is open and the summary hidden above 38rem; mobile + starts closed. Enter/Space and expanded semantics are native, Escape returns + focus to the summary, and there is no modal or focus trap. Crossing the + breakpoint resets the disclosure and preserves a visible keyboard focus. +- All category/tool pages use `.category-nav__inner`. Mobile reduces padding + to `--space-1`, keeps a single scrollable row and 44px link targets, and + retains `aria-current`. Neither header nor categories become sticky. +- Inspected `base`, `components`, `pages`, `categories`, shared tool CSS and all + eleven per-tool stylesheets. Existing layout breakpoints span 24, 30, 38, + 42, 44, 46, 48, 52, 54, 56 and 68rem; this pass retains existing desktop and + tool grid breakpoints. Shared mobile workspace/section gaps use `--space-6` + instead of scattered child margins. Metadata cards/results/limitations and + status spacing use the same tokens; desktop gaps remain unchanged. +- Both metadata scope asides move in actual document order after the cleaning + result/comparison and before the existing polite live status. All scope text, + localized keys, heading IDs and supported/unsupported claims are retained. + Shared typography/padding removes the large heading/accent-bar treatment; + limitations remain visible, without an extra disclosure. +- The inherited font reset previously reset body/controls to the root's browser + default. Root font-family now establishes the existing intended system font. + Removing the body's 320px minimum avoids overflow when a classic scrollbar + reduces the available content width at a 320px viewport. + +### Select inventory + +Every production header has language and theme selects. Tool-specific selects: + +| Tool | Native selects | +| --- | --- | +| Image Converter, Resize, Compressor | Output format | +| Image to Text, PDF to Text | OCR language | +| Images to PDF | Page size, orientation, fit, quality | +| PDF to Images | Image format, render scale | +| Metadata, PDF Merge/Split/Organizer | Global preference selects only | + +Resize dimensions/compression quality use existing inputs/radio/range controls; +these do not need dropdown adapters. The retired `/tools/privacy/` source is +not a canonical built page; its URL is a permanent redirect to `/privacy/`. + +**Strategy: enhanced native selects.** Shared appearance, CSS arrow, option +palette, resolved `color-scheme`, focus and disabled treatment cover all selects. +Fine-pointer desktop browsers supporting `appearance: base-select` also receive +a themed native picker with selected/hover/focus states. Other browsers retain +native options and apply supported colors; mobile keeps its platform picker. +Forced-colors restores the native appearance. No custom ARIA listbox, library, +portal, script-based option rendering or new runtime dependency is introduced. + +This deliberately preserves platform keyboard, typeahead, touch and assistive +technology behavior. Complete identical OS popup rendering is not promised. +See [MDN's native select customization](https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Customizable_select) +and [option styling limits](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/option). + +## Reproducible verification + +`node tests/browser/responsive.mjs` uses the real built artifact/server and +strict hosting-header validation. It covers 441 combinations: seven viewports +(320×568, 360×800, 375×812, 390×844, 430×932, 768×1024, 1280×900), seven routes +(home, Image category, Converter, Image OCR, PDF Merge, both Metadata tools), +EN/KO/JA, and System/Light/Dark. It checks compact height, native disclosure tab +order/Escape, current/single-row categories, overflow/control bounds, heading/skip +targets, scope order, long CJK PDF metadata and real metadata-clean downloads. +It also checks system theme changes, native select keyboard selection, and no-JS +navigation. Existing full i18n checks cover all six catalogs. Diagnostics and +screenshots are written under `.ts-build/responsive` and retained on CI failure. + +Local pinned install, build/artifact validation, real English/Korean/combined OCR, +fresh lockfile/vendor advisories and structural tests passed. Local full tests +reach the strict HTTP gate and fail closed because installed AdGuard rewrites +CSP to allow `local.adguard.org`, changes `connect-src`, and injects scripts. +No expected policy, network assertion or app CSP is relaxed for that environment. +Clean GitHub CI is required for the complete HTTP/browser/security result. + +The review PR records final CI evidence. A physical iOS/Android picker and a +screen reader on each OS remain useful manual follow-up; browser emulation and +semantic/keyboard checks do not claim to replace those device/AT combinations. diff --git a/index.html b/index.html index 1040b0e..b5ec6da 100644 --- a/index.html +++ b/index.html @@ -34,19 +34,16 @@ -
diff --git a/js/locales/de.js b/js/locales/de.js index 5570cb2..0653091 100644 --- a/js/locales/de.js +++ b/js/locales/de.js @@ -66,6 +66,7 @@ export const de = { } }, "common": { + "menu": "Menü", "skip": "Zum Hauptinhalt springen", "brandTagline": "Private Dateitools, direkt auf Ihrem Gerät", "nav": { diff --git a/js/locales/en.js b/js/locales/en.js index a1930b8..0a6dd6e 100644 --- a/js/locales/en.js +++ b/js/locales/en.js @@ -18,6 +18,7 @@ export const en = { mediaCategory: { title: "Media tools — Secure Tools", description: "Local audio and video utilities from Secure Tools." }, }, common: { + menu: "Menu", skip: "Skip to main content", brandTagline: "Private utilities, processed on your device", nav: { tools: "Tools", privacy: "Privacy", source: "Source", about: "About" }, aria: { home: "Secure Tools home", primaryNavigation: "Primary navigation", footerNavigation: "Footer navigation", toolCategories: "Tool categories", localProcessingSummary: "Local processing summary" }, diff --git a/js/locales/es.js b/js/locales/es.js index 41ef690..e9b8424 100644 --- a/js/locales/es.js +++ b/js/locales/es.js @@ -66,6 +66,7 @@ export const es = { } }, "common": { + "menu": "Menú", "skip": "Saltar al contenido principal", "brandTagline": "Herramientas privadas, procesadas en tu dispositivo", "nav": { diff --git a/js/locales/fr.js b/js/locales/fr.js index ca311ac..cdf1421 100644 --- a/js/locales/fr.js +++ b/js/locales/fr.js @@ -66,6 +66,7 @@ export const fr = { } }, "common": { + "menu": "Menu", "skip": "Passer au contenu principal", "brandTagline": "Outils privés, traités sur votre appareil", "nav": { diff --git a/js/locales/ja.js b/js/locales/ja.js index 2c1ed66..52a8ea1 100644 --- a/js/locales/ja.js +++ b/js/locales/ja.js @@ -66,6 +66,7 @@ export const ja = { } }, "common": { + "menu": "メニュー", "skip": "メインコンテンツへ移動", "brandTagline": "端末内で処理するプライバシーツール", "nav": { diff --git a/js/locales/ko.js b/js/locales/ko.js index 39074b5..1f29d5c 100644 --- a/js/locales/ko.js +++ b/js/locales/ko.js @@ -18,6 +18,7 @@ export const ko = { mediaCategory: { title: "미디어 도구 — Secure Tools", description: "Secure Tools의 로컬 오디오 및 비디오 유틸리티입니다." }, }, common: { + menu: "메뉴", skip: "본문으로 바로가기", brandTagline: "기기에서 바로 처리하는 프라이버시 중심 도구", nav: { tools: "도구", privacy: "개인정보 보호", source: "소스", about: "소개" }, aria: { home: "Secure Tools 홈", primaryNavigation: "주 탐색", footerNavigation: "바닥글 탐색", toolCategories: "도구 카테고리", localProcessingSummary: "로컬 처리 요약" }, diff --git a/js/main.js b/js/main.js index 7371d64..014db95 100644 --- a/js/main.js +++ b/js/main.js @@ -1,10 +1,12 @@ import { REPOSITORY_URL } from "./config.js"; import { initializeI18n } from "./i18n.js"; import { initializeTheme } from "./theme.js"; +import { initializeNavigation } from "./navigation.js"; document.querySelectorAll("[data-repository-link]").forEach((link) => { link.href = REPOSITORY_URL; }); +initializeNavigation(); initializeTheme(); initializeI18n(); diff --git a/js/navigation.js b/js/navigation.js new file mode 100644 index 0000000..3d8cbc0 --- /dev/null +++ b/js/navigation.js @@ -0,0 +1,29 @@ +// The native disclosure remains usable when scripts or preference storage fail. +export function initializeNavigation() { + const desktop = window.matchMedia('(min-width: 38.001rem)'); + document.querySelectorAll('.header-menu').forEach((menu) => { + const summary = menu.querySelector('summary'); + const update = () => { + const focusInside = menu.contains(document.activeElement); + menu.open = desktop.matches; + menu.toggleAttribute('data-desktop', desktop.matches); + if (!desktop.matches && focusInside) summary.focus(); + }; + update(); + desktop.addEventListener('change', update); + menu.addEventListener('keydown', (event) => { + if (event.key === 'Escape' && !desktop.matches && menu.open) { + event.preventDefault(); + menu.open = false; + summary.focus(); + } + }); + menu.querySelectorAll('nav a').forEach((link) => link.addEventListener('click', () => { + if (!desktop.matches) { + menu.open = false; + summary.focus(); + } + })); + menu.dataset.navigationReady = 'true'; + }); +} diff --git a/privacy/index.html b/privacy/index.html index 0d3504f..e6b573f 100644 --- a/privacy/index.html +++ b/privacy/index.html @@ -35,21 +35,17 @@ - + +

Privacy model

diff --git a/tests/browser/responsive.mjs b/tests/browser/responsive.mjs new file mode 100644 index 0000000..c5f35e0 --- /dev/null +++ b/tests/browser/responsive.mjs @@ -0,0 +1,149 @@ +import assert from 'node:assert/strict'; +import fs from 'node:fs/promises'; +import { spawn } from 'node:child_process'; +import { chromium } from 'playwright'; +import { translations } from '../../js/i18n.js'; +import { createFixtures, PDFLib } from '../production/fixtures.mjs'; +import { assertSecurityHeaders } from '../../scripts/http-security-headers.mjs'; + +// Exercise the real built pages and native controls; never substitute app code/CSP. +const viewports = [[320,568],[360,800],[375,812],[390,844],[430,932],[768,1024],[1280,900]]; +const routes = ['/', '/image/', '/image/converter/', '/image/to-text/', '/pdf/merge/', '/pdf/metadata/', '/image/metadata/']; +const directory = '.ts-build/responsive'; +await fs.mkdir(directory, { recursive: true }); +const report = { cases: [], errors: [], headerErrors: [], external: [], status: 'FAIL' }; +const port = 44000 + Math.floor(Math.random() * 9000); +const origin = `http://127.0.0.1:${port}`; +const server = spawn(process.execPath, ['tests/serve-ocr-smoke.mjs', String(port)], { stdio: ['ignore','pipe','inherit'] }); +let browser; +try { + await new Promise((resolve,reject) => { + const timer = setTimeout(() => reject(new Error('Responsive server timed out')),10000); + server.stdout.once('data', () => { clearTimeout(timer); resolve(); }); + server.once('error', reject); + server.once('exit', code => reject(new Error(`Server exited ${code}`))); + }); + browser = await chromium.launch(); + const fixtures = await createFixtures(browser); + const pdf = await PDFLib.PDFDocument.load(fixtures.replacement.buffer); + pdf.setTitle('Mobile metadata — 한국어 日本語 '.repeat(12)); + const pdfFile = { name: '모바일-メタデータ.pdf', mimeType: 'application/pdf', buffer: Buffer.from(await pdf.save()) }; + for (const language of ['en','ko','ja']) for (const theme of ['system','light','dark']) { + const context = await browser.newContext({ locale: language, colorScheme: theme === 'light' ? 'light' : 'dark', acceptDownloads: true }); + await context.addInitScript(({language,theme}) => { + // Exercise the browser download fallback without opening an OS save dialog. + delete window.showSaveFilePicker; + localStorage.setItem('secure-tools-language', language); + localStorage.setItem('secure-tools-theme', theme); + document.addEventListener('securitypolicyviolation', event => console.error(`CSP: ${event.effectiveDirective} ${event.blockedURI}`)); + }, {language,theme}); + context.on('request', request => { + if (!request.url().startsWith(origin + '/') && !/^(blob:|data:|about:)/.test(request.url())) report.external.push(request.url()); + }); + const page = await context.newPage(); + page.on('pageerror', error => report.errors.push(error.message)); + page.on('console', message => { if (message.type() === 'error') report.errors.push(message.text()); }); + for (const [width,height] of viewports) { + await page.setViewportSize({width,height}); + for (const route of routes) { + report.active = {language,theme,width,height,route}; + const response = await page.goto(origin + route); + if (!report.headerErrors.length) { + try { assertSecurityHeaders(new Headers(response.headers())); } + catch (error) { report.headerErrors.push(error.message); } + } + await page.waitForFunction(({language,theme}) => document.documentElement.lang === language && document.documentElement.dataset.theme === theme && document.querySelector('.header-menu')?.dataset.navigationReady === 'true', {language,theme}); + const menu = page.locator('.header-menu'); + const summary = menu.locator(':scope > summary'); + const mobile = width <= 608; + assert.equal(await menu.evaluate(el => el.open), !mobile); + if (mobile) { + assert.ok((await page.locator('.site-header').boundingBox()).height <= 80, 'Collapsed mobile header stays compact'); + assert.equal(await page.locator('.site-nav').isVisible(), false); + await summary.focus(); await page.keyboard.press('Enter'); + assert.equal(await menu.evaluate(el => el.open), true); + assert.equal(await page.locator('.site-nav a').count(), 4); + assert.ok(await page.locator('[data-language-select]').isVisible()); + assert.ok(await page.locator('[data-theme-select]').isVisible()); + assert.equal(await summary.innerText(), translations[language].common.menu); + await page.keyboard.press('Tab'); + assert.ok(await page.locator('.site-nav a').first().evaluate(el => el === document.activeElement), 'Links follow disclosure in tab order'); + await page.keyboard.press('Escape'); + assert.equal(await menu.evaluate(el => el.open), false); + assert.ok(await summary.evaluate(el => el === document.activeElement)); + } + const category = page.locator('.category-nav__inner'); + if (await category.count()) { + const rects = await category.locator('a').evaluateAll(links => links.map(link => { const r = link.getBoundingClientRect(); return {top:r.top,height:r.height}; })); + assert.ok(rects.every(r => Math.abs(r.top - rects[0].top) < 1 && r.height >= 44), 'Single-row category navigation retains touch targets'); + assert.equal(await page.locator('.category-nav [aria-current="page"]').count(), 1); + if (mobile) assert.ok((await page.locator('.category-nav').boundingBox()).height <= 64); + await category.evaluate(el => { el.scrollLeft = el.scrollWidth; }); + } + const scope = page.locator('.scope-note'); + if (await scope.count()) { + assert.ok(await scope.evaluate(el => { + const result = document.querySelector('.clean-result, .metadata-comparison'); + return !!(result.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING); + }), 'Scope follows results in source order at every viewport'); + } + const overflow = await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth + 1); + assert.equal(overflow, false, `${language}/${theme}/${width} ${route}: page overflow`); + const clipped = await page.locator('select:visible').evaluateAll(selects => selects.filter(el => {const r=el.getBoundingClientRect(); return r.left < -1 || r.right > innerWidth + 1 || r.width < 40;}).map(el => el.id)); + assert.deepEqual(clipped, [], 'Visible selects stay inside viewport'); + assert.equal(await page.locator('h1').count(), 1); + assert.equal(await page.locator('.skip-link[href="#main"]').count(), 1); + // Populate metadata and settings pages at each width, including long CJK metadata. + if (theme === 'dark' && route.includes('/metadata/')) { + await page.locator('#file-input').setInputFiles(route.startsWith('/pdf') ? pdfFile : fixtures.english); + const clean = page.locator(route.startsWith('/pdf') ? '#clean-pdf' : '#clean-image'); + await clean.waitFor({state:'visible'}); + await page.waitForFunction(selector => !document.querySelector(selector).disabled, route.startsWith('/pdf') ? '#clean-pdf' : '#clean-image'); + const download = page.waitForEvent('download'); await clean.click(); await download; + await page.locator(route.startsWith('/pdf') ? '.metadata-comparison' : '.clean-result').waitFor({state:'visible'}); + assert.equal(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth + 1), false, 'Populated metadata has no page overflow'); + assert.ok((await scope.boundingBox()).y > (await page.locator('.metadata-workspace').boundingBox()).y); + } + if (language === 'ko' && theme === 'dark' && [320,390,768,1280].includes(width)) { + await page.screenshot({path:`${directory}/${width}-${route.replaceAll('/','_') || 'home'}.png`,fullPage:true}); + } + report.cases.push({language,theme,width,height,route,passed:true}); + } + } + // Native select keyboard and resolved system theme remain functional. + await page.setViewportSize({width:1280,height:900}); + await page.goto(origin + '/'); + await page.locator('[data-theme-select]').selectOption('light'); + await page.waitForFunction(() => document.documentElement.dataset.resolvedTheme === 'light'); + await page.locator('[data-theme-select]').selectOption('system'); + await page.emulateMedia({colorScheme:'dark',reducedMotion:'reduce'}); + await page.waitForFunction(() => document.documentElement.dataset.resolvedTheme === 'dark'); + await page.locator('[data-language-select]').selectOption(language); + if (language === 'en' && theme === 'system') { + const select = page.locator('[data-language-select]'); + await select.selectOption('en'); await select.focus(); + await page.keyboard.press('Space'); await page.keyboard.press('End'); await page.keyboard.press('Enter'); + assert.equal(await select.inputValue(), 'fr', 'Native popup supports keyboard selection'); + await select.selectOption('en'); + await page.keyboard.press('Space'); await page.keyboard.press('Escape'); + assert.equal(await select.inputValue(), 'en', 'Escape leaves selection unchanged'); + } + await context.close(); + console.log(`Responsive matrix: ${language}/${theme} complete (${report.cases.length} cases)`); + } + // All six localized menu names and no-JS semantic navigation fallback. + const context = await browser.newContext({javaScriptEnabled:false,viewport:{width:320,height:568}}); + const page = await context.newPage(); await page.goto(origin + '/'); + await page.locator('.header-menu > summary').click(); + assert.ok(await page.locator('.site-nav').isVisible()); + await context.close(); + for (const language of ['en','ko','ja','es','de','fr']) assert.ok(translations[language].common.menu); + assert.deepEqual(report.headerErrors, [], 'Served headers must preserve strict CSP'); + assert.deepEqual(report.external, [], 'No external requests or telemetry'); + assert.deepEqual(report.errors, [], 'No page/console/CSP errors'); + report.status = 'PASS'; + console.log(`Responsive/accessibility matrix passed: ${report.cases.length} cases, populated metadata, themes, keyboard and no-JS navigation.`); +} finally { + await fs.writeFile(`${directory}/report.json`, JSON.stringify(report,null,2)); + await browser?.close(); server.kill(); +} diff --git a/tests/i18n-quality.test.mjs b/tests/i18n-quality.test.mjs index 7ce23a2..36e5e46 100644 --- a/tests/i18n-quality.test.mjs +++ b/tests/i18n-quality.test.mjs @@ -46,7 +46,7 @@ function placeholders(value) { function testCatalogParityAndQuality() { assert.deepEqual([...Object.keys(translations)], [...languageNames.keys()]); const english = flatten(translations.en); - assert.equal(english.size, 896); + assert.equal(english.size, 897); for (const [language, catalog] of Object.entries(translations)) { const flattened = flatten(catalog); diff --git a/tests/typography-i18n-layout.test.mjs b/tests/typography-i18n-layout.test.mjs index 9871be8..c26ff54 100644 --- a/tests/typography-i18n-layout.test.mjs +++ b/tests/typography-i18n-layout.test.mjs @@ -43,7 +43,7 @@ function testLocaleWrappingPolicy() { const nowrapRules = [...css.matchAll(/([^{}]+)\{[^{}]*white-space:\s*nowrap/g)].map((match) => match[1].trim()); for (const selector of nowrapRules) { - assert.match(selector, /brand|visually-hidden|source-name|queue-name|metadata-table thead/, `Unexpected nowrap rule: ${selector}`); + assert.match(selector, /brand|visually-hidden|source-name|queue-name|metadata-table thead|category-nav a/, `Unexpected nowrap rule: ${selector}`); } } @@ -58,7 +58,8 @@ function testControlAndLongCopyLayout() { assert.match(tools, /\.tool-layout > \*[^}]*min-width:\s*0/); assert.match(tools, /\.mode-option strong, \.mode-option span\s*\{[^}]*overflow-wrap:\s*anywhere/); assert.match(metadata, /\.metadata-value\s*\{[^}]*overflow-wrap:\s*anywhere[^}]*white-space:\s*pre-wrap/); - assert.match(base, /body\s*\{[^}]*min-width:\s*20rem/); + assert.match(base, /html\s*\{[^}]*font-family:\s*var\(--font-sans\)/); + assert.match(base, /body\s*\{[^}]*min-width:\s*0/); } function testNoRemoteFontResources() { diff --git a/tools/image/compress/index.html b/tools/image/compress/index.html index 18576d1..699da4f 100644 --- a/tools/image/compress/index.html +++ b/tools/image/compress/index.html @@ -22,7 +22,9 @@ Image Compressor — Secure Tools - +

Image tool

Image Compressor

Re-encode JPEG, PNG, and WebP images locally and compare the resulting file sizes.

Add your images

Drop files here or use the picker. JPEG, PNG, and WebP can be mixed.

Processed locally. Your images never leave this device. How privacy works

diff --git a/tools/image/converter/index.html b/tools/image/converter/index.html index 55654f8..cbd2d31 100644 --- a/tools/image/converter/index.html +++ b/tools/image/converter/index.html @@ -38,16 +38,12 @@ -
diff --git a/tools/image/index.html b/tools/image/index.html index 0fd9349..0a7d603 100644 --- a/tools/image/index.html +++ b/tools/image/index.html @@ -37,20 +37,17 @@ -
+