fix: Kontrast im hellen Theme (Text und Hauptknöpfe mit --accent-strong, Fokusring); Prüfskripte für die Oberfläche (#1174)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
34
scripts/ui-pruefung/ueberlagerung.mjs
Normal file
34
scripts/ui-pruefung/ueberlagerung.mjs
Normal file
@ -0,0 +1,34 @@
|
||||
import { start } from './lib.mjs';
|
||||
const BASE = process.env.NEXUS_BASE || 'http://127.0.0.1:18112';
|
||||
const S = process.argv[2]; const pw = process.argv[3]; const tag = process.argv[4];
|
||||
const b = await start();
|
||||
const pruefen = `(async () => {
|
||||
const sicht = e => { const s = getComputedStyle(e); const r = e.getBoundingClientRect(); return s.visibility !== 'hidden' && s.display !== 'none' && r.width > 0 && r.height > 0; };
|
||||
const ziele = Array.from(document.querySelectorAll('#chat button, #chat select, #chat textarea, #chat input, .chat-seite button, .chat-seite input, header a, header button')).filter(sicht);
|
||||
const probleme = []; let n = 0;
|
||||
for (const e of ziele) {
|
||||
e.scrollIntoView({ block: 'center', inline: 'nearest' });
|
||||
await new Promise(r => setTimeout(r, 15));
|
||||
const r = e.getBoundingClientRect(); const cx = Math.min(Math.max(r.left + r.width / 2, 1), innerWidth - 1), cy = Math.min(Math.max(r.top + r.height / 2, 1), innerHeight - 1);
|
||||
const top = document.elementFromPoint(cx, cy); n++;
|
||||
if (!(top === e || e.contains(top) || (top && top.closest('label') && top.closest('label').contains(e)))) probleme.push((e.id || e.tagName) + ':' + (e.textContent || e.name || '').trim().slice(0, 14) + ' verdeckt von ' + (top ? top.tagName + (top.id ? '#' + top.id : '') + '.' + String(top.className).slice(0, 20) : 'nichts'));
|
||||
}
|
||||
const hint = Array.from(document.querySelectorAll('main p')).find(e => e.textContent.trim().startsWith('Der Chat läuft mit den Rechten'));
|
||||
const karte = document.getElementById('chat');
|
||||
const hr = hint.getBoundingClientRect(), kr = karte.getBoundingClientRect();
|
||||
const hinweisUeberKarte = hr.top + scrollY < kr.bottom + scrollY - 1;
|
||||
const querScroll = document.documentElement.scrollWidth > innerWidth + 1;
|
||||
return JSON.stringify({vp: [innerWidth, innerHeight], elemente: n, verdeckt: probleme, hinweisUeberKarte, querScroll});
|
||||
})()`;
|
||||
const fall = [[390,844,false,'390x844'],[390,844,true,'390x844 + Verlauf an'],[320,568,false,'320x568'],[320,568,true,'320x568 + Verlauf an'],[844,390,false,'Querformat 844x390'],[844,390,true,'Querformat + Verlauf an'],[390,380,false,'Tastatur 390x380'],[320,320,false,'Tastatur 320x320'],[195,422,false,'200% Zoom von 390x844'],[160,284,false,'200% Zoom von 320x568'],[1290,952,false,'Desktop 1290x952'],[1290,952,true,'Desktop, Verlauf aus']];
|
||||
try {
|
||||
await b.login(BASE, 'claude', pw);
|
||||
for (const [w, h, sidebar, name] of fall) {
|
||||
await b.viewport(w, h, { dsf: 1, mobile: w < 700 });
|
||||
await b.goto(BASE + '/ui/chat');
|
||||
// Seitenleiste: mobil ist sie standardmäßig zu (display:none ohne Klasse), „Verlauf ein/aus“ schaltet; Desktop: offen, true = zuklappen
|
||||
if (sidebar) await b.eval(`document.getElementById('chat-seite-knopf').click(); 1`);
|
||||
await new Promise(r => setTimeout(r, 200));
|
||||
console.log(name.padEnd(28), await b.eval(pruefen));
|
||||
}
|
||||
} finally { b.close(); }
|
||||
Reference in New Issue
Block a user