Native AFP pages: forecast and observation engagement events

Aperta
#1,509 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
next.js, typescript

Direzione di ricerca

Read docs/analytics-events.md and the implementation and acceptance criteria in the linked widget issues #319, #320, and #321 first; native work is blocked until those land and a forecast rollout is planned. Trace the native forecast sections, GlossaryProse/AuthoredHtml, MediaLightbox, and ZoneObservationCards named in the issue, then add the matching event behavior and client tests for the timer and send triggers. Done means native pages emit the widget event names and properties wherever those surfaces exist.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

blocked enhancement ready-for-agent

This was generated by AI during triage.

Parent

#1484. Related: #1135, #1136.

What to build

Emit the engagement events specified in #1487 on the native forecast and observation pages, so a center's numbers don't change when a product flips from widget to native. #1136 covers the existing widget vocabulary and explicitly excludes these events. Follow docs/analytics-events.md in the widgets repo, which is the source of truth by then.

No center has nativeProducts.forecast on in production, so this waits until a flip is planned.

Implementation notes

  • useAnalytics().capture accepts only string properties and no options. forecast_read needs numbers and sendBeacon transport.
  • The forecast sections render on the server, and data-print-section can't identify them: the danger panel uses bottomLine and media has none. Add a dedicated attribute and one client island that owns the section timer.
  • Sanitized forecast HTML also renders on the server, so forecast_link_clicked needs a delegated listener in a client wrapper around GlossaryProse and AuthoredHtml.
  • media_viewed hooks into MediaLightbox. ProblemMediaFigure, DiscussionBody and ForecastMediaThumbnails all open it.
  • observation_read and the has_avalanches/has_cracking/has_collapsing flags also apply once native observations ship.
  • seconds_on_list and list_position apply once native observations ship. Forecast-tab opens use ZoneObservationCards, which already has observerType and mediaCount.

Acceptance criteria

  • For the same forecast page, native and widget send the same event names and properties, with widget: forecasts
  • A trends breakdown of forecast_read by center includes native and widget centers with no per-host special casing
  • Each behavior in the widget acceptance criteria holds on native pages, where the surface exists
  • Client tests cover the section timer and the send triggers

Out of scope

The existing widget vocabulary (#1136), video_progressed, and widget changes.

Blocked by

  • NationalAvalancheCenter/afp-public-widgets#319, NationalAvalancheCenter/afp-public-widgets#320 and NationalAvalancheCenter/afp-public-widgets#321 (the implementations this mirrors)
  • A planned native forecast rollout for at least one center
Lingua principale
TypeScript
Stelle
6
Fork
2
Merge medio
1g 11h
PR unite (30g)
35

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NWACus/web

Tutte le issue di NWACus/web

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.