Skip to content

Species map trip dates frequency view - #63

Open
nleiby wants to merge 11 commits into
rawcomposition:mainfrom
nleiby:up/species-map-frequency
Open

Species map trip dates frequency view#63
nleiby wants to merge 11 commits into
rawcomposition:mainfrom
nleiby:up/species-map-frequency

Conversation

@nleiby

Copy link
Copy Markdown

Situation: The species map plots eBird reports from the last 30 days ("where has this been seen lately"), not "where will I find it on my trip". Out of season, those diverge, and the recent view isn't useful for trip planning. A reliable hotspot during the trip dates shows nothing if nobody has seen the species lately.

This PR tries to address this. It:

  1. Adds a "trip dates" mode to the target species view, plotting hotspots ranked and colored by species sighting frequency.
  2. In both modes, highlights saved hotspots with the trip map star marker. The marker is colored by frequency in the trip dates mode, and faded in either mode where there is no observation data for the saved hotspot.
  3. Adds map toggles: saved-hotspots-only and a "hide personal locations" mirroring the trip map
  4. Moves the species name card/ebird link/map description, and changes the X to a back arrow to clarify function between "back" and "close card"

Example species highlighting this situation: it hasn't been seen lately, but is relatively common during a November trip:

Screenshot 2026-09-01 at 12 17 51 AM

Menu item now reads "show on map" instead of specifying "recent"

Screenshot 2026-09-01 at 12 17 59 AM

Map now has selector for recent vs. trip dates. Hotspots on trip dates are colored by frequency. Species name/map description card is moved to side, and the X/close button changed to a back arrow. X was misleading, and made me think it would close the card, not leave the map.

Screenshot 2026-09-01 at 12 18 21 AM

Added a "show only saved hotspots"/"show all hotspots" toggle button to simplify view for trip planning:

Screenshot 2026-09-01 at 12 18 58 AM

No sightings in the last 30 days for this species, so a blank map except for faded saved hotspots:

Screenshot 2026-09-01 at 12 32 45 AM

Recent sightings for a species that has observations in the last 30 days- same as present, except saved hotspots marked:
Screenshot 2026-09-01 at 12 35 57 AM

nickleibyand others added 11 commits September 1, 2026 00:02
The map only plotted locations with a report in the last 30 days, so a
hotspot where the species is reliable during the trip's months showed
nothing at all out of season. Trip dates mode plots hotspots ranked by
frequency for those months instead, shaded by how often the species is
reported and ringed where the hotspot is already saved. Recent sightings
remains available from a toggle.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Recent sightings mix eBird hotspots with birders' private locations,
which can't be visited or saved to a trip.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Controls now sit where the trip map puts them. Closing the info card no
longer closes the map, so a dedicated close control replaces it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Saved hotspots were filtered out entirely in trip dates mode: the
region ranking returns the top 500 hotspots statewide, which rarely
includes a given trip's hotspots. They are now fetched by id and drawn
as the same star marker the trip map uses, tinted by frequency.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Marker clicks opened the hotspot modal and then immediately closed it,
because the outside-click guard did not recognise map markers. Saved
hotspots with no frequency data fell back to a color outside the scale.
The info card moves to the top left and its close control becomes a back
arrow, so one affordance leaves the map instead of two.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sortBy=frequency returned 500 hotspots all at exactly 100% with sample
sizes near 20 checklists, so every dot saturated. Rank by best instead,
which weights sample size, and stretch the color thresholds so the ramp
covers the range those results actually occupy.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Persisting it meant coming back to a near-empty map with no visible
cause.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Saved hotspots became markers, so the layer no longer carries isSaved
and the paint expressions keyed off it never matched; the legend
advertised a ring and a no-data swatch that could not appear. Filtering
personal locations inside useFetchSpeciesObs also leaked the map
preference into the species page's recent-hotspot scope, so it now
happens on the layer. Drops the duplicate Escape handler and skips the
saved-hotspot query outside trip dates mode.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A saved hotspot drew at full strength in recent sightings even when the
species had not been reported there in 30 days, which read as a sighting.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Selecting a saved hotspot on the species map covered its star with a
halo dot. Saved hotspots already have a marker, so highlight that
instead, keep them out of the observation layer that drew a second dot
underneath, and clear the fade while selected.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
...(locationIds ? { locationIds } : { region: trip?.region, limit: HOTSPOT_LIMIT }),
months,
sortBy: "frequency",
sortBy: "best",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorting by frequency seems to return less useful results: 100% of 19 checklists seems less useful for planning than 85% of 500. The species detail page also seems to default to it, so this makes the map agree with the list.

@rawcomposition

Copy link
Copy Markdown
Owner

Thanks for this. I'll take some time to digest what you've come up with and figure out if or what UI tweaks I want to make before merging.

Sign up for freeto 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.

3 participants

@nleiby@rawcomposition@nickleiby