* add ADSB areas to GPS map#2569
Conversation
101344e to
ce1c791
Compare
b118ba2 to
f870324
Compare
f870324 to
49de051
Compare
a7cf4ea to
1bf80b2
Compare
Review Summary by QodoAdd ADSB warning system and vehicle table to GPS map
WalkthroughsDescription• Add ADSB warning/alert system with distance-based circular zones • Implement ADSB vehicle table displaying all tracked aircraft details • Expand GPS map to full screen with improved layout and styling • Add MSP protocol support for ADSB limits and warning vehicle data • Color-code ADSB table rows for alert/warning/normal/stale states Diagramflowchart LR
A["MSP Protocol<br/>New Codes"] -->|MSP2_ADSB_LIMITS| B["ADSB Limits<br/>Distance Config"]
A -->|MSP2_ADSB_WARNING_VEHICLE_ICAO| C["Warning Vehicle<br/>ICAO Data"]
B --> D["GPS Map<br/>Alert/Warning Circles"]
C --> E["ADSB Vehicle Table<br/>Color-coded Rows"]
D --> F["Enhanced GPS Tab<br/>Full Screen Display"]
E --> F
File Changes1. js/fc.js
|
Code Review by Qodo
|
| [ | ||
| i18n.getMessage('adsbCallsign'), | ||
| 'ICAO', | ||
| i18n.getMessage('gpsLat'), | ||
| i18n.getMessage('gpsLon'), | ||
| i18n.getMessage('adsbAlt'), | ||
| i18n.getMessage('adsbHeading'), | ||
| 'TSLC', | ||
| 'TTL', | ||
| i18n.getMessage('adsbEmitter') | ||
| ].forEach(function(col) { | ||
| $headerRow.append($('<th>').addClass('adsb-table__header').text(col)); | ||
| }); | ||
| $thead.append($headerRow); | ||
| $table.append($thead); | ||
| $table.append($('<tbody>').addClass('adsb-table__body')); | ||
|
|
||
| var $wrapper = $('<div>').addClass('adsb-table__wrapper').append($table); | ||
| $('.adsbVehicleList').empty().append($wrapper); | ||
| } | ||
|
|
||
| var $tbody = $('.adsb-table__body'); | ||
|
|
||
| if (FC.ADSB_VEHICLES.vehicles.length === 0) { | ||
| $tbody.empty(); | ||
| $tbody.append( | ||
| $('<tr>').append( | ||
| $('<td>').attr('colspan', 9).addClass('adsb-table__empty').text('No vehicles') | ||
| ) |
There was a problem hiding this comment.
1. icao/tslc headers hardcoded 📘 Rule violation ⚙ Maintainability
The ADSB vehicle table UI introduces multiple user-facing strings as hardcoded literals (e.g., ICAO, TSLC, TTL, No vehicles, —, unit suffixes), bypassing i18next translation keys. This breaks internationalization coverage and violates the project requirement to avoid hardcoded UI text.
Agent Prompt
## Issue description
The ADSB list table renders user-facing strings as hardcoded literals (e.g., `ICAO`, `TSLC`, `TTL`, `No vehicles`, `—`, and unit suffixes like `m`, `°`, `s`) instead of using i18next translation keys.
## Issue Context
Per i18n compliance requirements, all UI-visible text must be localizable via i18next (commonly `data-i18n` in HTML or `i18n.getMessage()` in JS for dynamically created elements).
## Fix Focus Areas
- tabs/gps.js[142-170]
- locale/en/messages.json[6201-6236]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Resolve conflict in tabs/gps.js: apply tab-modules rename (TABS.gps → gpsTab) to the PR's improved i18n tooltip content and ADSB table code.
|
Resolved the merge conflict with `maintenance-10.x` and pushed directly to this branch (thanks for having maintainer edit enabled). What was conflicting: `tabs/gps.js` had one conflict zone — the tab-modules refactor (PR #2458) renamed `TABS.gps` → `gpsTab` in the same area where this PR improved the ADSB tooltip content with i18n keys. Resolution: Applied the `gpsTab` rename to the PR's improved tooltip content so both sets of changes are preserved. All other files auto-merged cleanly. This branch should now be conflict-free against `maintenance-10.x`. |
|
Looking at the Sonarqube items, the following might be worth considering. I haven't analyzed it closely because you know the code better than I do, but perhaps worth looking at: Issue 4 — Stale warning ICAO when vehicles disappear: When vehiclesCount drops to 0, get_adsb_warning() skips the MSP fetch and calls update_adsb_ui() directly. But update_adsb_ui() gates on vehiclePacketCount > ADSB_VEHICLE_TYPE[emitterType] unguarded: LOW RISK The table covers 0–19; ADSB types 20–23 exist in the spec but are reserved/unassigned. An out-of-range value would throw TypeError inside the vehicle |
|
Thank you very much for checking. Issue 4 is valid. I will look at that. I will fix "ADSB_VEHICLE_TYPE[emitterType] unguarded: LOW RISK" as well, it would be nice to add guard there. |
fix ADSB_VEHICLE_TYPE[emitterType] unguarded: LOW RISK
|



#PR related to iNavFlight/inav#11346
New: