Files
felhom-controller/REPORT.md
T

8.2 KiB
Raw Blame History

REPORT — TASK-D1: Settings split + Tárhely page (unified drive view) → v0.97.0

Date: 2026-07-02 · Deployed: guest 9201 (gitea.dooplex.hu/admin/felhom-controller:0.97.0, healthy)

1. Baseline

felhom-controller main @ 52e97b1 (v0.96.0, TASK-D0 final) — matched the spec exactly; main had NOT moved past 52e97b1 at session start.

2. Old-section → new-page mapping (every h3 accounted for)

Old settings.html section (h3) New page
Rendszer konfiguráció /settings (settings_system.html)
Verzió és frissítés /settings
Vezérlő újraindítása /settings
Kiszolgáló újraindítása /settings
Adattárolók /storage (storage.html)
Hálózati tárhely (NAS) /storage
Meghajtók (ügynök nézet) → merged into Adattárolók + Rendszermeghajtók / Nem regisztrált groups /storage
Értesítések /settings/notifications (settings_notifications.html)
Alkalmazás-email /settings/notifications
Jelszó módosítás /settings/security (settings_security.html)
Földrajzi korlátozás /settings/security
Veszhelyzeti informaciok → Vészhelyzeti információk (typo fixed) /settings/security

The "Meghajtók (ügynök nézet)" standalone section was deliberately dissolved into the unified view (enrichment of the registry cards + the two new groups) — noted here as the one consciously restructured section. TestSettingsSectionInventory asserts all 11 remaining headings survive in the union of the four templates and that the misspelling is gone.

3. Files created / modified / deleted

Created: settings_system.html, settings_notifications.html, settings_security.html (templates); scripts/template_id_gate.py, scripts/emoji_gate.py; internal/web/settings_split_test.go. Renamed: settings.htmlstorage.html (git rename, 51% similarity). Modified: internal/web/server.go (routes), internal/web/handlers.go (builders + rewired handlers), internal/web/templates/layout.html (sidebar), templates/style.css (nav group CSS; deleted .sidebar-settings-link + .badge-lock + .lock-ico), templates/{backups,debug,deploy}.html (emoji), CHANGELOG.md, CONTEXT.md, controller/README.md, REPORT.md.

4. Per-commit hashes (pushed to main)

Commit Content
d50a919 Part 1: routes + per-page data builders + redirect tests
f8e18a9 Part 2: template split + sidebar + integrity gate
cb6f04c Part 3: unified drive view + overlay migration
622d932 Part 3 leftovers: 8 emoji removed + Python emoji gate

5. Tests + red-proofs

go build ./... && go vet ./... && go test ./... green after every commit; final run 18 packages ok. Web-package test functions +8 (TestSettingsSplitPagesRender, TestSettingsSectionInventory, TestWizardRoutesMovedWith301, TestStorageActionRedirectsToStorage, TestPasswordErrorRerendersSecurityPage, TestStorageNoNativeConfirm, TestStorageAgentDownNote, TestNoEmojiInTemplates).

  • Redirect red-proof (Scenario D/E): TestStorageActionRedirectsToStorage + TestWizardRoutesMovedWith301 run against the stashed pre-split handlers failedLocation = "/settings?storage_msg=success&…" (want /storage?…) and the 301s returned empty Location. With the new code: pass.
  • Integrity-gate red-proof (§10): a storage function (getElementById('migrate-progress')) planted in settings_notifications.html made the gate fail with static #migrate-progress not defined in settings_notifications.html; reverted → OK.
  • Section inventory: all 11 old h3 headings present in the union; the misspelled "Veszhelyzeti informaciok" asserted absent.

6. Integrity gate output (per template)

