v0.319.0: the app page in panels, the login in one place, a password the box never had is said in words
gates / gates (push) Successful in 52s
gates / gates (push) Successful in 52s
- style A (operator 2026-10-16): hero, tab bar and every section are panels on --bg-1, one width, 16px apart; the install page's form groups use the same rule; the settings tab's 700px inner wrapper is gone - „Belépés az alkalmazásba": name + password side by side, fetched on demand (R-254, R-709); pairing in app_login.go - the empty-value rule: no stored value -> a sentence, never an eye; page and reveal endpoint share storedValuePresent - „Cím és kulcsok" is rows (no Domain input, no disabled storage select, no install form); hint under the title - tests red-proved: app_page_tuning_test.go (4); 36 app-page parity fixtures re-captured, 4 new; install fixtures unchanged Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
This commit is contained in:
@@ -173,22 +173,11 @@ deploy_fields:
|
||||
return s
|
||||
}
|
||||
|
||||
// optionTag returns the full <option ...>...</option> block whose value attribute equals path.
|
||||
func optionTag(t *testing.T, body, path string) string {
|
||||
t.Helper()
|
||||
marker := `value="` + path + `"`
|
||||
i := strings.Index(body, marker)
|
||||
if i < 0 {
|
||||
t.Fatalf("no option with value %q in rendered page", path)
|
||||
}
|
||||
start := strings.LastIndex(body[:i], "<option")
|
||||
end := strings.Index(body[i:], ">")
|
||||
return body[start : i+end]
|
||||
}
|
||||
|
||||
// Deployed on the NAS → the NAS option carries `selected`; the default drive does NOT.
|
||||
// Companion red-proof: revert deploy.html to the IsDefault-only selection → the default option is
|
||||
// selected instead → both assertions FAIL (the exact S-C lie from the RCA).
|
||||
// Deployed on the NAS → the „Tarhely" row names the NAS, never the default drive.
|
||||
// v0.319.0: the settings tab shows the storage as a row, not a disabled select — the RCA fix 4 rule is
|
||||
// unchanged: the view states the STORED HDD_PATH.
|
||||
// Companion red-proof: make the row read the default drive's label → the first assertion FAILS (the exact
|
||||
// S-C lie from the RCA).
|
||||
func TestDeployPage_DeployedSelectShowsStoredHDDPath(t *testing.T) {
|
||||
s := testDeployPageServer(t, "/mnt/felhom-drives/nas-media")
|
||||
// v0.315.0: an installed app's fields are the app page's settings TAB. The old /stacks/…/deploy
|
||||
@@ -197,28 +186,34 @@ func TestDeployPage_DeployedSelectShowsStoredHDDPath(t *testing.T) {
|
||||
if rec.Code != 200 {
|
||||
t.Fatalf("GET settings tab = %d: %s", rec.Code, rec.Body.String())
|
||||
}
|
||||
body := rec.Body.String()
|
||||
if nas := optionTag(t, body, "/mnt/felhom-drives/nas-media"); !strings.Contains(nas, "selected") {
|
||||
t.Errorf("the STORED path's option must be selected, got: %s", nas)
|
||||
row := storageRow(t, rec.Body.String())
|
||||
if !strings.Contains(row, "nas-media") {
|
||||
t.Errorf("the storage row must name the STORED path's drive, got: %s", row)
|
||||
}
|
||||
if usb := optionTag(t, body, "/mnt/felhom-drives/felhom-usb"); strings.Contains(usb, "selected") {
|
||||
t.Errorf("the default drive must NOT be selected for a deployed app, got: %s", usb)
|
||||
if strings.Contains(row, "felhom-usb") {
|
||||
t.Errorf("the storage row must NOT name the default drive for a deployed app, got: %s", row)
|
||||
}
|
||||
}
|
||||
|
||||
// Stored path absent from the schedulable list → an extra disabled option names it verbatim (the
|
||||
// view must never silently show a different storage than app.yaml).
|
||||
// storageRow returns the settings tab's „Tarhely" value cell.
|
||||
func storageRow(t *testing.T, body string) string {
|
||||
t.Helper()
|
||||
i := strings.Index(body, `data-app-storage-row="1"`)
|
||||
if i < 0 {
|
||||
t.Fatalf("no storage row in the rendered settings tab")
|
||||
}
|
||||
return body[i : i+strings.Index(body[i:], "</div>")]
|
||||
}
|
||||
|
||||
// Stored path absent from the schedulable list → the row names it verbatim as not available (the view
|
||||
// must never silently show a different storage than app.yaml).
|
||||
func TestDeployPage_MissingStoredPathRendersTruthOption(t *testing.T) {
|
||||
s := testDeployPageServer(t, "/mnt/felhom-drives/gone")
|
||||
rec := getPage(t, s, "/apps/testapp/settings")
|
||||
if rec.Code != 200 {
|
||||
t.Fatalf("GET settings tab = %d: %s", rec.Code, rec.Body.String())
|
||||
}
|
||||
body := rec.Body.String()
|
||||
if !strings.Contains(body, "/mnt/felhom-drives/gone (nem elérhető)") {
|
||||
t.Errorf("missing stored path must render as a disabled truth option")
|
||||
}
|
||||
if gone := optionTag(t, body, "/mnt/felhom-drives/gone"); !strings.Contains(gone, "selected") || !strings.Contains(gone, "disabled") {
|
||||
t.Errorf("the truth option must be selected+disabled, got: %s", gone)
|
||||
if row := storageRow(t, rec.Body.String()); !strings.Contains(row, "/mnt/felhom-drives/gone (nem elérhető)") {
|
||||
t.Errorf("a missing stored path must render as its own path, not available; got: %s", row)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user