feat(admin): settings-row pattern, switches, segmented tabs, save bar #327
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/admin-srows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Admin redesign, slice B of four.
The problem
The twelve topics are the old Settings dialog's fields relocated into page slots by
SET_SLOTS, so they inherited dialog habits: uppercase.fieldlabels with.06emtracking, label-above-input stacking, bare checkboxes, and a right-aligned Save that is always present.Approach — presentation only, no relocation rewrite
I kept
SET_SLOTSand every field id, value binding and save handler exactly as they are. Two things happen after the existing move: each field gains a description, and each run of fields gets wrapped in a.setbox. Everything else is CSS scoped to#adminview, so the settings dialog and every other.field/.dlgactionson the page are untouched. That was the smaller and far less fragile of the two options..checkrow puts the<input>before its<label>in source, so auto-placement would seat the description in the wrong column.appearance:noneon the existing checkbox, styled as a 38×22 switch with a::afterknob. No markup or JS change, so every existing binding keeps working; honoursprefers-reduced-motion..dlgactionscontaining anadm-save-*button becomes sticky, tinted, and hidden until something changed — with a live count ("1 unsaved change" / "N unsaved changes") and a Discard that restores the snapshot. Selected with:has()so the Updates topic's non-save.dlgactions(the "Check for updates" button) is unaffected.admSnapshot()captures the baseline right afterloadSettingsValues()— i.e. whatever the server just returned — and re-captures after a successful save by wrapping the existingonclickrather than replacing it.New i18n keys (en/de/fr/it): admDiscard, admOneChange, admNChanges.
Verification
node --checkon all script blocks; four anchored splices at count=1; asserted the wiring function, snapshot calls and.setboxreferences are present. Operator check: Administration → Sharing / Storage → Limits / Basic settings — toggle something, confirm the bar appears with the right count, Discard reverts, Save persists and clears the bar.Deliberately deferred (added to the running list on #311)
.sdescmap covers the settings I could name with confidence; fields not in it simply render without a description rather than getting invented copy.