Commit Graph

645 Commits

Author SHA1 Message Date
Eddy G
cc9e613ba7 Merge remote-tracking branch 'upstream/main' into modernization-and-refactor 2025-06-29 22:42:03 -04:00
Matt Walsh
c6af9a2913 5.26.2 v5.26.2 2025-06-27 22:30:05 -05:00
Matt Walsh
11eba84cdb fix for calm/0mph wind close #121 2025-06-27 22:29:56 -05:00
Matt Walsh
b9ead38015 5.26.1 v5.26.1 2025-06-27 22:17:00 -05:00
Matt Walsh
3d0178faa1 radar scrolling fix for ios 2025-06-27 22:16:51 -05:00
Eddy G
b1c4e6d850 Merge remote-tracking branch 'upstream/main' into modernization-and-refactor 2025-06-27 18:21:32 -04:00
Matt Walsh
8a2907e02c fix display of null wind speed 2025-06-27 15:35:15 -05:00
Matt Walsh
b870ce1c01 store already processed radar images for reuse on silent reload 2025-06-27 15:29:20 -05:00
Eddy G
90c1ab92b4 Merge upstream/main: integrate radar worker removal and improvements
- Remove radar-worker.mjs and integrate functionality into radar-processor.mjs
- Update package.json and gulpfile.mjs with upstream changes
2025-06-27 11:05:32 -04:00
Matt Walsh
15107ffe1c 5.26.0 v5.26.0 2025-06-27 08:56:14 -05:00
Matt Walsh
efd4e0c66d Remove workers from build processes 2025-06-27 08:56:04 -05:00
Matt Walsh
652d7c5fb0 Merge remote-tracking branch 'origin/radar-no-worker' #74 #140 2025-06-27 08:54:50 -05:00
Matt Walsh
5a80f43f30 add staging gulp tasks 2025-06-26 22:30:42 -05:00
Matt Walsh
6d090cb1c7 streamline radar tile layout calculation #74 2025-06-26 21:23:44 -05:00
Eddy G
17585e97c4 Update README to clarify deployment modes and music handling
- Add clear distinction between Server and Static deployment modes
- Restructure run instructions with specific npm commands and their purposes
- Clarify Docker deployment scenarios (static vs server, with examples)
- Rewrite music section to explain server-side vs browser-side playlist generation
2025-06-26 20:39:18 -04:00
Eddy G
517cafe40a Refactor data loading: move from inline JSON to client-side fetch
- Remove large JSON data injection from EJS templates
- Add client-side data-loader utility with cache-busting support
- Create server endpoints for JSON data with long-term caching
- Add graceful failure handling if core data fails to load
- Copy JSON data files to dist/data for static hosting
- Update app initialization to load data asynchronously
- Set serverAvailable flag for static builds in gulp task

This reduces HTML payload size and enables better caching strategies
for both server and static deployment modes.
2025-06-26 20:10:15 -04:00
Eddy G
7f7cb96231 Add STATIC environment variable for browser-only deployment mode
Implement STATIC=1 environment variable to enable browser-only deployment
without proxy server infrastructure. Uses WS4KP_SERVER_AVAILABLE flag to
distinguish between server-backed and static deployments for proper URL
rewriting and User-Agent header handling.

- Add STATIC env var to skip proxy route registration at startup
- Inject WS4KP_SERVER_AVAILABLE flag via EJS template based on STATIC mode
- Update fetch.mjs to conditionally send User-Agent headers based on server availability
- Update url-rewrite.mjs to skip proxy rewriting when server is unavailable
- Use renderIndex helper for consistent template data across dev/prod modes
- Improve music playlist logging

Benefits of integrated approach:
- Single environment variable controls both server and client behavior
- Flag injection happens once at render time, not on every request
- No runtime HTML string manipulation overhead
- Clean separation between server-backed and static deployment logic
- Same codebase supports both deployment modes without duplication

