Skip to content

Fix Insights blank page, add Species page links, fix Weather chart temperature line#3

Open
E-Wold wants to merge 3 commits into
zach7036:mainfrom
E-Wold:feature/species-info-links-and-fixes
Open

Fix Insights blank page, add Species page links, fix Weather chart temperature line#3
E-Wold wants to merge 3 commits into
zach7036:mainfrom
E-Wold:feature/species-info-links-and-fixes

Conversation

@E-Wold
Copy link
Copy Markdown

@E-Wold E-Wold commented Apr 15, 2026

Summary

Three bug fixes and one feature addition were found while running this fork on a Raspberry Pi 4B with RaspiOS Bookworm.

Changes

1. Bug Fix — Insights page was completely blank (homepage/views.php)

views.php was calling include('insights.php') but the file lives at scripts/insights.php. All other views correctly use the scripts/ prefix (Analytics, Species, etc.) — Insights was the only one missing it, causing PHP to silently include nothing and render a blank page. One-line fix.

2. Feature — All About Birds / Wikipedia links on Species page (scripts/species.php)

The Overview and Recordings pages both show quick-link pill buttons (Info + Wikipedia) per species detection, but the Species gallery page had no equivalent. Added the same mrd-link-pill buttons to each bird card using the existing get_info_url() function. Respects the database language setting (shows eBird link for non-English installs). CSS is scoped to .species-card-links so it doesn't affect any other views.

3. Bug Fix — Weather Insights temperature line showing gaps (scripts/insights.php)

The Temperature vs Detections trend chart was joining detections to weather on an exact hour-level match (d.Date = w.Date AND CAST(substr(d.Time, 1, 2) AS INTEGER) = w.Hour). Any detection hour without a matching weather row produced a NULL temperature, and since AVG() silently skips NULLs the line disappeared for most days. Replaced with a daily average subquery so any day with partial weather data still produces a valid temperature reading.

Tested On

  • Raspberry Pi 4B
  • RaspiOS Bookworm (Debian 12)
  • Migrated from Nachtzuster fork

E-Wold added 3 commits April 15, 2026 15:57
insights.php lives in scripts/ but was being included as 'insights.php',
causing a silent failure. Changed to 'scripts/insights.php' to match
the pattern used by all other views (analytics, species, etc).
The Overview and Recordings pages both show Info and Wikipedia pill
buttons per species but the Species gallery page did not. Added the
same mrd-link-pill buttons to each bird card using the existing
get_info_url() function, with scoped CSS so styling doesn't affect
other views. Respects the database language setting (eBird vs AAB).
The trend query was joining detections to weather on exact hour match
causing NULL temperatures for any hour without a weather row.
Replaced with a daily AVG subquery so any day with partial weather
data still produces a temperature reading on the chart.
Sign up for free to 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.

1 participant