D1, correzioni della revisione: conteggi della Libreria più rapidi, frecce che seguono le tessere, Dashboard nei testi
- /api/library/days in «Tutte le foto» faceva due volte il passaggio su tutta la tabella media a ogni aggiornamento del mosaico: il totale dei file è ora la somma dei giorni (CountLibraryFilesAsync tolto). - I totali e i conteggi per giorno di «Foto» e «Video» su tutta la libreria non pagano più un EXISTS per post (1,3-1,6 s): elenco degli elementi con file di quel tipo su un indice di copertura, 86-141 ms su 200.000 elementi; nuove misure con limite 600 ms in LibraryScaleTests. - La quota di chi aspetta non è un minimo per tipo: corretti commento e decisioni, prova con un arretrato più vecchio di un altro tipo. - Visualizzatore in «Tutte le foto»: le frecce saltano i file che non sono tessere (foto sotto «Video» e simili) e l'intestazione non dà il numero di un altro file; la voce già scelta dell'interruttore non ridisegna il mosaico. Prova d'interfaccia nuova (solo CI). - «Ricetta sospesa» dice di riattivarla dalla Dashboard, non da Attività; commenti aggiornati. - Nomi accessibili distinti nella scheda account, variabile in inglese in download-order.js, icona activity tolta perché nessuna pagina la usa. - Schermate 06, 11 e 14 rifatte con /dashboard e nuova 01-libreria-tutte-le-foto, confrontate con i mockup in docs/schermate/differenze.md (con quattro difetti visivi ancora da sistemare). - LEGGIMI del web (mode, cursore, files, moduli riusabili) e guida della Libreria (la scelta del mosaico resta nel browser, a differenza del tema). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
30e159cbd4
commit
58ff4e48b3
44 files changed
+261
-118
No files matched your search
@@ -200,6 +200,40 @@ public sealed class DownloadOrderTests
|
||||
Assert.IsLessThanOrEqualTo(20, rounds, $"i taggati sono arrivati in {rounds} giri");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TheReservedPlaceGoesToTheOldestFileOfTheQueueNotToEachKindInTurn()
|
||||
{
|
||||
// A new account: 40 posts of the backfill found first, then 5 tagged posts, and 7 new posts every round. The
|
||||
// share is not a minimum per kind: while older posts wait, their kind takes the reserved place too, and the
|
||||
// tagged posts come only once that backlog is done. What holds is that no file waits for ever.
|
||||
var waiting = Enumerable.Range(1, 40).Select(i => Pending(i, EntryKind.Post)).ToList();
|
||||
waiting.AddRange(Enumerable.Range(100, 5).Select(i => Pending(i, EntryKind.Tagged)));
|
||||
var next = 1000L;
|
||||
var taggedByRound = new List<int>();
|
||||
while (waiting.Any(p => p.Kind == EntryKind.Tagged) && taggedByRound.Count < 100)
|
||||
{
|
||||
for (var i = 0; i < 7; i++)
|
||||
{
|
||||
waiting.Add(Pending(next++, EntryKind.Post));
|
||||
}
|
||||
|
||||
var ordered = waiting.OrderBy(p => p.Kind == EntryKind.Post ? 0 : 1).ThenBy(p => p.Media.EntryId).ToList();
|
||||
var longest = waiting.OrderBy(p => p.Media.EntryId).ToList();
|
||||
var batch = DownloadQueue.ComposeBatch(ordered, longest, 8, 8);
|
||||
var oldest = longest.First(p => !batch.Take(7).Contains(p));
|
||||
Assert.AreSame(oldest, batch[7], "il posto riservato va al file che aspetta da più tempo, di qualunque tipo");
|
||||
taggedByRound.Add(batch.Count(p => p.Kind == EntryKind.Tagged));
|
||||
foreach (var done in batch)
|
||||
{
|
||||
waiting.Remove(done);
|
||||
}
|
||||
}
|
||||
|
||||
CollectionAssert.AreEqual(new[] { 0, 0, 0, 0, 0 }, taggedByRound.Take(5).ToArray(), "finché i post più vecchi aspettano, i taggati non hanno un posto loro");
|
||||
Assert.AreEqual(5, taggedByRound.Sum(), "poi arrivano tutti");
|
||||
Assert.HasCount(10, taggedByRound, "uno per giro, nel posto riservato");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task TheOrderWeighsTheVisitsAfterTheSweepWithoutMakingThemFixed()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user