Static mode (STATIC=1): Direct API calls to external services, no caching
Server mode (default): Local proxy with caching and API request observability
2025-06-26 20:10:11 -04:00
Eddy G
bfd0c2b02d Add 'no-unused-vars' rule for vars starting with _ 2025-06-24 23:54:59 -04:00
Eddy G
c8b520b752 Build CSS changes 2025-06-24 23:54:23 -04:00
Eddy G
ebface1749 Add comment about not needing to use safeJson()
- Fix indentation in media.mjs
2025-06-24 23:53:44 -04:00
Eddy G
137c2f6d08 Don't set to failed if not enabled
- Allow any falsey value to indicate failure
2025-06-24 23:42:22 -04:00
Eddy G
bec80a1ebe Refactor alert/hazard system with timing and display improvements
- Replace magic numbers with seconds-based timing constants
- Switch from scrollTo() to hardware-accelerated transform
- Add scroll caching to prevent repeated DOM queries every scroll cycle
- Switch to safeJson() for centralized error handling across alert modules
- Horizontal alert scroll now goes edge-to-edge
- Integrate global speed settings into horizontal scroll timing
- Improve error handling flow with better fallback behavior for missing data
- Remvoe unused getCurrentData() function in hazards.mjs
- Move background color from scrolling element to container to avoid
    showing the underlying content when scrolling with trasnform
2025-06-24 23:41:44 -04:00
Eddy G
e34137e430 Refactor timing calculations and improve scroll performance
- Replace magic numbers with seconds-based timing constants
- Switch from scrollTo() to hardware-accelerated transform for smooth scrolling
- Add scroll caching to prevent repeated DOM queries every scroll cycle
- Fix calculations to support flexible hourly forecast lengths
    (i.e. in the future, could offer every other hour)
- Switch to safeJson() for centralized error handling
2025-06-24 23:40:07 -04:00
Eddy G
c0e2eaf33a Refactor timing calculations and improve scroll performance
- Replace magic numbers with seconds-based timing constants
- Switch from scrollTo() to hardware-accelerated transform
- Add scroll caching to prevent repeated  DOM queries every scroll cycle
- Fix calculations to allow an arbitrarily-sized list of travel forecast cities
- Switch to safeJson() and safePromiseAll() for centralized error handling
2025-06-24 23:39:40 -04:00
Eddy G
975bccdac5 Switch from json() to safeJson() for centralized error handling
- Prevent infinitie recursion by ensuring the same display is not
    selected in loadDisplay()
2025-06-24 23:37:47 -04:00
Eddy G
8ead95c041 Improve error handling and API efficiency
- Switch to safe*() methods for centralized error handling
- Add error handling and validation
- Optimize radar API usage by only fetching yesterday's data when needed
- Use centralized URL rewriting for caching proxy support
- Add debug logging throughout radar processing pipeline
- Improve canvas context validation and error recovery
- Handle worker errors gracefully by setting totalScreens = 0 to skip in animation
- Remove unused OVERRIDES parameter passing to workers
2025-06-24 23:35:41 -04:00
Eddy G
8f34aa5139 Improve error handling
- Use safeJson() and safePromiseAll() for centralized error handling
- Enhance logging with structured debug flags
2025-06-24 23:10:52 -04:00
Eddy G
e472b99b44 Improve SPC Outlook data fetching and error handling
- Switch to safeJson() and safePromiseAll() for centralized error handling
- Only set failed state if enabled
2025-06-24 23:09:18 -04:00
Eddy G
09a21e6f5a Add content-aware transition timing; remove expired forecasts
- DOM-based measurement system for accurate forecast lines
- Replace fixed-timing with dynamic timing based on actual forecast lines
- Filter out expired forecasts
- Improve error handling and only set failed state if enabled
- Debug logging for timing calculations and content measurement
- Switch from json() to safeJson() for centralized error handling
2025-06-24 23:08:25 -04:00
Eddy G
dd680c61b0 Enhance extended forecast parsing and error handling
- Add module for expired period filtering
- Switch from json() to safeJson() for centralized error handling
- Improve nighttime period handling to focus on full days
- Fix day/night temperature pairing logic
- Add debug logging
2025-06-24 23:07:47 -04:00
Eddy G
79de691eef Augment missing weather data from METAR when possible; use centralized error handling
- Add utility function to augment missing weather observation data from METAR
- Switch from json() to safeJson() for centralized error handling
- Data quality validation and age checks
- Add null/undefined value handling for wind direction calculations
2025-06-24 23:05:51 -04:00
Eddy G
ec83c17ae2 Add 'metar-taf-parser' npm dependency
- Adds METAR (Meteorological Aerodrome Report) parsing capabilities
- metar-taf-parser has no dependencies, so impact is small
2025-06-24 22:58:51 -04:00
Eddy G
5630067530 Fix auto-refresh to use weather parameters; add timing debug logging
- Fixes issue where auto-refresh could fail due to missing weather parameters
2025-06-24 22:56:08 -04:00
Eddy G
506ac1f4df Add 'start'/'stop' and more files to lint targets 2025-06-24 22:54:37 -04:00
Eddy G
0e0ea3c378 Add debug flag management system
- Default debug flags settable by query param or env variable
- Allows comma-separated list of debug flags
- Runtime modification (enable/disable/set) via console
- Support "all" flag for enabling/disabling everything
2025-06-24 22:53:25 -04:00
Eddy G
bf65b8e426 Update VS Code settings
- "eslint.validate": [ "javascript" ] is no longer needed
    (Modern versions of the ESLint VS Code extensions
    automatically validate JavaScript files by default.)
- Configure editor to use tabs instead of spaces per ESLint rules
- Switch to VS Code's built-in HTML formatter
- Add EJS file associations for proper syntax highlighting
- Add recommended extensions for development workflow
2025-06-24 22:52:59 -04:00
Eddy G
ca272de8bf Replace separate .js data files with server-side JSON injection
- Remove need to maintain duplicate .js data files alongside JSON sources
- Load JSON data once at server startup and inject into templates
- Dev and production modes use the same data sources

Removes:
- server/scripts/data/{travelcities,regionalcities,stations}.js
- gulp compressJsData task for bundling data files
2025-06-24 22:51:09 -04:00
Eddy G
65944dc3b5 Add comprehensive responsive scanline scaling system with anti-aliasing
- Attempt pixel-perfect scanline rendering for scaled displays and zoom scenarios
- Implement dynamic scanline thickness calculation to prevent sub-pixel rendering issues
- Add enhanced kiosk detection via isKioskLike for better fullscreen optimization
- Optimize scanlines for specific kiosk resolutions (1024x768, 1023x767)
- Add responsive SCSS media queries for different display densities
- Include extensive debugging utilities for scanline troubleshooting
- Improve noSleep error handling with proper promise rejection handling
- Update to modern fullscreen API method names
- Add async/await error handling for fullscreen requests
- Trigger resize after fullscreen engagement to apply optimal scaling
2025-06-24 22:38:25 -04:00
Eddy G
be41d66de9 Improve kiosk mode startup experience
- Pass query parameters to EJS template for kiosk mode detection
- Add kiosk class to body when enabled via query parameter
- Simplify kiosk mode CSS to hide all elements except main weather display
- Add null checks for progress object to prevent errors in kiosk mode
- Prevent navigation errors when no suitable displays are available
2025-06-24 22:30:16 -04:00
Eddy G
7a07c67e84 Replace CORS proxy with complete server-side cache
- Replace cors/ directory and cors.mjs utility with comprehensive
    HTTP caching proxy in proxy/ directory
- Implement RFC-compliant caching with cache-control headers,
    conditional requests, and in-flight deduplication
- Centralized error handling with "safe" fetch utilities
- Add unified proxy handlers for weather.gov, SPC, radar, and mesonet APIs
- Include cache management endpoint and extensive diagnostic logging
- Migrate client-side URL rewriting from cors.mjs to url-rewrite.mjs
2025-06-24 20:45:43 -04:00
Matt Walsh
b5fa3e49d6 remove radar-worker and offscreen canvas to make things easier for ios #74 2025-06-20 22:04:00 -05:00
Matt Walsh
ef0b60a0b8 Merge pull request #117 from rmitchellscott/fix-radar-mime-chrome
fix: radar mime-type in chrome in Docker
2025-06-20 21:12:40 -05:00
Mitchell Scott
dc13140cc4 fix: radar mime-type in chrome 2025-06-20 08:40:52 -06:00
Matt Walsh
5414b1f5bc Merge pull request #116 from arazilsongweaver/bugfix-docker-nginx-config-add-mime-type
Docker: Add mime.types To nginx Configuration
2025-06-20 09:20:49 -05:00
Arazil
1fdc3635e6 Docker: Add mime.types To nginx Configuration
Explicit configuration of nginx MIME types is required for the proper operation the radar viewer.
2025-06-20 08:06:32 -05:00
Matt Walsh
e2cc86cddd 5.25.3 v5.25.3 2025-06-19 23:30:56 -05:00
Matt Walsh
92181c716d clean up linking to radar worker 2025-06-19 23:30:44 -05:00
Matt Walsh
208ca3d87f 5.25.2 v5.25.2 2025-06-19 22:50:17 -05:00
Matt Walsh
7167bb18fb allow one missing valueon current conditoins #94 #114 2025-06-19 22:50:09 -05:00
Matt Walsh
daa81ebf94 Merge branch 'rmitchellscott-static-docker' 2025-06-19 21:57:08 -05:00