fix(chat): Stopp im Mini-Player entfällt, Schließen beendet die Wiedergabe (#1195)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmHhg7qE8FdhchzsBrwgjZ
This commit is contained in:
2026-11-22 10:24:32 +01:00
parent 7bd5fe9ada
commit cbf8cecc4e
3 changed files with 7 additions and 9 deletions

View File

@ -7,7 +7,7 @@ const BASE=process.env.NEXUS_BASE||'http://127.0.0.1:18122', pw=process.argv[2];
const b=await cdp.start({port:9374,args:['--autoplay-policy=no-user-gesture-required']});
const ok=(n,c,d='')=>{console.log(`${c?'ok ':'FEHLER'} ${n}${d?' – '+d:''}`); if(!c) process.exitCode=1;};
const warte=ms=>new Promise(r=>setTimeout(r,ms));
const zustand=()=>b.eval(`(()=>{const s=document.getElementById('chat-player-status').textContent; const p=document.getElementById('chat-player-balken'); return {s, balkenSichtbar:getComputedStyle(p).display!=='none'&&p.getBoundingClientRect().width>0, max:p.max, wert:p.value, stopp:!document.getElementById('chat-vorlesen-stopp').disabled};})()`);
const zustand=()=>b.eval(`(()=>{const s=document.getElementById('chat-player-status').textContent; const p=document.getElementById('chat-player-balken'); return {s, balkenSichtbar:getComputedStyle(p).display!=='none'&&p.getBoundingClientRect().width>0, max:p.max, wert:p.value, stopp:!document.getElementById('chat-player-zu').disabled};})()`);
try{
await b.login(BASE,'claude',pw);
await b.goto(BASE+'/ui/modelle?art=sprache'); await warte(800);
@ -30,7 +30,7 @@ try{
// Stopp mittendrin
await b.eval(`document.getElementById('chat-stimme-vorschau').click()`); await warte(3000);
z=await zustand(); ok('Zweiter Lauf läuft (Stopp möglich)', /Vorlesen läuft/.test(z.s) && z.stopp, z.s);
await b.eval(`document.getElementById('chat-vorlesen-stopp').click()`); await warte(600);
await b.eval(`document.getElementById('chat-player-zu').click()`); await warte(600);
z=await zustand(); ok('Stopp: sofort „Keine Wiedergabe“, Balken weg', z.s==='Keine Wiedergabe' && !z.balkenSichtbar && !z.stopp, JSON.stringify(z));
await b.shot('/tmp/player.png');
}catch(e){console.log('Fehler im Lauf:',e.message); process.exitCode=1;} finally{b.close();}