python scripts/template_id_gate.pyOK — every JS element-ID reference resolves within its own template. Justified dynamic-ID exception list (in the script's ALLOW): the layout.html modals that are built entirely in JS then looked up (alert-modal, delete-modal, remove-modal and their inner button/checkbox IDs), and sync-btn/sync-toast which live on stacks.html but are touched by shared layout JS behind an if(!btn)return guard. Template-parameterized IDs (id="field-{{.EnvVar}}"field-SUBDOMAIN, agent-extra-{{.Path}}, migrate-target-{{.Path}}, label-wrap-{{.Path}}, etc.) and JS-created IDs (dialog-go, dialog-type, confirm-go, geo-edit-<app>) are resolved by prefix/JS-string matching, not allowlisted.

7. Emoji gate + badge/confirm greps

  • python scripts/emoji_gate.pybefore: 8 (backups 📁/🔄, debug 🔄/🔒, deploy 📦/★, storage 📦×2); after: 0. Go TestNoEmojiInTemplates keeps it enforced.
  • confirm() grep (Scenario F): zero native confirm(/prompt( in the four split templates (the surviving openConfirm/confirmEject/confirmWipe are the pre-existing type-to-confirm overlay, not native dialogs).
  • badge grep: .badge-lock / .lock-ico deleted after confirming zero template/JS references. Other .badge* classes (NAS health, orphaned, backups tables) remain in use and were NOT deleted (rule §9.8: grep-zero before delete) — restyled flat by the D0 CSS.

8. Deployment + live validation (claude-in-chrome)

gitea.dooplex.hu/admin/felhom-controller:0.97.0 Up 9 seconds (healthy)

Checks performed on https://felhom.demo-felhom.eu (screenshots per page):

  1. All four pages + /storage render, each with its own sections and the correct sidebar active state (Tárhely main-nav item; Beállítások group → Rendszer / Értesítések / Biztonság és hozzáférés). Sidebar shows 0.97.0.
  2. 301 in the browser: GET /settings/storage/init landed on /storage/init (title "Új meghajtó inicializálása").
  3. Unified view (Scenario B): DOM-asserted — 3 registry cards enriched in place (role tag "Felhasználói adat" + durable-id uuid:…, 8 enrichment metarows total); Rendszermeghajtók group visible with 3 read-only rows (local, local-lvm, felhom-pbs) and 0 action buttons; unregistered group hidden; warn note empty (agent reachable). Zero emoji in the rendered body.
  4. Overlay (Scenario F, live): storageDisconnect opened the v2 .confirm-overlay ("Meghajtó leválasztása", verbatim text, Leválasztás/Mégsem) — NOT a native dialog — and Cancel closed it cleanly (#dialog-root empty); the drive was untouched.
  5. End-to-end storage action (Scenario D, live): renamed felhom-usb's label via the real pencil form → redirected to /storage?storage_msg=success&…, the flash "Megnevezés módosítva: Teszt USB D1" rendered on /storage and the card title updated → renamed back to the original "Tárhely (felhom-usb)" (verified).

9. NOT yet live-validated

  • Agent-down degradation (Scenario C): static/unit only — the agent must not be stopped on the live host. The warn-note element + error path are asserted by TestStorageAgentDownNote.
  • Destructive storage ops through the moved UI (eject/wipe/decommission/migrate): the endpoints are unchanged and unit-tested, but exercising the relocated overlay paths on real data awaits a supervised session.

10. Observations (structural, NOT acted on)

  1. Each split page carries its own copy of the ~14-line overlay openDialog helper (system, security, storage) — intentional per spec §2.1 (no shared JS bundle). A future shared static JS asset would DRY this if the no-bundle constraint is lifted.
  2. storage.html is still large (~700 lines) — it absorbed the full drive registry, NAS, migrate, and unified-view JS. Splitting the NAS-add form into a partial is a candidate for a later pass.
  3. .badge* markup persists on secondary pages (backups tables, NAS health, orphaned) — a full tag/metarow migration there is D2 territory.
  4. ~50 inline style="…" attributes remain across the split pages (carried verbatim from the monolith); reducible where a v2 class now covers them.
  5. The unified view enriches only connected user-data registry cards; a disconnected/decommissioned registry card is not agent-joined (it has no live mount) — correct today, but if the agent ever reports a re-appeared device the card won't auto-enrich until reload.