Sette schermate nuove (27-31) dalla dimostrazione, sette rifatte perché la Libreria ha «Video fermi» e il visualizzatore «È un video fermo?», e il confronto con i mockup in differenze.md (§10.7). Corretti i difetti visti guardando le pagine: lo spazio sotto l'anteprima di «Salva il fotogramma», le azioni del visualizzatore e gli strumenti della Libreria al telefono, i menu dei filtri a capo non allineati, le righe di «Ultimi lavori» fuori dal riquadro al telefono. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
1.5 KiB
JavaScript
19 lines
1.5 KiB
JavaScript
// «Cerca i video fermi» at work in Dashboard → Esportazione (spec §4.10, §10.3, tappa E4; composed from mockup 06 and the
|
|
// second step of the import, mockup 09): the search of every video of the library, started from another page (as the
|
|
// selection does), then the Dashboard as it is after the first videos. From then on the page reads no more of the
|
|
// progress, so the picture does not change while it is taken; the search itself goes on and ends in a few seconds. The
|
|
// only step that starts something: its screenshot comes last.
|
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
const until = async (test, tries = 1000) => { for (let i = 0; i < tries && !test(); i++) await sleep(25); return test(); };
|
|
await until(() => document.querySelector('.mosaico .tess[data-id]'));
|
|
const plain = window.fetch;
|
|
await plain('/api/still-videos/start', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ query: 'kind=videos' }) });
|
|
const { navigate } = await import('/js/core/shell.js');
|
|
await navigate('/dashboard/esportazione');
|
|
const bar = () => document.querySelector('.avanzamento-fermi');
|
|
await until(() => Number(bar()?.querySelector('[role=progressbar]')?.getAttribute('aria-valuenow')) > 0);
|
|
window.fetch = (url, options) => (String(url?.url || url).includes('/api/still-videos/progress') ? new Promise(() => {}) : plain(url, options));
|
|
await sleep(300);
|
|
document.activeElement?.blur();
|
|
return bar()?.querySelector('.conteggio')?.textContent;
|