Repository navigation
feat(map): show recurrence + time popover on event pin hover - #73
Merged
Merged
Conversation
Pull the calendar-line composition (recurrence · time, with the one-off / terminal fallback to the when-line) out of EventFacts into a pure `composeCalendarLine` helper on the display layer, so a second surface can render the identical line without re-deriving it. Behaviour-preserving for the list card; unit-tested for the join rules. Prep for #72 (map-pin hover popover). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Hovering an individual event pin now shows a small non-interactive popover with that event's timing line (recurrence · start time), the same compact calendar line the list card leads with — via the shared composeCalendarLine formatter so the two can never drift. - Track the hovered unclustered-point id in Map.tsx (never a cluster), clear it on move-to-empty / cluster and on canvas exit (onMouseOut). - Re-join the id to the full feed event from the ['geojson'] cache (the map source is trimmed to id + webPath); the title sliver isn't needed. - Render via react-map-gl <Popup>, non-interactive (pointer-events:none), no close button, offset above the pin; default Mapbox popup chrome stripped in globals.css so the tokened card themes light/dark. Closes #72 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Drop the redundant functional-update guard in the pin-hover handler — React already bails out of a re-render when the id is unchanged (Object.is), so the manual prev===next check was reimplementing the built-in bailout. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Clear the hovered-pin state when a pin or cluster is clicked, so the timing popover doesn't linger over the pin after tap-to-open / click-through until the next pointer move (code-review L2). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Note the new EventPinPopover interaction in the map rule: local hovered-id state, re-join to the ['geojson'] cache, non-interactive react-map-gl Popup with chrome stripped in globals.css, and the shared composeCalendarLine formatter. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Deploying sahajatlas-design with
|
| Latest commit: |
905ff20
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9a9bba1a.sahajatlas-design.pages.dev |
| Branch Preview URL: | https://feat-pin-hover-popover.sahajatlas-design.pages.dev |
Deploying sahajatlas with
|
| Latest commit: |
905ff20
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://abd74773.sahajatlas.pages.dev |
| Branch Preview URL: | https://feat-pin-hover-popover.sahajatlas.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EventListItemcard can never drift across weekly / fortnightly / monthly / daily / one-off / course / online events and locales.unclustered-point), never clusters; it's a desktop/hover affordance that never blocks tap-to-open on touch.Changes
src/hooks/use-event-display.ts— extracted the calendar-line composition into a purecomposeCalendarLine({ recurrenceLine, whenLine, time, hasNext })helper (unit-tested).EventFactsnow calls it (behavior-preserving) so the list card and popover share one source.src/components/organisms/Mapbox/EventPinPopover/— new component: callsuseEventDisplayonce for the hovered event, renders a react-map-gl<Popup>(no close button, offset above the pin,pointer-events: none). Includes a Ladle story (token-gated live-map preview) + barrel.src/components/organisms/Mapbox/Map.tsx— track the hoveredunclustered-pointid in local state (never a cluster), clear on move-to-empty/cluster (onMouseMove), on canvas exit (onMouseOut), and on click; re-join the id to the full event from the['geojson']cache (the vector source is trimmed toid+webPath).src/styles/globals.css— scoped.event-pin-popoveroverride strips Mapbox's default popup chrome (box/tip) and forcespointer-events: none, so the tokened card themes light/dark and can't steal hover.Verification
pnpm lint)pnpm typecheck)pnpm test:run) — includes 5 newcomposeCalendarLinecases (weekly / one-off / terminal / missing-time)pnpm build+ladle:build)Manual / visual verification
Notes for reviewer
['geojson']feed event is sufficient — the per-locale titles sliver isn't needed.hoveredIdis deliberately localuseState, notuseViewState: it's set and read entirely withinMap.tsx(unlike the cross-component card→pinhover), so it stays off the hot-path store./simplifypass: dropped a redundantprev === nextstate-update guard (React already bails out viaObject.is). Code-review pass (single, isolated subagent, high effort): no Critical/High/Medium findings; applied L2 (dismiss popover on click); dismissed L1 (memo ignoringfilters) as unreachable — changing filters goes through toolbar/drawer interaction that firesonMouseOutfirst, and background refetches are handled by the memo'sdatadep.Closes #72
🤖 Generated with Claude Code