layouts
All repositories: gitoria
3.0 KB
// tests/taps-audit.mjs — the in-page audit of mission 006: which tap targets are < 44 px and what is wider than the viewport.// AUDIT is a JS expression (a string) for page.evaluate; it returns { w, sw, taps: [{sel, w, h, text}], wide: [{sel, r}], inputs: [{sel, px}] }.// A tap target = a visible link, button, summary, select, textarea, text-like input, checkbox / radio (measured by the control or its label,// the bigger one), [role=button|tab|menuitem]. A link inside running text (its parent is a p / li / td / label / dd with other text) is// measured too but flagged `inline` — it is listed separately, because WCAG 2.5.8 exempts inline links in a sentence.export const AUDIT = `(() => {const vis = (el) => { const cs = getComputedStyle(el); if (cs.display === 'none' || cs.visibility === 'hidden' || cs.pointerEvents === 'none') return false; if (el.closest('.visually-hidden')) return false; const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0; };const sel = (el) => { let s = el.tagName.toLowerCase(); if (el.id) s += '#' + el.id; else if (el.className && typeof el.className === 'string') s += '.' + el.className.trim().split(/\\s+/).slice(0, 2).join('.'); const p = el.parentElement; if (p) s = p.tagName.toLowerCase() + (p.className && typeof p.className === 'string' ? '.' + p.className.trim().split(/\\s+/)[0] : '') + ' > ' + s; return s; };const els = [...document.querySelectorAll('a[href], button, summary, select, textarea, input:not([type=hidden]), [role=button], [role=tab], [role=menuitem], label.choose')];const taps = [], inputs = [];for (const el of els) {if (!vis(el)) continue;let r = el.getBoundingClientRect();if (el.matches('input[type=checkbox], input[type=radio]') && el.labels && el.labels[0]) { const l = el.labels[0].getBoundingClientRect(); if (l.width * l.height > r.width * r.height) r = l; }const inline = el.matches('a') && !!el.parentElement && /^(P|LI|TD|DD|LABEL|SMALL|SPAN|H[1-6]|DIV)$/.test(el.parentElement.tagName) && (el.parentElement.textContent.trim().length > el.textContent.trim().length + 2) && getComputedStyle(el).display === 'inline';const w = Math.round(r.width * 10) / 10, h = Math.round(r.height * 10) / 10;if (w < 43.99 || h < 43.99) taps.push({ sel: sel(el), w, h, inline, text: (el.getAttribute('aria-label') || el.textContent || el.value || '').trim().slice(0, 24) });if (el.matches('input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]), select, textarea')) { const px = parseFloat(getComputedStyle(el).fontSize); if (px < 16) inputs.push({ sel: sel(el), px }); }}const wide = [];for (const el of document.body.querySelectorAll('*')) {if (!vis(el) || el.closest('pre, code-editor, md-editor, .scroll, table')) continue;const r = el.getBoundingClientRect();if (r.right > window.innerWidth + 0.5) wide.push({ sel: sel(el), r: Math.round(r.right) });}return { w: window.innerWidth, sw: document.documentElement.scrollWidth, n: els.length, taps, wide: wide.slice(0, 20), nwide: wide.length, inputs };})()`;
Branches
Latest commits
- 0bcc6294Mission 011: e2e-197, brief, report, LOGmre
- 137303c5MainMenu marks the current page from the route (hybriel#197, server-rendered); current prop/item.current stay as fallback; tracker demo drops current; gate: SSR marker; docsmre
- 9325b403Re-vendor Hybriel to master 7f13a82f (hl:web batch 2: #190 #193 #197 #194 named regions); plugins whole, bin/hybriel static build (git-ignored)mre
- b31dc74dusage: calendar (theme 76f99f6-era ContentFirst, user menu, ☰ menu) and tracker (theme 76f99f6, modal + pagination current, own current marker until hybriel#197) rowsmre
- 8a3d5d40Mission 010: brief, report, LOG, STATUSmre
- a56abf1fSync components to components.hybriel 3794c59 (MdEditor real-key fixes); showcase real-key check on the md-editor pagemre
- 76f99f64E2E in lisbeth's Chrome for the menu's current page (mission 009): tests/e2e-menu-current.mjs, reportmre
- 159b1d53MainMenu/Sidebar: current page marked beyond colour, count badge, item current flag; gate 300/0 (mission 009)mre
- 0573eed3usage: notes + tickets on MdEditor (md-editor.js retired), gitoria on theme dbe3de7, tracker theme oldermre
- 78478f6eSync showcase to components.hybriel 1442e58: pick-mode page, comments attach, md-editor rows/files off; gates 285/0mre
- dbe3de79Display bugs from a real Chrome walk (mission 007): Settings page and in-shell doc reader instead of raw .md links, closed phone search hidden whatever a page says, /elements form rules scoped, three-pane danger contrast; display audit gate (132 -> 244 checks), walk + Settings e2e toolsmre
- 1875a051Theme: 44 px tap targets mobile first (layoutTap), 16 px fields, desktop denser only in @media 60rem; 390 px tap audit + gate checks (mission 006)mre
- 3d4f8e19Sync showcase to components.hybriel 9db927d: comments and files-upload pages, pagination onPage, md-editor readonly, gate 99 checksmre
- 64d635acmission brief 005mre
- 0d0fef25paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
- 2dbe0df5Re-vendor Hybriel to the shared static build 0f396652 (plugins; bin/ is git-ignored), compose cache volume + tmpfs /tmp, gate wait 120 s, report 004mre
- 0adc551emission brief 004mre
- 1376e905deploy.sh: wait up to DEPLOY_URL_WAIT (120 s) for 200 after the restart, as the other apps (cold compile, hybriel#148)mre
- c0fdbf6cdocker-compose: init: true (hybriel#156, PID 1 ignored SIGTERM, every restart waited 10 s)mre
- ecf70665usage: layouts on components a567b57mre