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:
26
scripts/ui-pruefung/fokus-aktualisierung.mjs
Normal file
26
scripts/ui-pruefung/fokus-aktualisierung.mjs
Normal file
@ -0,0 +1,26 @@
|
||||
import { start } from './lib.mjs';
|
||||
const BASE = process.env.NEXUS_BASE || 'http://127.0.0.1:18112';
|
||||
const pw = process.argv[2]; const tag = process.argv[3] || 'vorher';
|
||||
const b = await start();
|
||||
const lade = n => `(async () => { const cs = document.body.getAttribute('data-csrf'); const r = await fetch('/ui/modelle/${n}', {method:'POST', redirect:'manual', headers:{'content-type':'application/x-www-form-urlencoded'}, body:new URLSearchParams({csrf: cs, name: 'zweit'})}); return r.type; })()`;
|
||||
try {
|
||||
await b.login(BASE, 'claude', pw);
|
||||
await b.viewport(1200, 800, { dsf: 1, mobile: false });
|
||||
// Teil 1: offener Dialog mit ungesendetem Wert
|
||||
await b.goto(BASE + '/ui/modelle');
|
||||
await b.eval(`(() => { const k = Array.from(document.querySelectorAll('button[data-dialog]')).find(x => x.closest('tr') && x.closest('tr').textContent.includes('testmodell')); k.click(); const d = document.querySelector('dialog[open]'); const i = d.querySelector('input[name=vram_mb]'); i.focus(); i.value = '4321'; window.__dlg = d.id; return d.id; })()`);
|
||||
console.log('Dialog offen, Wert getippt:', await b.eval(`JSON.stringify({offen: !!document.querySelector('dialog[open]'), wert: document.querySelector('dialog[open] input[name=vram_mb]').value})`));
|
||||
await b.eval(lade('laden'));
|
||||
await new Promise(r => setTimeout(r, 9000));
|
||||
console.log('9 s nach Änderung einer anderen Zeile:', await b.eval(`JSON.stringify({offen: !!document.querySelector('dialog[open]'), wert: (document.getElementById(window.__dlg) && document.getElementById(window.__dlg).querySelector('input[name=vram_mb]').value), zeileZweit: (Array.from(document.querySelectorAll('tbody tr')).find(t => t.textContent.includes('zweit')) || {textContent: ''}).textContent.replace(/\\s+/g, ' ').slice(-70)})`));
|
||||
// Teil 2: Filter mit Cursor mitten im Text
|
||||
await b.eval(`(() => { const d = document.querySelector('dialog[open]'); if (d) d.close(); return 1; })()`);
|
||||
await b.eval(`(async () => { const cs = document.body.getAttribute('data-csrf'); await fetch('/ui/modelle/entladen', {method:'POST', redirect:'manual', headers:{'content-type':'application/x-www-form-urlencoded'}, body:new URLSearchParams({csrf: cs, name: 'zweit'})}); return 1; })()`);
|
||||
await new Promise(r => setTimeout(r, 5000));
|
||||
await b.goto(BASE + '/ui/modelle');
|
||||
await b.eval(`(() => { const f = document.querySelector('input[placeholder^="Name"]'); f.focus(); f.value = 'testmodel'; f.dispatchEvent(new Event('input', {bubbles: true})); f.setSelectionRange(4, 4); window.__f = 1; return 1; })()`);
|
||||
console.log('Filter fokussiert, Cursor an Position 4:', await b.eval(`JSON.stringify({aktiv: document.activeElement.tagName + '/' + (document.activeElement.type || ''), wert: document.activeElement.value, cursor: document.activeElement.selectionStart})`));
|
||||
await b.eval(lade('laden'));
|
||||
await new Promise(r => setTimeout(r, 9000));
|
||||
console.log('9 s nach Änderung einer anderen Zeile:', await b.eval(`JSON.stringify({aktiv: document.activeElement.tagName + '/' + (document.activeElement.type || ''), wert: document.activeElement.value, cursor: document.activeElement.selectionStart, filterWert: (document.querySelector('input[placeholder^="Name"]') || {}).value})`));
|
||||
} finally { b.close(); }
|
||||
Reference in New Issue
Block a user