Commit graph

67 commits

Author SHA1 Message Date
b5210faa96 Merge pull request 'Fix aircraft track orientation propagation to web frontend' (#26) from fix/issue-23-track-propagation into main
Reviewed-on: #26
2025-08-25 10:49:55 +02:00
1fe15c06a3 Fix aircraft track propagation issues in web frontend
This commit addresses issue #23 where aircraft track changes were not
propagating properly to the web frontend. The fixes include:

**Server-side improvements:**
- Enhanced WebSocket broadcast reliability with timeout-based queueing
- Increased broadcast channel buffer size (1000 -> 2000)
- Improved error handling and connection management
- Added write timeouts to prevent slow clients from blocking updates
- Enhanced connection cleanup and ping/pong handling
- Added debug endpoint /api/debug/websocket for troubleshooting
- Relaxed position validation thresholds for better track acceptance

**Frontend improvements:**
- Enhanced WebSocket manager with exponential backoff reconnection
- Improved aircraft position update detection and logging
- Fixed position update logic to always propagate changes to map
- Better coordinate validation and error reporting
- Enhanced debugging with detailed console logging
- Fixed track rotation update thresholds and logic
- Improved marker lifecycle management and cleanup
- Better handling of edge cases in aircraft state transitions

**Key bug fixes:**
- Removed overly aggressive position change detection that blocked updates
- Fixed track rotation sensitivity (5° -> 10° threshold)
- Enhanced coordinate validation to handle null/undefined values
- Improved WebSocket message ordering and processing
- Fixed marker position updates to always propagate to Leaflet

These changes ensure reliable real-time aircraft tracking with proper
position, heading, and altitude updates across multiple data sources.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 10:14:03 +02:00
8ffb657711 Remove generated changelog.gz from version control
The debian/usr/share/doc/skyview-adsb/changelog.gz file is automatically
generated during the Debian package build process and should not be
tracked in version control. It's created fresh from git history each
time the package is built.

- Removed changelog.gz from git tracking
- Added to .gitignore to prevent re-addition
- Ensures clean builds without git conflicts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 08:53:21 +02:00
f13f1da2a3 Bump version to 0.0.5 v0.0.5
New release includes:
- Renamed Debian package from skyview to skyview-adsb to avoid conflicts
  with NASA's SkyView Virtual Observatory package
- Implemented incremental changelog generation for Debian packages
  showing complete version history

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 08:43:57 +02:00
a5faddf900 Merge pull request 'Implement incremental changelog generation for Debian packages' (#25) from feature/incremental-changelog into main
Reviewed-on: #25
2025-08-25 08:38:30 +02:00
7c9f7dc8c9 Implement incremental changelog generation for Debian packages
Fixes #22: Improve Debian package changelog to show incremental version history

The Debian package changelog now includes the complete version history
instead of just changes since the previous release. This provides users
with full visibility into the software's evolution when reviewing
package updates.

Changes:
- Rewrote changelog generation to iterate through all git tags
- Generate entries for each tagged version in reverse chronological order
- Include current development version if commits exist after latest tag
- Fixed shellcheck warnings for better script quality
- Added -f flag to gzip to force overwrite existing changelog.gz files

Benefits:
- Complete version history visible in every package
- Standard Debian changelog format compliance
- Better integration with apt changelog and dpkg tools
- Improved transparency for users reviewing updates
- Proper audit trail for administrators

The changelog now shows all versions with their respective changes,
making it easier for users to understand what has changed between
their installed version and the available update.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 08:32:43 +02:00
be5369c195 Rename Debian package from skyview to skyview-adsb
The official Debian repositories already contain a package named
"skyview" which is associated with NASA's SkyView Virtual Observatory
(https://skyview.gsfc.nasa.gov/), a tool for astronomical data
visualization.

To avoid package naming conflicts and potential confusion for users,
this commit renames our ADS-B aircraft tracking application package
to "skyview-adsb". This clearly indicates the package's purpose
(ADS-B tracking) while maintaining the SkyView brand identity.

Changes:
- Package name: skyview → skyview-adsb
- System user/group: skyview → skyview-adsb
- Config directory: /etc/skyview → /etc/skyview-adsb
- Data directory: /var/lib/skyview → /var/lib/skyview-adsb
- Log directory: /var/log/skyview → /var/log/skyview-adsb
- Systemd service: skyview.service → skyview-adsb.service
- Documentation path: /usr/share/doc/skyview → /usr/share/doc/skyview-adsb

The binaries (/usr/bin/skyview and /usr/bin/beast-dump) remain
unchanged as they don't conflict at the filesystem level.

This ensures clean installation alongside any existing skyview
packages and prevents apt/dpkg conflicts during installation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 08:23:11 +02:00
61b735b226 Correct algorithm development description to reflect iterative process
Update study to accurately reflect that complex algorithms like CPR decoding
required multiple iterations, but the speed of these iterations far exceeded
manual development cycles - completing refinements in hours vs days/weeks.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 23:46:23 +02:00
97a30b4274 Add AI development acceleration study documenting 40-56x speedup
Comprehensive analysis comparing traditional development estimates (6-8 weeks)
against actual AI-assisted timeline (1 day). Documents complete elimination
of manual coding requirement and transformation from implementation-focused
to requirements-focused development paradigm.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 23:43:11 +02:00
65d602a6f8 Update architecture documentation to reflect in-memory ICAO database
Remove outdated SQLite references and update documentation to accurately
describe the current in-memory ICAO allocation database implementation
with binary search lookups.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 23:28:08 +02:00
a5e542844f Bump version to 0.0.4 v0.0.4
Release includes critical CPR position decoding fix that resolves
systematic eastward bias in aircraft positioning.

Changes:
- Updated Debian control file version
- Updated web UI version display

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 23:14:23 +02:00
60ba5ae825 Merge pull request 'Fix CPR zone ambiguity causing systematic eastward position bias' (#20) from fix/cpr-zone-ambiguity into main
Reviewed-on: #20
2025-08-24 23:10:48 +02:00
cb79e0b3b7 Fix CPR zone ambiguity causing systematic eastward position bias
This addresses Issue #18 by correcting the CPR global decoding algorithm
implementation that was causing aircraft to appear tens of kilometers
east of their actual positions.

Root Cause:
- CPR longitude zone calculation always used NL-1 regardless of frame type
- Specification requires: even frames use NL zones, odd frames use NL-1 zones
- This caused systematic eastward displacement for all aircraft positions

Changes:
- Implement frame-consistent zone calculations per RTCA DO-260B specification
- Even frame (i=0): ni = max(1, NL - 0) = max(1, NL)
- Odd frame (i=1): ni = max(1, NL - 1)
- Add comprehensive documentation with authoritative source references
- Ensure latitude and longitude use same frame choice for consistency

Testing:
- Aircraft south of Oslo now appears correctly (was near Skarlandsvatnet)
- Aircraft north of Oslo should now appear correctly (was east of Lillestrøm)
- Systematic eastward bias eliminated

References:
- RTCA DO-260B / EUROCAE ED-102A: ADS-B Performance Standards
- ICAO Annex 10, Volume IV: Surveillance Systems
- "Decoding ADS-B position" by Edward Lester
- PyModeS reference implementation

Fixes #18

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 23:07:56 +02:00
b0a5ab412b Add DEBIAN/conffiles to protect configuration files during upgrades
Added conffiles entry for /etc/skyview/config.json to ensure that user
customizations are preserved during package upgrades. This follows
Debian packaging best practices for configuration file handling.

The conffiles mechanism will:
- Prevent overwrites of modified config files during upgrades
- Prompt users for action when package config differs from local config
- Maintain backup files (.dpkg-old, .dpkg-new) for reference

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 22:08:13 +02:00
2d7fda717c Bump version to 0.0.3 v0.0.3
Update all version references in preparation for v0.0.3 release:
- Debian package control file
- Manual pages for skyview and beast-dump
- Web interface header display
- README installation instructions
- Documentation examples

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 21:59:46 +02:00
6414ea72f1 Add active WebSocket client tracking and display
Track and display the number of active WebSocket connections viewing the
aircraft tracker. Features:

Backend:
- Add getActiveClientCount() method for thread-safe client counting
- Include active_clients count in all statistics responses
- Integrate with existing stats API endpoints

Frontend:
- Display "X viewer(s)" in header stats with proper plural/singular grammar
- Add "Active Viewers" card to Statistics view
- Real-time updates as clients connect/disconnect
- Fallback to 1 when stats not yet available

This adds a social element showing "Now being watched by X users" style
information prominently in the interface.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 21:56:16 +02:00
802e964cc0 Add automatic changelog generation to Debian package build
The build script now automatically generates a proper Debian changelog from
git history between version tags. Features:

- Proper Debian changelog format with version, urgency, and timestamp
- Automatic version detection using git describe --tags
- Change list from previous version tag to current commit
- Compressed storage as per Debian standards (changelog.gz)
- Fallback logic for initial releases when no previous tags exist

The changelog is installed to /usr/share/doc/skyview/changelog.gz following
Debian packaging best practices.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 21:45:18 +02:00
29aedb5b50 Remove arbitrary 600kt speed cap from Mode S decoder
The decoder was capping all speeds at 600kt before validation, which caused:
1. Corrupt helicopter data to show false 600kt readings
2. Legitimate high-speed aircraft to be incorrectly limited
3. Validation logic in merger to miss corrupt data detection

The merger already has proper speed validation at 2000kt (Mach 3) and
position-based validation that catches impossible speeds from corrupt data
regardless of aircraft type.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 21:43:15 +02:00
61e80f6735 Rewrite CLAUDE.md for improved clarity and completeness
- Restructured into logical sections with clear hierarchy
- Added comprehensive development principles and quality standards
- Detailed code organization for both backend (Go) and frontend (JS)
- Explicit performance requirements with specific metrics
- Clear documentation standards and maintenance responsibilities
- Aviation domain considerations for safety and regulatory compliance
- Repository tooling guidelines emphasizing Forgejo over GitHub tools
- Added release management and version control best practices

Now serves as a complete development handbook for the SkyView project.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 21:32:30 +02:00
215456e281 Default range rings to enabled v0.0.2
- Set showRange to true by default in map-manager.js
- Check range rings checkbox by default in HTML
- Provides better initial user experience with distance reference

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 21:09:33 +02:00
50c27b6259 Merge pull request 'Complete Beast format implementation with enhanced features and fixes' (#19) from beast-format-refactor into main
Reviewed-on: #19
2025-08-24 20:50:37 +02:00
960f47682d Improve position validation logging and reduce spam
- Remove duplicate validation logging between mergeAircraftData and updateHistories
- Add rate limiting: errors logged max once per 10 seconds per aircraft
- Add rate limiting: warnings logged max once per 30 seconds per aircraft
- Only log first error/warning message to reduce log verbosity
- Clean up validation log entries when aircraft become stale
- Maintain memory efficiency with automatic cleanup

This significantly reduces log spam from aircraft with persistent
position validation issues (e.g., CPR decoding problems).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 20:39:57 +02:00
94092298a1 Add separate color and legend entry for High Vortex Large aircraft
- Added High Vortex Large as distinct category in legend
- Assigned red-orange color (#ff4500) to differentiate from regular Large
- Updated JavaScript to check for high vortex before regular large
- Maintains proper ADS-B category distinctions for wake turbulence

High Vortex Large aircraft (like B757) create stronger wake turbulence
than typical large aircraft, warranting visual distinction for safety.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 20:28:27 +02:00
a231c5f2fc Fix aircraft weight category classification
- Fixed incorrect category label: 34000-136000kg is Large, not Medium
- Updated JavaScript color matching to properly distinguish categories
- Simplified color logic to use category keywords (light/medium/large/heavy)

This ensures:
- Light aircraft (< 7000kg): Sky blue
- Medium aircraft (7000-34000kg): Green
- Large aircraft (34000-136000kg): Orange
- Heavy aircraft (> 136000kg): Red

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 20:24:48 +02:00
127fe3cfe4 Remove debug logging for DF11 messages
- Cleaned up temporary debug output that was added for testing
- DF11 message processing is working correctly, no longer needs logging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 20:21:52 +02:00
d8b53167a2 Add health check endpoint for monitoring and load balancers
- Added /health endpoint for Caddy and other monitoring systems
- Returns JSON with service status, source connectivity, and metrics
- HTTP 200 when healthy, 503 when degraded (no active sources)
- Includes aircraft count, message count, and source status

Useful for:
- Load balancer health checks
- Service monitoring dashboards
- Automated alerting systems

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 20:20:46 +02:00
ed1e03382a Improve aircraft icons and add weight-based color coding
- Replaced simple geometric shapes with detailed, realistic SVG icons for all aircraft types
- Implemented color differentiation based on aircraft weight categories:
  * Light (<7000kg): Sky blue
  * Medium (7000-34000kg): Green
  * Large (34000-136000kg): Orange
  * Heavy (>136000kg): Red
- Created new icons for: commercial airliner, helicopter, cargo aircraft, general aviation, military fighter, ground vehicle
- Updated legend to reflect new weight-based categories
- Modified getAircraftColor() to assign colors based on aircraft category/weight

Closes #17

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 20:16:25 +02:00
72f9b18e94 Fix transponder information display and add signal quality foundation
**Transponder Display - WORKING **
- Fixed: TransponderCapability now appears in popup (showing "Enhanced", "Level 2+", etc.)
- Added transponder field handling in merger.go mergeAircraftData()
- Shortened labels: "Level 2+" instead of "Level 2+ Transponder"
- Shows in popup when DF11 All-Call Reply messages are received

**Signal Quality Implementation - IN PROGRESS ⚠️**
- Added SignalQuality field to Aircraft struct and JSON marshaling
- Added calculateSignalQuality() function with quality levels: Excellent/Good/Fair/Poor
- Added signal quality field merging logic with intelligent quality prioritization
- Extended squitter messages set baseline "Good" quality
- Enhanced NACp extraction from airborne position messages (TC 9-18)

**Current Status:**
-  Transponder info displays correctly in popup
- ⚠️ Signal quality implementation complete but not appearing in popup yet
- ⚠️ Needs investigation of data flow between decoder and frontend

**Next Steps:**
- Debug why SignalQuality field remains empty in API responses
- Verify signal quality calculation is being called for received message types
- Test with live ADS-B data to confirm field population

The transponder capability display issue is now resolved. Users can see
transponder levels in aircraft popups when available.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 19:46:58 +02:00
304b13a904 Improve transponder display and add combined signal quality indicator
**Transponder Display Improvements:**
- Simplified transponder capability labels to be more concise
- "Level 2+ Transponder" → "Level 2+"
- "Enhanced Transponder" → "Enhanced"
- "Alert/Emergency Status" → "Alert/Emergency"
- Removes redundant "Transponder" suffix for cleaner popup display

**New Signal Quality Feature:**
- Added SignalQuality field combining NACp, NACv, and SIL into human-readable assessment
- Quality levels: "Excellent", "Good", "Fair", "Poor" based on aviation standards
- Prioritizes surveillance integrity (SIL) then position accuracy (NACp)
- Automatically calculated when operational status messages (TC 31) are received
- Displayed in aircraft popup when available

**Signal Quality Algorithm:**
- **Excellent**: High integrity (SIL ≥ 2) with precise position (NACp ≥ 9)
- **Good**: Good integrity with moderate accuracy OR very high accuracy
- **Fair**: Some integrity with basic accuracy OR high accuracy without integrity
- **Poor**: Low but usable quality indicators
- **Empty**: No quality data available

**Frontend Enhancements:**
- Added "Signal Quality" row to aircraft popup
- Only displays when quality data is available
- Clean integration with existing popup layout
- Shows alongside transponder information

**Data Quality Context:**
- NACp: Position accuracy (0-11, higher = more precise location)
- NACv: Velocity accuracy (0-4, higher = more precise speed/heading)
- SIL: Surveillance integrity (0-3, higher = more reliable data)

This gives users a quick understanding of data reliability without needing
to interpret technical NACp/NACv/SIL values directly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 19:31:46 +02:00
056c2b8346 Fix transponder capability overwriting aircraft type in popups
Add dedicated transponder fields to prevent Mode S decoder from overwriting
the aircraft Category field with transponder capability information.

**Problem Fixed:**
- DF11 All-Call Reply messages were setting aircraft.Category to "Enhanced Transponder"
- This overwrote the actual aircraft type (Light, Medium, Heavy, etc.) from ADS-B
- Users saw "Enhanced Transponder" instead of proper aircraft classification

**Solution:**
- Added dedicated TransponderCapability and TransponderLevel fields to Aircraft struct
- Updated JSON marshaling to include new transponder fields
- Modified decodeAllCallReply() to use dedicated fields instead of Category
- Enhanced popup display to show transponder info separately from aircraft type
- Removed Category overwriting in decodeCommD() for DF24 messages

**New Aircraft Fields:**
- TransponderCapability: Human-readable capability description
- TransponderLevel: Numeric capability level (0-7)

**Popup Display:**
- Aircraft type now shows correctly (Light, Medium, Heavy, etc.)
- Transponder capability displayed as separate "Transponder:" field when available
- Only shows transponder info when DF11 messages have been received

**Data Quality Indicators Clarification:**
- NACp: Navigation Accuracy Category - Position (0-11, higher = more accurate)
- NACv: Navigation Accuracy Category - Velocity (0-4, higher = more accurate)
- SIL: Surveillance Integrity Level (0-3, higher = more reliable)

Users now see both proper aircraft classification AND transponder capability
information without conflicts between different message types.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 19:28:12 +02:00
9242852c01 Implement aircraft position validation to fix obviously wrong trails
Add comprehensive position validation to filter out impossible aircraft
movements and improve trail accuracy as requested in issue #16.

**Position Validation Features:**
- Geographic coordinate bounds checking (lat: -90 to 90, lon: -180 to 180)
- Altitude validation (range: -500ft to 60,000ft)
- Speed validation (max: 2000 knots ≈ Mach 3)
- Distance jump validation (max: 500 nautical miles)
- Time consistency validation (reject out-of-order timestamps)
- Speed consistency warnings (reported vs. implied speed)

**Integration Points:**
- updateHistories(): Validates before adding to position history (trails)
- mergeAircraftData(): Validates before updating aircraft position state
- Comprehensive logging with ICAO identification for debugging

**Validation Logic:**
- Rejects obviously wrong positions that would create impossible flight paths
- Warns about high but possible speeds (>800 knots) for monitoring
- Maintains detailed logs: [POSITION_VALIDATION] ICAO ABCDEF: REJECTED/WARNING
- Performance optimized with early returns and minimal overhead

**Result:**
- Users see only realistic aircraft trails and movements
- Obviously wrong ADS-B data (teleporting, impossible speeds) filtered out
- Debug logs provide visibility into validation decisions
- Clean flight tracking without zigzag patterns or position jumps

Fixes #16

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 19:20:38 +02:00
ec7d9e02af Add repository link to header and fix Options menu positioning
- Add gear icon (⚙) repository link next to version in header
- Position Options menu below Night Mode button using absolute positioning
- Rename 'Display Options' to 'Options' for brevity
- Repository link points to https://kode.naiv.no/olemd/skyview
- Options menu now at top: 320px, right: 10px to appear below map controls

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 19:06:19 +02:00
ba052312f2 Format and lint codebase for consistency and quality
- Run go fmt on all Go code (server.go formatting cleanup)
- Fix shellcheck issues in build-deb.sh script:
  - Replace indirect exit code checks ($?) with direct command checks
  - Use 'if ! command' instead of 'if [ $? -ne 0 ]'
  - Use 'if command' instead of 'if [ $? -eq 0 ]'
- All quality checks now pass:
  - go fmt:  Code properly formatted
  - go vet:  No issues found
  - shellcheck:  All shell scripts validated
  - go test:  No test failures (no tests yet)

Follows project guidelines for shell script validation and code quality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 18:52:39 +02:00
721c1ca3a2 Remove build artifacts from repository and improve Debian package installation
- Remove debian/usr/bin/beast-dump from git tracking (build artifact)
- Add debian/usr/bin/* to .gitignore to prevent future binary commits
- Update postinst script for quiet installation:
  - Add --quiet flags to adduser/addgroup commands
  - Suppress output from directory creation and permission setting
  - Smart service handling: restart if enabled, leave disabled otherwise
  - Remove verbose installation messages
- Binaries are now built only during package creation, not stored in repo

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 18:46:37 +02:00
0d60592b9f Clean up codebase and fix server host binding for IPv6 support
Cleanup:
- Remove unused aircraft-icon.svg (replaced by type-specific icons)
- Remove test files: beast-dump-with-heli.bin, beast.test, main, old.json, ux.png
- Remove duplicate config.json.example (kept config.example.json)
- Remove empty internal/coverage/ directory
- Move CLAUDE.md to project root
- Update assets.go documentation to reflect current icon structure
- Format all Go code with gofmt

Server Host Binding Fix:
- Fix critical bug where server host configuration was ignored
- Add host parameter to Server struct and NewWebServer constructor
- Rename NewServer to NewWebServer for better clarity
- Fix IPv6 address formatting in server binding (wrap in brackets)
- Update startup message to show correct bind address format
- Support localhost-only, IPv4, IPv6, and interface-specific binding

This resolves the "too many colons in address" error for IPv6 hosts like ::1
and enables proper localhost-only deployment as configured.

Closes #15

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 18:36:14 +02:00
67d0e0612a Mark incomplete features as under construction and implement v0.0.2 release
- Mark incomplete statistics charts with construction notices
- Disable non-functional 3D radar controls
- Implement collapsible Display Options menu (defaults to collapsed)
- Add toast notifications for better error feedback
- Update version to 0.0.2 across all files and packages
- Improve Debian packaging with root-owner-group flag
- Update repository URLs to Forgejo instance
- Create comprehensive feature status documentation
- Created 10 detailed issues for all incomplete features (#5-#14)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 18:24:08 +02:00
064ba2de71 Clean up and optimize codebase for production readiness
Performance & Reliability Improvements:
- Increase WebSocket buffer sizes from 1KB to 8KB for better throughput
- Increase broadcast channel buffer from 100 to 1000 messages
- Increase Beast message channel buffer from 1000 to 5000 messages
- Increase connection timeout from 10s to 30s for remote receivers

Code Quality Improvements:
- Remove debug output from production code (CPR Debug, Merger Update spam)
- Add MaxDistance constant to replace magic number (999999)
- Clean up comments for better maintainability
- Implement auto-enable for selected aircraft trails

Benefits:
- Much cleaner server logs without debug spam
- Better performance under high aircraft density
- More reliable WebSocket connections with larger buffers
- Improved fault tolerance with increased timeouts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 17:54:17 +02:00
9389cb8823 Implement comprehensive ICAO country lookup with complete global coverage
- Fix country field marshaling in JSON output to display countries in web frontend
- Replace incomplete ICAO database with comprehensive allocation table from aerotransport.org
- Add all 120+ countries and territories with correct hex address ranges
- Fix aircraft legend label: change "Medium 34000-136000kg" to "Large 34000-136000kg"
- Ensure complete coverage for all allocated ICAO 24-bit addresses worldwide

Fixes:
- 3C64AE now correctly shows Germany 🇩🇪 (range 3C0000-3FFFFF)
- 4ACB58 now correctly shows Sweden 🇸🇪 (range 4A8000-4AFFFF)
- 04008D now correctly shows Ethiopia 🇪🇹 (range 040000-040FFF)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 17:27:28 +02:00
79f0509bea Update aircraft legend to show real ADS-B categories and implement pure Go ICAO country lookup
- Replace imaginary aircraft types (Commercial/Cargo/GA) with actual ADS-B emitter categories
- Add proper weight-based classifications: Light <7000kg, Medium 7000-34000kg, etc.
- Replace SQLite-based ICAO lookup with pure Go implementation using slice of allocations
- Remove SQLite dependency completely for simpler architecture
- Add comprehensive ICAO address allocations based on ICAO Document 8585
- Implement efficient linear search through sorted allocations by start address

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 16:59:20 +02:00
20bdcf54ec Move documentation to docs/ directory and improve terminology
- Move ARCHITECTURE.md and CLAUDE.md to docs/ directory
- Replace "real-time" terminology with accurate "low-latency" and "high-performance"
- Update README to reflect correct performance characteristics
- Add comprehensive ICAO country database with SQLite backend
- Fix display options positioning and functionality
- Add map scale controls and improved range ring visibility
- Enhance aircraft marker orientation and trail management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 16:24:46 +02:00
43e55b2ba0 Extract aircraft SVG icons to external files and add dynamic marker updates
- Extract all aircraft type SVG designs to separate files in /static/icons/
- Add icon caching system with async loading and fallback mechanisms
- Implement dynamic marker icon updates when aircraft properties change
- Detect and respond to aircraft type/category, ground status, and rotation changes
- Use currentColor in SVG files for dynamic color application
- Maintain performance with intelligent change detection (5° rotation threshold)
- Support real-time marker updates for weight class transitions and ADS-B changes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 15:29:43 +02:00
da4645d483 Implement server-side trail tracking and fix aircraft marker orientation
- Replace client-side trail collection with server-provided position history
- Fix aircraft markers to properly orient based on track heading using SVG rotation
- Add beast-dump binary to debian package with comprehensive man pages
- Trail visualization now uses gradient effect where newer positions are brighter
- Marker icons update when track heading changes by more than 5 degrees for performance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 15:18:51 +02:00
b527f5a8ee Switch to light map theme by default with dark mode toggle
Major improvements to map theming and aircraft type display:

Map Theme Changes:
- Changed default map from dark to light theme (CartoDB Positron)
- Added night mode toggle button with sun/moon icons
- Both main map and coverage map now switch themes together
- Light theme provides better daylight visibility

Aircraft Type Display:
- Now displays actual ADS-B category directly (e.g., "Medium 34000-136000kg")
- Removed guessing/interpretation of aircraft types
- Icons still use simplified categories for visual distinction
- More accurate and standards-compliant display

This provides a cleaner, more professional appearance with the light map
and gives users accurate ADS-B category information instead of interpreted types.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 15:09:54 +02:00
6437d8e8a3 Improve text visibility in aircraft popups
Enhanced popup text contrast and readability:
- Added text-shadow to all values for better contrast against dark background
- Properly handle zero/null values (e.g., Track: 0° now shows instead of N/A)
- Style N/A values with slightly dimmed gray (#aaaaaa) but still clearly visible
- Add 'no-data' class to distinguish missing data from actual zero values
- Ensure all text has strong white color with !important declarations

This fixes visibility issues where some values appeared too faint or were
incorrectly treated as missing when they were actually zero.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 15:03:33 +02:00
ae2d80f3c9 Fix white-on-white text visibility in aircraft popups
Override Leaflet's default popup styles with !important declarations to ensure
proper text visibility in aircraft information popups:
- Set dark background (#2d2d2d) for popup content wrapper and tip
- Force white text color (#ffffff) for all popup text elements
- Ensure labels remain muted gray (#888) for visual hierarchy
- Preserve accent colors for flight ID (blue) and callsign (green)

The issue was caused by Leaflet CSS overriding custom popup styling,
resulting in poor readability with white text on white backgrounds.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 15:00:11 +02:00
776cef1185 Clean up excessive console logging and remove duplicate app files
- Remove verbose console.log statements from WebSocket, map, and aircraft managers
- Keep essential error messages and warnings for debugging
- Consolidate app-new.js into app.js to eliminate confusing duplicate files
- Update HTML reference to use clean app.js with incremented cache version
- Significantly reduce console noise for better user experience

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 14:55:54 +02:00
e51af89d84 Enhance aircraft type detection with proper ADS-B categories and visual differentiation
Replace hardcoded ICAO matches with standards-compliant ADS-B category parsing:
- Implement RTCA DO-260B weight-based categories (Light/Medium/Heavy/Super)
- Add helicopter, military, cargo, and GA aircraft type detection
- Create distinct SVG icons for each aircraft type (helicopter with rotor disc, swept-wing military, wide-body cargo, etc.)
- Enhanced callsign-based fallback classification
- Remove hardcoded aircraft 478058 helicopter detection per user feedback
- Support proper ADS-B category strings like "Medium 34000-136000kg"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 14:53:24 +02:00
f364ffe061 Fix CPR zone ambiguity causing aircraft to appear 100km away from actual position
PROBLEM:
- Aircraft were appearing ~100km from receiver when actually ~5km away
- CPR (Compact Position Reporting) algorithm has zone ambiguity issue
- Without reference position, aircraft can appear in wrong 6-degree zones

SOLUTION:
- Add receiver reference position to CPR decoder for zone resolution
- Modified NewDecoder() to accept reference latitude/longitude parameters
- Implement distance-based zone selection (choose solution closest to receiver)
- Updated all decoder instantiations to pass receiver coordinates

TECHNICAL CHANGES:
- decoder.go: Add refLatitude/refLongitude fields and zone ambiguity resolution
- beast.go: Pass source coordinates to NewDecoder()
- beast-dump/main.go: Use default coordinates (0,0) for command-line tool
- merger.go: Add position update debugging for verification
- JavaScript: Add coordinate validation and update logging

RESULT:
- Aircraft now appear at correct distances from receiver
- CPR zone selection based on proximity to known receiver location
- Resolves fundamental ADS-B position accuracy issue

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 14:40:36 +02:00
1de3e092ae Fix aircraft markers not updating positions in real-time
Root cause: The merger was blocking position updates from the same source
after the first position was established, designed for multi-source scenarios
but preventing single-source position updates.

Changes:
- Refactor JavaScript into modular architecture (WebSocketManager, AircraftManager, MapManager, UIManager)
- Add CPR coordinate validation to prevent invalid latitude/longitude values
- Fix merger to allow position updates from same source for moving aircraft
- Add comprehensive coordinate bounds checking in CPR decoder
- Update HTML to use new modular JavaScript with cache busting
- Add WebSocket debug logging to track data flow

Technical details:
- CPR decoder now validates coordinates within ±90° latitude, ±180° longitude
- Merger allows updates when currentBest == sourceID (same source continuous updates)
- JavaScript modules provide better separation of concerns and debugging
- WebSocket properly transmits updated aircraft coordinates to frontend

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 14:04:17 +02:00
ddffe1428d Improve Beast decoder with proper data formatting and altitude decoding
Major improvements to Beast message decoding and data presentation:

Speed & Track Formatting:
- Convert ground speed from float to integer (knots)
- Convert track angle from float to integer (0-359 degrees)
- Add proper rounding for velocity calculations
- Fix surface movement speed calculations

Altitude Decoding Enhancement:
- Implement proper Q-bit handling in altitude decoding
- Add altitude validation (range: -1000 to 60000 feet)
- Fix standard altitude encoding with 25-foot increments
- Add legacy Gray code support for older transponders
- Remove duplicate altitude values caused by incorrect decoding

ICAO Address Display:
- Fix JavaScript hex conversion that caused display corruption
- Remove duplicate toString(16) calls on already-formatted hex strings
- Proper ICAO display format (6-character hex like "4ACA0C")

Data Type Consistency:
- Update Aircraft struct to use integers for GroundSpeed and Track
- Update SpeedPoint struct for consistent integer speed/track storage
- Maintain float64 precision internally while displaying clean integers

Signal Strength:
- Confirm signal strength extraction is working properly
- Signal levels properly flow from Beast parser through merger to frontend
- Display in dBFS format (e.g., -1.57 dBFS)

Results:
- Clean integer speed values (198 kt instead of 238.03361107205006 kt)
- Proper track angles (41° instead of 37.83276127148023°)
- Realistic varying altitudes (1750-1825 ft instead of repeated 24450 ft)
- Correct ICAO formatting (4ACA0C instead of corrupted 103A)
- Working signal strength display (-0.98 to -2.16 dBFS)

The Beast decoder now produces accurate, properly formatted aircraft data
that displays cleanly in the web interface without data corruption.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-24 10:47:38 +02:00