From 11e5103382d235fd3297c47bc7158797a10ceee2 Mon Sep 17 00:00:00 2001 From: E-Wold Date: Wed, 15 Apr 2026 15:57:17 -0400 Subject: [PATCH 1/3] Fix Insights page blank screen by correcting include path in views.php 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). --- homepage/views.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homepage/views.php b/homepage/views.php index 8da5c67..f056bc4 100644 --- a/homepage/views.php +++ b/homepage/views.php @@ -512,7 +512,7 @@ function update_species_list($filename, $species, $add) { if($_GET['view'] == "Kiosk"){$kiosk = true;include('todays_detections.php');} if($_GET['view'] == "Species Stats"){include('stats.php');} if($_GET['view'] == "Weekly Report" || $_GET['view'] == "Report" || $_GET['view'] == "Reports"){include('scripts/reports.php');} - if($_GET['view'] == "Insights"){include('insights.php');} + if($_GET['view'] == "Insights"){include('scripts/insights.php');} if($_GET['view'] == "Analytics"){include('scripts/analytics.php');} if($_GET['view'] == "Species"){include('scripts/species.php');} if($_GET['view'] == "Daily Charts"){include('history.php');} From 05405d5766ac938ddb152166bb7b7419a2bcc180 Mon Sep 17 00:00:00 2001 From: E-Wold Date: Wed, 15 Apr 2026 15:57:35 -0400 Subject: [PATCH 2/3] Add All About Birds and Wikipedia links to Species page cards 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). --- scripts/species.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/species.php b/scripts/species.php index 08b8717..fb213f4 100644 --- a/scripts/species.php +++ b/scripts/species.php @@ -184,6 +184,10 @@ .stats-table { width: 100%; font-size: 0.85rem; } .stats-table tr td:first-child { color: var(--text-muted); padding-bottom: 4px; } .stats-table tr td:last-child { text-align: right; font-weight: 600; color: var(--text-primary); padding-bottom: 4px; } +.species-card-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; } +.species-card-links .mrd-link-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; text-decoration: none; color: var(--text-muted); background: var(--bg-input, #f1f5f9); border: 1px solid var(--border); transition: background 0.2s, color 0.2s; } +.species-card-links .mrd-link-pill img { width: 12px; height: 12px; } +.species-card-links .mrd-link-pill:hover { background: var(--accent); color: white; } @@ -304,6 +308,11 @@ Confidence:% First: + + From 3218b3773a0df632fa157b8fdf39f9e8bcab1cef Mon Sep 17 00:00:00 2001 From: E-Wold Date: Wed, 15 Apr 2026 15:57:56 -0400 Subject: [PATCH 3/3] Fix Weather Insights temperature trend line showing gaps 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. --- scripts/insights.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/insights.php b/scripts/insights.php index 128a3e7..eb6cff7 100644 --- a/scripts/insights.php +++ b/scripts/insights.php @@ -285,7 +285,7 @@ $wind_impact = $unified_wind; $ideal_res = $db->query("SELECT d.Com_Name, ROUND(AVG(w.Temp), 1) as avg_temp, ROUND(MIN(w.Temp), 1) as min_temp, ROUND(MAX(w.Temp), 1) as max_temp, COUNT(*) as cnt FROM detections d INNER JOIN weather w ON d.Date = w.Date AND CAST(substr(d.Time, 1, 2) AS INTEGER) = w.Hour GROUP BY d.Sci_Name HAVING cnt >= 5 ORDER BY cnt DESC"); while($row = $ideal_res->fetchArray(SQLITE3_ASSOC)) { $species_ideal[] = $row; } - $trend_res = $db->query("SELECT d.Date, COUNT(*) as det_count, ROUND(AVG(w.Temp), 1) as avg_temp FROM detections d LEFT JOIN weather w ON d.Date = w.Date AND CAST(substr(d.Time, 1, 2) AS INTEGER) = w.Hour WHERE d.Date >= '$one_month_ago' GROUP BY d.Date ORDER BY d.Date ASC"); + $trend_res = $db->query("SELECT d.Date, COUNT(*) as det_count, ROUND((SELECT AVG(w2.Temp) FROM weather w2 WHERE w2.Date = d.Date), 1) as avg_temp FROM detections d WHERE d.Date >= '$one_month_ago' GROUP BY d.Date ORDER BY d.Date ASC"); while($row = $trend_res->fetchArray(SQLITE3_ASSOC)) { $temp_vs_detections[] = $row; } $temp_trend_labels = json_encode(array_map(function($r) { return date('M j', strtotime($r['Date'])); }, $temp_vs_detections)); $temp_trend_temps = json_encode(array_map(function($r) { return $r['avg_temp']; }, $temp_vs_detections));