controller v0.45.0: storage UX polish — deterministic order, init filter, register shortcut, system-storage clarity

B1 sort /api/disks (user-data→system→backup, alpha within); B2 init wizard
excludes mounted drives; B3 Regisztrálás primary action for mounted-unregistered
user-data drives (POST /api/storage/register); B4 per-card purpose descriptions +
app-backing tags + tiering note (local & local-lvm both kept); B5 eject already
names affected apps. Pairs with felhom-agent v0.24.0 eject role-gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-12 09:35:31 +02:00
parent 12064dcd88
commit 9ed844fd0b
8 changed files with 186 additions and 10 deletions
@@ -237,6 +237,34 @@ func TestAppsUsingPathIn(t *testing.T) {
}
}
// B1: the disk overview must render in a deterministic order — user-data first, then system, then
// backup (then anything unrecognized), alphabetical by name within each tier — so the list does not
// reorder on each reload (the agent's storage view iterates an unordered Go map).
func TestSortDisksForView(t *testing.T) {
disks := []agentapi.DiskInfo{
{Name: "felhom-pbs", Role: "backup"},
{Name: "local-lvm", Role: "system"},
{Name: "zdata", Role: "user-data"},
{Name: "local", Role: "system"},
{Name: "adata", Role: "user-data"},
{Name: "mystery", Role: ""},
}
sortDisksForView(disks)
var got []string
for _, d := range disks {
got = append(got, d.Name)
}
want := []string{"adata", "zdata", "local", "local-lvm", "felhom-pbs", "mystery"}
if len(got) != len(want) {
t.Fatalf("length mismatch: got %v want %v", got, want)
}
for i := range want {
if got[i] != want[i] {
t.Fatalf("order at %d: got %q want %q (full: %v)", i, got[i], want[i], got)
}
}
}
func TestMountWhere(t *testing.T) {
if w, err := mountWhere("hdd_1"); err != nil || w != "/mnt/hdd_1" {
t.Errorf("mountWhere(hdd_1) = %q, %v", w, err)