Fix Insights blank page, add Species page links, fix Weather chart temperature line#3
Open
E-Wold wants to merge 3 commits into
Open
Fix Insights blank page, add Species page links, fix Weather chart temperature line#3E-Wold wants to merge 3 commits into
E-Wold wants to merge 3 commits into
Conversation
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.
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
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.phpwas callinginclude('insights.php')but the file lives atscripts/insights.php. All other views correctly use thescripts/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-pillbuttons to each bird card using the existingget_info_url()function. Respects the database language setting (shows eBird link for non-English installs). CSS is scoped to.species-card-linksso 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 sinceAVG()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