Libreria: nessuno stato vuoto finché non si sa se Febe è collegato
Con la libreria vuota e lo stato del motore ancora sconosciuto, lo stato vuoto sceglieva «La libreria è ancora vuota». Al primo avvio, con /api/engine più lento di /api/library/days, quel testo era falso e poi lasciava il posto al benvenuto con un salto della pagina (rilievo R2 della revisione). Ora, senza filtri e senza lo stato del motore, la Libreria resta bianca come il mosaico mentre carica: un riquadro vuoto con aria-busy, che il primo stato del motore sostituisce con il benvenuto o con «La libreria è ancora vuota». La barra laterale dice già «Caricamento…» in quell'attesa, e il motore arriva comunque: il flusso lo manda appena si apre e, senza flusso, l'interfaccia lo richiede a intervalli. Benvenuto e libreria vuota non cambiano. La prova TheEmptyLibraryFollowsTheConnectionAlsoWhenTheEngineAnswersLate, con il motore trattenuto, ora aspetta quel riquadro e controlla che il conteggio dica 0 e che non ci siano né stato vuoto né mosaico; sul codice di prima fallisce («timeout: libreria vuota in attesa del motore»). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3719adc2d9
commit
0a6dd19595
3 files changed
+15
-8
No files matched your search
@@ -324,14 +324,17 @@ export default {
|
||||
}
|
||||
|
||||
// The empty state: no results of a filter, the first start (spec §10.3: not connected, the two ways to begin) or an
|
||||
// empty library. Whether Febe is connected comes with the engine, which may answer after the library: the empty
|
||||
// state follows it while it is on screen, and is drawn again only when it changes kind.
|
||||
// empty library. Whether Febe is connected comes with the engine, which may answer after the library: until then
|
||||
// the page stays blank, as the mosaic does while it loads, rather than guess. The empty state follows the engine
|
||||
// while it is on screen, and is drawn again only when it changes kind.
|
||||
let empty = null;
|
||||
function drawEmpty() {
|
||||
const kind = filtersActive() ? 'filtro' : notConnected() ? 'benvenuto' : 'vuota';
|
||||
const kind = filtersActive() ? 'filtro' : !engineState() ? 'attesa' : notConnected() ? 'benvenuto' : 'vuota';
|
||||
if (empty && empty.kind === kind && empty.node.isConnected) return;
|
||||
let node;
|
||||
if (kind === 'filtro') {
|
||||
if (kind === 'attesa') {
|
||||
node = h('div', { 'aria-busy': 'true' });
|
||||
} else if (kind === 'filtro') {
|
||||
node = h('div.vuoto-pagina', icon('list-filter'), h('h2', t('libreria.nessuno')), h('p', t('libreria.nessunoTesto')),
|
||||
h('button.btn', { type: 'button', onclick: () => { Object.assign(state, readState(new URLSearchParams())); search.value = ''; apply(); } }, t('libreria.togliFiltri')));
|
||||
} else if (kind === 'benvenuto') {
|
||||
|
||||
Reference in new issue
Block a user