Dashboard compressa: anteprima accanto allo stato, barre della giornata, icona sua
Alberto ha chiesto una Dashboard compressa, su cui restare a guardare il motore che lavora. Il confronto delle schermate del 25/11 aveva lasciato aperti quattro difetti. - Anteprima: tiene le proporzioni 420 × 236 e si stringe con la pagina (fra 220 e 420 px, il 38% del cruscotto) restando accanto allo stato; i tetti vanno in due per due quando la colonna dello stato è stretta (@container). A 860 × 900 come a 1440 × 900 anteprima, stato, tetti e prima riga della cronologia stanno nel primo schermo; al telefono una colonna sola come prima. - Striscia della giornata: alta 30 px, le sessioni sono barre di quasi tutta l'altezza (margini in percentuale), non più punti; titolo e riassunto senza il vuoto quando vanno a capo. - «Mostra tutta (N)» della coda: margine interno delle righe (la regola di .btn.collegamento lo azzerava). - layout-dashboard.svg ridisegnata in casa: un tachimetro in un riquadro, diversa dai quattro quadrati della Libreria. Schermate 06, 11 e 14 rifatte con tools/Febe.Schermate e differenze.md aggiornato (che cosa ora combacia, che cosa resta diverso). DashboardInterfaceTests controlla a 860 × 900 l'anteprima accanto allo stato, le proporzioni, la prima riga della cronologia nel primo schermo, il margine di «Mostra tutta» e le barre alte; al telefono la colonna sola. Una riga in docs/decisioni.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2e435db396
commit
e937347400
13 files changed
+85
-39
No files matched your search
@@ -7,7 +7,8 @@ namespace Febe.Tests.Web;
|
||||
/// <summary>
|
||||
/// The Dashboard in a real browser, on the demo (spec §7.9, §10.3, tappa D1): the first item of the sidebar with its own
|
||||
/// icon, the preview of the browser always visible at the top, the thumbnails of the history and the enlarged preview
|
||||
/// they open (arrows, Esc, «Apri l'account», «Apri nella Libreria»), and one column below 1000 px. Chromium only (CI).
|
||||
/// they open (arrows, Esc, «Apri l'account», «Apri nella Libreria»), the compressed page at 860 px (preview beside the
|
||||
/// status, history in the first screen) and one column on the phone. Chromium only (CI).
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public sealed class DashboardInterfaceTests
|
||||
@@ -49,16 +50,38 @@ public sealed class DashboardInterfaceTests
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task BelowAThousandPixelsTheDashboardIsOneColumnWithThePreviewOnTop()
|
||||
public async Task AtEightHundredSixtyPixelsThePreviewStaysBesideTheStatusAndTheHistoryStartsInTheFirstScreen()
|
||||
{
|
||||
await using var ui = await UiBrowser.StartAsync(860, 900);
|
||||
using var temp = new TempFolder("dashboard-stretta");
|
||||
await using var demo = await DemoHost.StartAsync(new DemoOptions(0, TestZones.Rome, temp.Path));
|
||||
|
||||
await ui.OpenAsync(new Uri(demo.Address, "/dashboard?scena=sessione&tema=scuro"));
|
||||
await ui.WaitAsync("document.querySelector('main .dashboard .cruscotto .anteprima') !== null && document.querySelector('.storia') !== null", "Dashboard stretta");
|
||||
Assert.IsTrue((await ui.EvalAsync("(() => { const a = document.querySelector('.cruscotto .anteprima').getBoundingClientRect(); const s = document.querySelector('.cruscotto-lato').getBoundingClientRect(); return a.bottom <= s.top + 1; })()")).GetBoolean(), "l'anteprima sopra lo stato e i tetti");
|
||||
await ui.WaitAsync("document.querySelector('main .dashboard .cruscotto .anteprima') !== null && document.querySelector('.storia .storia-righe li') !== null", "Dashboard stretta");
|
||||
// A compressed page (spec §7.9): the preview beside the status and the budgets, with its proportions, not across
|
||||
// the whole width; the first line of the history inside the first screen, without scrolling.
|
||||
Assert.IsTrue((await ui.EvalAsync("(() => { const a = document.querySelector('.cruscotto .anteprima').getBoundingClientRect(); const s = document.querySelector('.cruscotto-lato').getBoundingClientRect(); return a.right <= s.left && a.top < s.bottom; })()")).GetBoolean(), "l'anteprima accanto allo stato e ai tetti " + ui.Report());
|
||||
Assert.IsTrue((await ui.EvalAsync("(() => { const q = document.querySelector('.cruscotto .anteprima .quadro').getBoundingClientRect(); return q.width <= 420 && Math.abs(q.width / q.height - 420 / 236) < 0.05; })()")).GetBoolean(), "l'anteprima tiene le sue proporzioni, al più 420 px");
|
||||
Assert.AreEqual(0, (await ui.EvalAsync("scrollY")).GetDouble(), "la pagina parte dall'alto");
|
||||
Assert.IsTrue((await ui.EvalAsync("document.querySelector('.storia .storia-righe li').getBoundingClientRect().bottom <= innerHeight")).GetBoolean(), "la prima riga della cronologia nel primo schermo " + ui.Report());
|
||||
Assert.IsTrue((await ui.EvalAsync("(() => { const h = document.querySelector('.storia').getBoundingClientRect(); const q = document.querySelector('.coda').getBoundingClientRect(); return h.bottom <= q.top + 1; })()")).GetBoolean(), "cronologia e coda in una colonna");
|
||||
// «Mostra tutta (N)» of the queue keeps the inner margin of the rows.
|
||||
Assert.IsTrue((await ui.EvalAsync("(() => { const b = document.querySelector('.coda .piede-elenco'); return b !== null && parseFloat(getComputedStyle(b).paddingLeft) >= 12 && parseFloat(getComputedStyle(b).paddingBottom) >= 8; })()")).GetBoolean(), "«Mostra tutta» con il margine interno");
|
||||
// The sessions of the strip are bars of nearly the whole height (mockup 06), not dots.
|
||||
Assert.IsTrue((await ui.EvalAsync("(() => { const strip = document.querySelector('.oggi-basso .striscia').getBoundingClientRect(); const bars = [...document.querySelectorAll('.oggi-basso .striscia .sess')]; return bars.length > 0 && bars.every((b) => b.getBoundingClientRect().height >= strip.height * 0.6); })()")).GetBoolean(), "sessioni a barre alte");
|
||||
Assert.IsTrue((await ui.EvalAsync("document.documentElement.scrollWidth <= innerWidth")).GetBoolean(), "nessuno scorrimento orizzontale");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task OnThePhoneTheDashboardIsOneColumnWithThePreviewOnTop()
|
||||
{
|
||||
await using var ui = await UiBrowser.StartAsync(390, 844);
|
||||
using var temp = new TempFolder("dashboard-telefono");
|
||||
await using var demo = await DemoHost.StartAsync(new DemoOptions(0, TestZones.Rome, temp.Path));
|
||||
|
||||
await ui.OpenAsync(new Uri(demo.Address, "/dashboard?scena=sessione"));
|
||||
await ui.WaitAsync("document.querySelector('main .dashboard .cruscotto .anteprima') !== null && document.querySelector('.storia') !== null", "Dashboard al telefono");
|
||||
Assert.IsTrue((await ui.EvalAsync("(() => { const a = document.querySelector('.cruscotto .anteprima').getBoundingClientRect(); const s = document.querySelector('.cruscotto-lato').getBoundingClientRect(); return a.bottom <= s.top + 1; })()")).GetBoolean(), "l'anteprima sopra lo stato e i tetti");
|
||||
Assert.IsTrue((await ui.EvalAsync("document.documentElement.scrollWidth <= innerWidth")).GetBoolean(), "nessuno scorrimento orizzontale");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user