Skip to content

Add an install suggestion dialog and optional listing-opened and install-prompt counts - #14

Merged
truegoodcraft merged 5 commits into
mainfrom
claude/project-thread-964tgz
Oct 8, 2026
Merged

truegoodcraft merged 5 commits into
mainfrom
claude/project-thread-964tgz

Conversation

@truegoodcraft

Copy link
Copy Markdown
Member

Before: the only install path was the small "Install Food Help" button on inner pages, and the analytics adapter knew six event kinds.

After: the home directory shows a centered "Keep this directory on your device" suggestion 3 seconds after load, once per visit, only where the browser can install (native prompt) or on Apple touch browsers (Add to Home Screen instructions). "Not now", Esc or the backdrop dismisses it for 14 days on that device. It is hidden in print, never shown on review previews or when already installed, and needs no inline script or style.

The analytics adapter also gains three optional kinds (resource_open, install_prompt_show, install_prompt_dismiss) and an optional visit_linkage flag. None of them is sent unless a deployment configures payloads or turns the flag on. No deployment does: Kingston's config is unchanged and still sends exactly the six established v3 events, and Brockville has analytics disabled.

How: new dialog markup in scripts/lib/web.ts, behaviour in src/main.ts, schema and validation for the new optional keys, docs in docs/analytics.md and docs/configuration.md. Re-rendering after a search or filter restores open listings without counting them as new openings. No listing data, deployment config or service worker changes.

Checks: npm run check -- --all passes (80 unit/contract tests, 32 Chromium browser tests).


Generated by Claude Code

Kimi (Food Help project) and others added 5 commits October 8, 2026 15:07
… suggestion dialog

Extends the fixed event contract from six to nine broad kinds:
resource_open (listing detail opened, attributable), install_prompt_show
and install_prompt_dismiss (never attributed, like install). Adds a
center-screen install suggestion on the home directory: shown once per
visit after 3s when installable, native prompt where the browser offers
one, Add to Home Screen guidance on Apple touch browsers, 14-day local
dismissal courtesy period, Esc/backdrop/button dismissal, no inline
script or style so CSP hashes are unchanged in shape. Kingston disclosure
updated to name the new counts. Checks: npm run check -- --all PASS.
Funnel events (all except install and install-prompt signals) now carry
a visit field: a random token generated at page load, never stored,
rotated on any revocation or suppression. Installation and prompt
signals never carry it so they stay unlinkable to outreach labels.
Static constants and event payloads cannot override it. Kingston
disclosure and the generic analytics explanation updated. Targeted
unit and browser analytics tests pass.
The current collector contract (KFH_ANALYTICS_CONTRACT.md, ingestion v3)
accepts exactly six event types with strict keys and forbids unknown
keys and visitor/session IDs. Sending the new kinds or the visit field
would drop events server-side. Rework so the wire format stays exact v3:

- Kingston event_payloads and attribution restored to the six reviewed
  events; disclosure restored to match what is actually collected.
- resource_open and install-prompt kinds become optional capabilities,
  sent only where a deployment configures payloads under a collector
  contract that accepts them (validation now requires the six
  established payloads; the three new kinds are optional).
- The per-visit token is gated on the new visit_linkage flag, off for
  Kingston; docs state it must stay off until the reviewed contract
  accepts the field. Unit fixture and browser collector test enable it
  to keep the capability covered.
- The install prompt UI is unaffected (product feature, no analytics
  dependency); its show/dismiss signals stay inert until the contract
  expansion.

Targeted tests: 20/20 analytics+contract unit, 6/6 webkit collector e2e.
Restoring an already-open listing after search, filter or refresh fired the
toggle listener and would have sent resource_open again.
@truegoodcraft truegoodcraft self-assigned this Oct 8, 2026
@truegoodcraft
truegoodcraft merged commit 19a8069 into main Oct 8, 2026
3 of 4 checks passed
@truegoodcraft
truegoodcraft deleted the claude/project-thread-964tgz branch October 8, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants