Skip to content

feat(map): show recurrence + time popover on event pin hover #72

Closed

Description

@Ardnived

Summary

When a user hovers an individual event pin on the map, show a small popover with
just that event's timing line — the recurrence + start time (e.g. "Every
Thursday · 7:30 PM"), identical to the top calendar line of the event's
EventListItem card. Today hovering a pin only swaps the cursor to a pointer
(hoverOnFeature in Map.tsx:176-184),
so a user scanning the map can't tell when an event meets without clicking
through to open it. A hover popover gives at-a-glance triage on the map, reusing
the shared display layer so the line can never drift from the list card.

Proposed changes

  • Popover on individual event pins only. Render on the unclustered-point
    layer, never on clusters (a cluster is many events — a single recurrence line
    is meaningless). Both are already in interactiveLayerIds
    (Map.tsx:202); gate on
    feature.layer?.id === unclusteredPointLayer.id.
  • Track the hovered pin. Extend the existing onMouseMove={hoverOnFeature}
    seam (Map.tsx:210) to also record
    the top hovered feature's id in local state (enter/leave by comparing to the
    previous id), and add an onMouseLeave on the map to clear it when the pointer
    leaves the canvas. Keep the current cursor behavior intact.
  • Re-join to the full event by id — no title join needed. The Mapbox source is
    deliberately trimmed to { id, webPath } (toMapSource,
    Map.tsx:64-71), so a hovered
    feature carries no schedule. Look the id up in the ['geojson'] React Query
    cache already read at Map.tsx:130-134
    — those feed features carry the full AgnosticFeedEvent (incl. schedule,
    eventType, address). Because the popover shows no title, the feed feature
    alone is enough — the ['event-titles', locale] sliver is not required, so
    the popover is fully self-contained from ['geojson'].
  • Render with react-map-gl <Popup> (v7 exports it; not used anywhere today),
    anchored to the pin's coordinates and offset above the pin, with
    closeButton={false}, closeOnClick={false}, and non-interactive
    (pointer-events: none / className) so it never steals the hover from the pin
    beneath it or blocks tap-to-open. Style it as a small card with the widget's
    tokens (matching the drawer/list surfaces), light + dark.
  • Content = the timing line only, from the shared formatter. Feed the resolved
    feed event into useEventDisplay(event) and render exactly the compact calendar
    fact — [recurrenceLine, eventStartTime].filter(Boolean).join(' · '), with the
    same one-off/terminal fallback to whenLine that EventFacts uses
    (EventFacts.tsx:125-137),
    and the leading CalendarIcon glyph to match. Factor that calendar-line
    composition so the popover and EventFacts share it rather than re-deriving it —
    the point of the single formatting layer (feat(event): redesign event display & registration surfaces #52). The popover component calls the
    hook once for the one hovered event (hooks can't run per-feature in a loop).
  • Pointer-only enhancement. A tap on a pin still navigates directly via the
    existing selectFeature/onClick — the popover is a desktop/hover affordance
    and must not interfere with tap-to-open on touch.

Acceptance criteria

  • Hovering an individual event pin shows a popover with that event's recurrence
    + start time, formatted identically to the top calendar line of its
    EventListItem card (e.g. "Every Thursday · 7:30 PM"), leading calendar glyph
    included.
  • The popover appears only for individual event pins (unclustered-point),
    never for clusters.
  • The line is produced by the shared useEventDisplay / EventFacts formatter
    — not a re-implementation — so it matches the card across weekly / fortnightly
    / monthly / daily recurrences, one-off and course events, and online events
    (event-local time).
  • The popover follows the correct pin, updates when moving between pins, and
    disappears on mouse-leave (of the pin and of the map canvas).
  • The popover does not capture pointer events (hovering it never flickers or
    steals hover from the pin) and does not block click/tap-to-open the event.
  • Works in light and dark map themes and respects the active locale (localized
    weekday names + time format).
  • No regression to pin click-to-navigate, clustering, or the card→pin highlight
    (feat(map): highlight an event's pin when hovering its card #44).
  • Lint + typecheck + build pass.
  • Verified in the running widget across a weekly, a one-off/course, and an
    online event.

Files affected

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Hold Until

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions