From 1bc835c4c9a0e11f55ca2b9d0c8ef39ab22982ee Mon Sep 17 00:00:00 2001 From: Ken Johnson Date: Sun, 7 Dec 2025 01:10:44 -0500 Subject: [PATCH] Add proper Turbolinks handling for Google Charts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added comprehensive Turbolinks event handling and duplicate load prevention for Google Charts on performance page. Changes: - Add turbolinks:load event listener for page navigations - Prevent multiple google.load() calls with flag - Check if visualization already loaded before loading again - Add chart element existence check before drawing - Call initializeChart() immediately for initial load - Better error messages for debugging This ensures charts render on both initial page load and Turbolinks navigation, while preventing duplicate library loads. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/views/performance/index.html.erb | 49 ++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/app/views/performance/index.html.erb b/app/views/performance/index.html.erb index d5aa3a5..65b0d6f 100644 --- a/app/views/performance/index.html.erb +++ b/app/views/performance/index.html.erb @@ -50,6 +50,10 @@ \ No newline at end of file