Panel rebuilt as the heat matrix: verdict header (ring + newest fault named with its age, cable cell top right), one row per check with NOW / last-90s-at-5s-a-cell / since-reset columns, noise as a blue context lane; history.go keeps the 18-slot wall-time ring (per-class fault deltas, SNR minima, rate verdicts, measuring gray) plus since-reset aggregates and fault ages that clear on reset; noise cycle grid-locked to the shared slot clock so cells never straddle a phase and flicker, presence granted at boot until the first up-phase verdict; check/cross stroked as capsule marks (font has neither), line rate is a pure verdict everywhere, footer is a three-line stat stack beside hold-to-reset; old panel/chip/stat-grid machinery deleted; mockups/ gitignored

This commit is contained in:
flamingcow
2026-08-17 12:22:55 -07:00
parent e3c3f945c5
commit fb4b4596e9
8 changed files with 641 additions and 337 deletions
+22 -33
View File
@@ -2,41 +2,19 @@ package main
import "testing"
func TestGridCellFullRow(t *testing.T) {
x0, w0 := gridCell(0, 2, gridCols, 0, 100)
x1, w1 := gridCell(1, 2, gridCols, 0, 100)
if w0 != w1 {
t.Errorf("cells differ in width: %d vs %d", w0, w1)
}
if x0 != 0 {
t.Errorf("first cell x = %d, want 0", x0)
}
if x1+w1 != 100 {
t.Errorf("row ends at %d, want 100", x1+w1)
}
if got := x1 - (x0 + w0); got != chipGap {
t.Errorf("gap between cells = %d, want %d", got, chipGap)
}
}
// A last row that does not fill the grid is centred.
func TestGridCellShortLastRow(t *testing.T) {
cx, cw := gridCell(2, 3, gridCols, 0, 100)
if left, right := cx, 100-(cx+cw); left != right {
t.Errorf("lone cell has %d left and %d right, want centred", left, right)
}
}
func TestPanelFitsScreen(t *testing.T) {
func testDisplay(t *testing.T) *display {
t.Helper()
d := &display{}
for _, spec := range []struct {
dst **textFace
bold bool
size float64
}{
{&d.big, true, 40},
{&d.grid, false, 34},
{&d.gridB, true, 34},
{&d.huge, true, 40},
{&d.big, true, 36},
{&d.text, false, 22},
{&d.textB, true, 22},
{&d.small, false, 17},
} {
face, err := loadFace(spec.bold, spec.size)
if err != nil {
@@ -44,12 +22,23 @@ func TestPanelFitsScreen(t *testing.T) {
}
*spec.dst = face
}
return d
}
func TestPanelFitsScreen(t *testing.T) {
d := testDisplay(t)
if err := d.layout(600, 1024); err != nil {
t.Fatal(err)
}
gap := d.nowYs[0] - (d.nowPanel.y + uiBorder)
t.Logf("panel gap %dpx, since panel ends at %dpx", gap, d.sincePanel.y+d.sincePanel.h)
if gap < spaceTight {
t.Errorf("panel gap is %dpx, want at least %d", gap, spaceTight)
if d.cellW < 6 {
t.Errorf("heat cells %dpx wide, want at least 6", d.cellW)
}
if end := d.cellsX + d.cellsW; end > d.resetX {
t.Errorf("heat cells run to %d, past the reset column at %d", end, d.resetX)
}
if last := d.rowYs[len(d.rowYs)-1] + rowH; last > d.resetBtn.y {
t.Errorf("rows end at %d, past the footer at %d", last, d.resetBtn.y)
}
t.Logf("cells %dpx wide, rows end at %d, footer at %d",
d.cellW, d.axisY+d.small.lineH, d.resetBtn.y)
}