Repository navigation
Closed
Description
Summary
Hovering an event card in a list gives no feedback on the map — the only card↔map
link happens after navigation, when frameEvent selects the pin and flies to it.
Add a hover highlight: while the pointer is over an EventCard, that event's pin
is visually emphasized on the map (no camera movement), so users can connect list
entries to locations before clicking through. Applies everywhere EventCard
renders: search results (EventsList) and the region view.
Proposed changes
- Store (
src/config/store.ts): add ahoverfield touseViewState
alongsideselection— same shape ({ latitude, longitude, approximate } | null)
— with asetHoveraction. - Controller seam (
src/hooks/use-map-controller.tsx): add
highlightEvent(event: EventSlim | null)toMapController. The real provider
derives{ latitude, longitude, approximate: isOnline(event) }exactly as
frameEventdoes, but only setshover— it must not move the camera. The
no-op provider does nothing, so cards never branch onmap=false. - Layers (
src/components/organisms/Mapbox/layers.ts): add a
hoveredPointLayer(+ approximate/area variant) fed by a newhoversource.
Reuse the existingselected/cluster-selectedsprites with distinct
icon-size/icon-opacityso no Mapbox style change is needed (a dedicated
hover sprite can come with feat(map): brand-colour the map markers and cluster paints #17). Definitions live inlayers.ts, not inline JSX. - Map (
src/components/organisms/Mapbox/Map.tsx): render thehoversource
mirroring the existingselectionsource (its own source, so the highlight
shows even when the pin is inside a cluster at the current zoom). Do not
add it tointeractiveLayerIds. - Card (
src/components/molecules/EventCard/EventCard.tsx): on the root
Link, callhighlightEvent(event)ononMouseEnter/onFocusand
highlightEvent(null)ononMouseLeave/onBlur(keyboard parity). Clear the
hover state on unmount so no stale highlight survives navigating away.
Acceptance criteria
- Hovering an event card highlights that event's pin on the map; the camera
does not move - Un-hovering (or the card unmounting) removes the highlight; clicking
through hands over cleanly to the existingframeEventselection - Works from both render sites: search results list and region view
- Online events show the approximate-area highlight (like
frameEvent);
events without coordinates highlight nothing and don't error - Highlight renders even when the pin is clustered at the current zoom
- Keyboard focus on a card behaves like hover (focus/blur parity)
- With
map=false, hovering is a no-op through the noop controller — no
view/card branches on the map flag - Layer paint/layout defined in
layers.ts;interactiveLayerIdsunchanged - Lint + typecheck + test:run pass
- Verified in the running widget (hover cards in search results and a region
list with the map visible)
Files affected
src/config/store.tssrc/hooks/use-map-controller.tsxsrc/components/organisms/Mapbox/layers.tssrc/components/organisms/Mapbox/Map.tsxsrc/components/molecules/EventCard/EventCard.tsx
References
- MapController seam introduced in feat(ui): rework UI into a nested-drawer navigation system #30 (
.claude/rules/mapbox.md) - feat(map): brand-colour the map markers and cluster paints #17 — marker sprite re-theming (on hold); a dedicated hover sprite would land
there, this ticket reuses the existingselectedsprite
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Hold Until
None yet
Activity
fix(map): render map symbols instantly (no fade-in)
feat(map): highlight an event's pin when hovering its card (#49)