Feature-detected navigator.share opens the OS share sheet with title+text+URL only (no QR files: — narrow support drops the URL when given file+URL). Hidden unless supported; Link másolása stays the universal fallback and catches the non-cancel rejection; AbortError is silent. Template JS + tests only. 2 red-proofs verified red.
4.1 KiB
REPORT — felhom-controller v0.165.1 — Native "Megosztás…" button in the share modal (Web Share API)
Baseline
| Repo | main @ start | version start → target |
|---|---|---|
| felhom-controller | 570fb30 |
v0.165.0 → v0.165.1 |
Clean tree, HEAD == origin/main, verified before build.
What shipped
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.
Files modified
controller/internal/web/templates/launcher.html— the#share-native-btnbutton in the share-link-row (display:nonein markup);nativeShare()in the modal script; anavigator.sharefeature-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.
Behavior
- Supported browser:
#share-native-btnis revealed (navigator.sharetruthy) and callsnavigator.share({title:'Indítópult — <domain>', text:'Az otthoni alkalmazások egy helyen.', url:<ShareURL>})— nofiles: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).
Design ruling (CONTEXT)
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).
Tests + red-proofs
go build ./... && go vet ./... && go test ./... — all green. Gates: template_id, emoji,
native_confirm — OK.
New tests (launcher_share_modal_test.go), both PASS:
| 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:
- Group A: removed
style="display:none"from the button (revealed it in markup) →TestShareModal_NativeShareButtonFAILS the hidden-by-default assertion. Restored → green. - Group B: swapped the
.catchto swallow all errors (dropped thecopyShareLink()fallback) →TestShareModal_NativeShareFallbackFAILS the fallback-presence assertion. Restored → green.
Deployed version + validation (§13)
Filled after build + deploy to guest 9201 — rendered-page assertion transcript below.
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
textis deliberately conjugation-free ("Az otthoni alkalmazások egy helyen.") — a user-to-user message, not magázó UI copy.