diff --git a/REPORT.md b/REPORT.md index 99aaf09..2d8efb8 100644 --- a/REPORT.md +++ b/REPORT.md @@ -1,91 +1,93 @@ -# REPORT — felhom-controller v0.165.1 — Native "Megosztás…" button in the share modal (Web Share API) +# REPORT — v0.166.0: mobile nav drawer + sidebar cleanup + versioned logo/favicon URLs -## Baseline +**Date:** 2026-07-24 · **Deployed & verified live on guest 9201.** -| Repo | main @ start | version start → target | -|------|--------------|------------------------| -| felhom-controller | `570fb30` | v0.165.0 → **v0.165.1** | +## 1. Confirmed baselines used +| Repo | `main` @ hash (start) | Version | → | +|------|------------------------|---------|---| +| felhom-controller | `1fd070615db91658df85438f760cb5ed61832d7e` | v0.165.1 | v0.166.0 | +| felhom.eu (asset source, read-only) | live `main` = `be9edb443cab1d2581fa022537e7113f45c3fd92` | — | — (unchanged by this task) | -Clean tree, `HEAD == origin/main`, verified before build. +felhom.eu asset commit **consumed: NONE** — the outlined asset was never pushed (see §2 below). -## What shipped +## 2. §3a precondition gate — Part 4 GATED OUT +Fetched `felhom.eu:website/assets/logo.svg` from live Gitea `main` (`be9edb44`, confirmed via +`git ls-remote`): **2 `` cleanup) was NOT performed.** No CLI +text-to-path conversion was attempted (glyph fidelity is Viktor's Inkscape responsibility). Parts 1–3 +shipped independently as specified. When Viktor pushes the outlined asset, Part 4 ships as a follow-up +(swap `FelhomLogoSVG`, clean `FelhomFaviconSVG`, add the `TestLogoSVG_NoLiveText` constant test). -The v0.165.0 "Indítópult megosztása" modal gains a feature-detected **"Megosztás…"** button that -opens the OS share sheet via `navigator.share`, sending the share **title + text + URL only**. Template -JS + tests only — no backend, no routes, no settings, no dependency changes. +## 3. Files modified +- `controller/internal/web/templates/layout.html` — `no-js` html class + early swap script; sticky + `.mobile-topbar` (logo→`/`, `.nav-burger` w/ aria); `.nav-backdrop` (hidden); `id="sidebar"`; + drawer JS (burger/backdrop/Escape); removed `.customer-name` span; `?v=` on favicon + sidebar logo. +- `controller/internal/web/templates/style.css` — deleted the `.nav-links` strip from the 768px block; + added desktop-default hidden `.mobile-topbar`/`.nav-backdrop`/`.nav-burger`; mobile drawer + no-JS + fallback + `body.nav-open`; reduced-motion rule; removed dead `.customer-name` rule. +- `controller/internal/web/templates/login.html` — `?v={{.Version}}` on the login logo ``. +- `controller/internal/web/templates/icons.html` — new `#i-menu` (lucide "menu", matching stroke). +- `controller/internal/web/auth.go` — `renderLogin` now passes `"Version"` (for the login logo `?v=`). +- `controller/internal/web/mobile_nav_test.go` — **new**, 5 tests. +- `CHANGELOG.md`, `CONTEXT.md` — updated; `REPORT.md` — this file. -## Files modified +## 4. Commits pushed to `main` +- `bf44216` — v0.166.0 implementation (code + tests + CHANGELOG + CONTEXT). +- REPORT commit — this REPORT.md (follow-up commit, matching the established pattern). -- `controller/internal/web/templates/launcher.html` — the `#share-native-btn` button in the - share-link-row (`display:none` in markup); `nativeShare()` in the modal script; a `navigator.share` - feature-detect reveal in the existing IIFE. -- `controller/internal/web/launcher_share_modal_test.go` — **new**: Group A + Group B render tests. -- Docs: `CHANGELOG.md`, `controller/README.md`, `CONTEXT.md`. +## 5. Tests + RED proofs +**Test count:** web package `--- PASS` count 278 → **283** (5 new). Full repo: 25 packages pass, 0 fail. -## Behavior +Phase-1 RED runs (recorded against pre-change source): +| Test | RED (pre-change) | GREEN (post-change) | +|------|------------------|---------------------| +| `TestMobileCSS_StripRemovedDrawerPresent` (Group B) | FAIL — 768px block still had `overflow-x` + `.nav-links{}`; no `.js .sidebar`/`translateX`/`.no-js .sidebar`/`body.nav-open`/`.mobile-topbar` | PASS | +| `TestMobileNav_TopbarAndDrawerMarkup` (Group A) | FAIL — no `no-js`, no topbar/burger/backdrop, no `aria-controls`/`id=sidebar` | PASS | +| `TestSidebar_NoCustomerName` (Group D) | FAIL — `customer-name` still rendered | PASS | +| `TestLayout_VersionedAssetURLs` (Group E) | FAIL — logo/favicon URLs lacked `?v=` | PASS | +| `TestLogoSVG_NoLiveText` (Group E, Part-4 gated) | FAIL — `FelhomLogoSVG`/`FelhomFaviconSVG` contain `', text:'Az otthoni alkalmazások egy helyen.', - url:})` — **no `files:` key**. User cancel (`AbortError`) → silent; the modal stays open. -- **Unsupported browser** (Firefox desktop, Chrome/Linux): the button stays `display:none` (JS only - ever reveals it); "Link másolása" works exactly as in v0.165.0. -- **Non-cancel rejection:** falls back to `copyShareLink()` so the user still keeps the link on the - clipboard (with the existing "Másolva" feedback). +Companion red-proofs (documented mutations that flip a committed test to FAIL): +- Re-add `` → `TestSidebar_NoCustomerName` FAILS. +- Drop `aria-controls` from the burger → `TestMobileNav_TopbarAndDrawerMarkup` FAILS. +- Restore the `.nav-links{display:flex;overflow-x}` strip → `TestMobileCSS_StripRemovedDrawerPresent` FAILS. +- Remove `?v=` from the logo/favicon refs → `TestLayout_VersionedAssetURLs` FAILS. -## Design ruling (CONTEXT) +`nav_accordion_test.go` invariants pass **unchanged** (not edited). Green gate +`go build ./... && go vet ./... && go test ./...` — all clean. Mechanical gates +(`template_id_gate`, `emoji_gate`, `mojibake_gate`, `native_confirm_gate`) all OK. -The **QR is NOT attached** to the share payload (no Web Share Level-2 `files:`). File-share support is -narrow and several targets drop the URL when handed file+URL, leaving an unscannable QR picture in a -chat. The QR's job — physical cross-device scanning — is already served by the modal image (mobile -long-press covers "send the picture" with zero code). +## 6. Deploy + live endpoint validation (guest 9201) +- Built `gitea.dooplex.hu/admin/felhom-controller:0.166.0` (145M) from the clean pushed tree + (`git status` empty, HEAD == origin/main), pushed, deployed via the bootstrap service. +- `docker ps`: `gitea.dooplex.hu/admin/felhom-controller:0.166.0 Up (healthy)`; logs show + `Event pushed: controller_started (info) — Controller elindult (0.166.0)`, settle-gate GO. +- Method: endpoint-level (`curl` in-guest to the container IP `172.17.0.2:8080` with + `Host: felhom.demo-felhom.eu`; login 302 with the stored password → authed session cookie). -## Tests + red-proofs +| Surface | Assertion | Result | +|---------|-----------|--------| +| `/static/style.css?v=0.166.0` | `.mobile-topbar`, `.js .sidebar`, `translateX(-100%)`, `.no-js .sidebar`, `body.nav-open` present; the 3 residual `overflow-x` are non-nav (tables/code) | ✅ | +| `/login` (no auth) | `felhom-logo.svg?v=` + `login-subtitle` (CustomerName kept) | ✅ | +| `/` (authed) | topbar / `nav-burger` / `aria-controls="sidebar"` / `id="sidebar"` / `nav-backdrop hidden` / `no-js`+swap script / `logo.svg?v=` (×2) / `favicon.svg?v=` present; **`customer-name` absent (0)** | ✅ | +| `/storage` (authed) | both accordion sub-items render (`Meghajtók` + `Hálózati tárhely`), `nav-group-storage` present, `customer-name` absent | ✅ | +| `/static/felhom-logo.svg` | still contains 4 `768px pixel-parity** vs v0.165.1 (no burger, fixed 240px sidebar, hover/active states). +- **Conscious omission:** the drawer has no full focus-trap — `aria-expanded`/`aria-controls` only. + Page navigations reset drawer state, so a trap would add complexity for a state that never persists. -New tests (`launcher_share_modal_test.go`), both PASS: +## 8. Logo viewBox +Part 4 gated out → `FelhomLogoSVG`/`FelhomFaviconSVG` **unchanged**; no viewBox delta to record. The +outlined swap must preserve the current logo `viewBox` (record old-vs-new when Part 4 ships). -| Group | Scenario | Test | -|---|---|---| -| A | button hidden-by-default + feature-detect reveal + title/text/url-only payload (no `files:`) + copy retained | `TestShareModal_NativeShareButton` | -| B | AbortError-silent branch + non-abort fallback to `copyShareLink()` | `TestShareModal_NativeShareFallback` | - -Companion **red-proofs** (mutate → FAIL → restore → green), both verified: -1. **Group A:** removed `style="display:none"` from the button (revealed it in markup) → - `TestShareModal_NativeShareButton` FAILS the hidden-by-default assertion. Restored → green. -2. **Group B:** swapped the `.catch` to swallow all errors (dropped the `copyShareLink()` fallback) → - `TestShareModal_NativeShareFallback` FAILS the fallback-presence assertion. Restored → green. - -## Deployed version + validation (§13) - -Built `0.165.1` on DooPlex, pushed, deployed to guest 9201. `docker ps`: -`gitea.dooplex.hu/admin/felhom-controller:0.165.1 Up (healthy)`. - -**Rendered-page assertion** (authed `GET /launcher`, sharing enabled, via -`docker exec … curl http://localhost:8080` — the endpoint-level method; the OS sheet itself is not -endpoint-testable): - -- `id="share-native-btn" class="btn btn-outline" style="display:none"` present (hidden-by-default): **1** -- feature-detect `if(navigator.share)` present: **1** -- payload `title:'Indítópult …`: **1** · `url:inp.value`: **1** · text "Az otthoni alkalmazások egy helyen": **1** -- `files:` in the page: **0** (QR deliberately not attached) -- "Link másolása" (universal fallback) present: **1** - -Cleanup: `POST /launcher/share/disable` → `launcher_share_token` count in `settings.json` = **0** -(box left in the shipped default). Post-run `docker ps`: `Up (healthy)`. - -## Pending human check (stated, not claimed) - -The **OS share sheet interaction is an OS-level dialog** that endpoint checks and browser automation -cannot exercise. CC validates markup + JS presence at the rendered `/launcher` (authed curl, Group-A -strings). The single pending manual check is the operator's: desktop Chrome/Edge or a phone → the -"Megosztás…" button is visible → the sheet opens → a WhatsApp/email target receives the title + a -tappable link; on Firefox desktop the button is absent and "Link másolása" still works. - -## Observations - -- No Web Share Level-2 `files:` — ruled out above (narrow support; URL-drop when given file+URL). -- "Link másolása" is unchanged and remains the universal path; feature detection only, no UA sniffing. -- The share `text` is deliberately conjugation-free ("Az otthoni alkalmazások egy helyen.") — a - user-to-user message, not magázó UI copy. +## 9. Observations (out of scope — documented only, not acted on) +- The **website and hub still serve their own non-outlined logo copies** (`felhom.eu/website/assets/logo.svg` + consumers, the hub's `felhom-logo.svg`, `logo_favicon*.svg`) — once Viktor's outlined master lands, + propagating it there is a separate follow-up. +- `login.html`'s **stylesheet** link is still unversioned (`/static/style.css`, no `?v=`) — the task + scoped only the login *logo* ``; the login page's CSS cache-bust is a minor follow-up.