D1, terza parte: Dashboard come pagina iniziale ovunque, miniature anche del Giro
Richiesta di Alberto (#59, parte b): la Dashboard al posto di Attività, prima voce e
pagina iniziale, compatta, con l'anteprima del browser sempre visibile e le miniature di
ciò che è arrivato. La prima parte (d6c0ef8) aveva già pagina, rotte e anteprima; qui si
chiude ciò che mancava.
- La finestra di Febe per Windows apre /dashboard?gettone=… (non più /): tolto il
gettone l'indirizzo resta /dashboard.
- La voce Dashboard ha un'icona sua, layout-dashboard, disegnata in casa.
- Cronologia: anche le righe del Giro dei seguiti, che non hanno un account, mostrano le
miniature di ciò che è arrivato di tutti gli account; mai gli elementi importati. Indice
ix_entry_discovered nella migrazione 0002 (non ancora unita), così la domanda legge
solo le righe dei minuti della ricetta anche con 200.000 elementi.
- Anteprima ingrandita: le frecce funzionano anche con il fuoco sui pulsanti del piede,
«Apri l'account» segue l'elemento mostrato, chiudendo non si disegna più nulla.
- Al telefono il cruscotto è più basso (anteprima 196 px, miniature 40 px).
- Guida: «Attività e arresti» diventa «Dashboard e arresti», collegamenti e testi delle
altre pagine aggiornati; differenze dai mockup in docs/schermate/differenze.md; quattro
righe in docs/decisioni.md.
- Prove: DashboardApiTests (riga del Giro, importati esclusi, domande sbagliate),
DesktopCompositionTests (/dashboard), GuideTests; DashboardInterfaceTests con Chromium
(miniature, anteprima, frecce, Esc, una colonna sotto i 1000 px), solo nella CI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0547c747c5
commit
34fe5e9073
31 files changed
+265
-78
No files matched your search
@@ -1,6 +1,6 @@
|
||||
-- Febe, schema version 2: «Cosa scaricare prima» (tappa D1, issue #59; spec §7.2, §4.4, §8.3).
|
||||
-- Run by the migration runner inside a transaction; PRAGMA user_version is set by the runner.
|
||||
-- Only columns are added: no behaviour changes for the data already stored.
|
||||
-- Only columns and an index are added: no behaviour changes for the data already stored.
|
||||
|
||||
-- The order of «Cosa scaricare prima» of the account: the Italian names of the five kinds, comma separated
|
||||
-- («storie,evidenza,post,reel,taggati»). NULL: «Come le impostazioni generali» (setting scaricamento.ordine).
|
||||
@@ -9,3 +9,7 @@ ALTER TABLE account ADD COLUMN download_order TEXT;
|
||||
-- A post that Febe knows to be a reel (found in the Reel tab, or marked so in the response): it counts as a reel in
|
||||
-- the queue of the files. 0 for every post stored before, which Febe cannot tell apart without asking the site again.
|
||||
ALTER TABLE entry ADD COLUMN is_reel INTEGER NOT NULL DEFAULT 0 CHECK (is_reel IN (0, 1));
|
||||
|
||||
-- What a recipe saved, for the thumbnails of the history of the Dashboard (spec §7.9): the entries discovered in the
|
||||
-- few minutes of the recipe, of one account or of all (the Giro dei seguiti), read by range whatever the library's size.
|
||||
CREATE INDEX ix_entry_discovered ON entry (discovered_at);
|
||||
@@ -201,15 +201,22 @@ internal sealed class EntryStore(FebeDatabase db) : IEntryStore
|
||||
ct);
|
||||
}
|
||||
|
||||
public Task<ArrivedEntries> ListDiscoveredAsync(long accountId, DateTimeOffset from, DateTimeOffset to, int limit, CancellationToken ct = default) =>
|
||||
// The window of a recipe is a few minutes: the range on ix_entry_discovered (migration 0002) reads only those rows,
|
||||
// whatever the size of the library or of the account.
|
||||
private const string ArrivedWhere = """
|
||||
discovered_at >= @f AND discovered_at <= @t AND (@a IS NULL OR account_id = @a) AND provenance = @p AND state <> 'Deleted'
|
||||
""";
|
||||
|
||||
public Task<ArrivedEntries> ListDiscoveredAsync(long? accountId, DateTimeOffset from, DateTimeOffset to, int limit, CancellationToken ct = default) =>
|
||||
db.ReadAsync(
|
||||
c =>
|
||||
{
|
||||
var ids = new List<long>();
|
||||
using (var r = c.Command("""
|
||||
SELECT id FROM entry WHERE account_id = @a AND discovered_at >= @f AND discovered_at <= @t AND state <> 'Deleted'
|
||||
using (var r = c.Command($"""
|
||||
SELECT id FROM entry WHERE {ArrivedWhere}
|
||||
ORDER BY discovered_at DESC, id DESC LIMIT @l
|
||||
""").With("@a", accountId).With("@f", Sql.Time(from)).With("@t", Sql.Time(to)).With("@l", (long)Math.Clamp(limit, 1, 100)).ExecuteReader())
|
||||
""").With("@a", accountId).With("@f", Sql.Time(from)).With("@t", Sql.Time(to)).With("@p", Sql.Enum(Provenance.Downloaded))
|
||||
.With("@l", (long)Math.Clamp(limit, 1, 100)).ExecuteReader())
|
||||
{
|
||||
while (r.Read())
|
||||
{
|
||||
@@ -217,9 +224,9 @@ internal sealed class EntryStore(FebeDatabase db) : IEntryStore
|
||||
}
|
||||
}
|
||||
|
||||
var total = (int)c.Command("""
|
||||
SELECT COUNT(*) FROM entry WHERE account_id = @a AND discovered_at >= @f AND discovered_at <= @t AND state <> 'Deleted'
|
||||
""").With("@a", accountId).With("@f", Sql.Time(from)).With("@t", Sql.Time(to)).ScalarInt64();
|
||||
var total = (int)c.Command($"""
|
||||
SELECT COUNT(*) FROM entry WHERE {ArrivedWhere}
|
||||
""").With("@a", accountId).With("@f", Sql.Time(from)).With("@t", Sql.Time(to)).With("@p", Sql.Enum(Provenance.Downloaded)).ScalarInt64();
|
||||
return new ArrivedEntries(ids, total);
|
||||
},
|
||||
ct);
|
||||
|
||||
Reference in new issue
Block a user