Skip to content

Terrain - dedicated OSD element - #2728

Merged
sensei-hacker merged 5 commits into
iNavFlight:maintenance-10.xfrom
error414:error414/feature/terrain_new_osd
Sep 5, 2026
Merged

Terrain - dedicated OSD element#2728
sensei-hacker merged 5 commits into
iNavFlight:maintenance-10.xfrom
error414:error414/feature/terrain_new_osd

Conversation

@error414

Copy link
Copy Markdown
Contributor

This PR is not mandatory for terrain functionality.

INAV FW PR: iNavFlight/inav#11846

Dedicated OSD element was requested by Jetrel. Originally is terrain value showed in "distance" OSD element, it shared with real ranger finder. New OSD element is special only for AGL from terrain.

image image

@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@github-actions

Copy link
Copy Markdown

Branch Targeting Suggestion

You've targeted the master branch with this PR. Please consider if a version branch might be more appropriate:

  • maintenance-9.x - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.

  • maintenance-10.x - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x

If master is the correct target for this change because it should never be included in any release, no action is needed.


This is an automated suggestion to help route contributions to the appropriate branch.

@error414
error414 changed the base branch from master to maintenance-10.x August 31, 2026 15:37
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add dedicated terrain AGL OSD and maintenance features

✨ Enhancement 🐞 Bug fix 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Adds a terrain-only AGL OSD element, symbol, preview, and localization.
• Synchronizes broad maintenance features across mapping, DroneCAN, mixers, GPS, and telemetry.
• Adds regression coverage for output mapping, CLI polling, DroneCAN, LTM, and mixers.
Diagram

graph TD
  FW["INAV Firmware"] -->|MSP data| MSP["MSP Layer"] --> State["FC State"] --> Tabs["Configurator Tabs"]
  Tabs --> OSD["OSD Preview"]
  Tabs --> Maps["Map Tools"] --> Storage[("SD or ZIP")]
  Tabs --> Devices["DroneCAN Devices"]
  subgraph Legend
    direction LR
    _module["Module"] ~~~ _store[("Storage")]
  end
Loading
High-Level Assessment

A dedicated terrain AGL element is preferable to overloading the rangefinder element because both values can coexist and have different semantics. Capability-gating it through the firmware terrain setting preserves compatibility; reusing the rangefinder display was considered but would remain ambiguous.

Files changed (78) +16838 / -418

Enhancement (40) +5998 / -244
index.htmlRegister Map Generator and DroneCAN navigation entries +8/-1

Register Map Generator and DroneCAN navigation entries

• Adds disconnected Map Generator and connected DroneCAN tab links.

index.html

configurator_main.jsLoad Map Generator and DroneCAN tabs +10/-3

Load Map Generator and DroneCAN tabs

• Registers both tabs, supports the shared tab registry, and avoids invalid CLI exit handling.

js/configurator_main.js

fc.jsExtend controller state for ADS-B, DroneCAN, and auto speed +25/-11

Extend controller state for ADS-B, DroneCAN, and auto speed

• Adds ADS-B limits and warning state, DroneCAN node/request state, and the Auto Speed PID name.

js/fc.js

flightModes.jsRegister Auto Speed flight mode +5/-0

Register Auto Speed flight mode

• Adds the firmware Auto Speed box and permanent identifiers.

js/flightModes.js

gui.jsExpose new tabs and shared tab registry +5/-0

Expose new tabs and shared tab registry

• Allows Map Generator and DroneCAN tabs and exports a registry for lazy-loaded tabs.

js/gui.js

logicConditionOperators.jsAdd inverse trig, altitude, auto-speed, and PINIO operators +34/-4

Add inverse trig, altitude, auto-speed, and PINIO operators

• Registers new firmware logic operators and updates operation 52 to two-operand PWM-on-pin semantics.

js/logicConditionOperators.js

main.jsSupport map requests and SD filesystem operations +48/-2

Support map requests and SD filesystem operations

• Adds OSM request headers, recursive file operations, path checks, and platform-specific drive ejection IPC.

js/main/main.js

preload.jsExpose path and drive IPC methods +2/-0

Expose path and drive IPC methods

• Adds renderer-safe APIs for path existence checks and SD-card ejection.

js/main/preload.js

MSPCodes.jsAdd output, DroneCAN, and ADS-B MSP codes +8/-0

Add output, DroneCAN, and ADS-B MSP codes

• Registers direct output assignment, DroneCAN async service, and ADS-B warning/limit commands.

js/msp/MSPCodes.js

MSPHelper.jsDecode new output, DroneCAN, and ADS-B payloads +174/-1

Decode new output, DroneCAN, and ADS-B payloads

• Adds protocol decoding and loaders for direct assignments, ADS-B data, and typed DroneCAN async results.

js/msp/MSPHelper.js

serialPortHelper.jsAdd locked CRSF sensor serial function +8/-0

Add locked CRSF sensor serial function

• Registers the unique CRSF_SENSOR function at its required 420000 baud rate.

js/serialPortHelper.js

helpers.jsExpose inverse trigonometry through transpiler helpers +46/-17

Expose inverse trigonometry through transpiler helpers

• Uses shared operation constants and adds acos, asin, and atan2 helper definitions.

js/transpiler/api/definitions/helpers.js

types.jsType inverse trigonometry helpers +3/-0

Type inverse trigonometry helpers

• Declares acos, asin, and atan2 in the INAV JavaScript API.

js/transpiler/api/types.js

diagnostics.jsAccept supported inverse trig calls +3/-3

Accept supported inverse trig calls

• Removes acos, asin, and atan2 from unsupported Math diagnostics.

js/transpiler/editor/diagnostics.js

codegen.jsCompile PWM-on-pin actions +9/-0

Compile PWM-on-pin actions

• Generates PINIO PWM logic commands with duty in operand A and pin in operand B.

js/transpiler/transpiler/codegen.js

expression_generator.jsCompile inverse trigonometric expressions +26/-3

Compile inverse trigonometric expressions

• Generates logic conditions for Math.acos, Math.asin, and Math.atan2 with argument validation.

js/transpiler/transpiler/expression_generator.js

parser.jsParse pwmOnPin override calls +16/-0

Parse pwmOnPin override calls

• Transforms pwmOnPin calls, including calls inside conditional bodies, into PINIO PWM actions.

js/transpiler/transpiler/parser.js

main.cssStyle DroneCAN navigation icon and tab +13/-1

Style DroneCAN navigation icon and tab

• Adds DroneCAN icon states and includes the tab in full-height layout rules.

src/css/main.css

dronecan.cssStyle DroneCAN node and parameter interfaces +135/-0

Style DroneCAN node and parameter interfaces

• Adds tables, health badges, parameter controls, action buttons, and accessible hidden labels.

src/css/tabs/dronecan.css

gps.cssStyle DroneCAN GPS and ADS-B diagnostics +55/-6

Style DroneCAN GPS and ADS-B diagnostics

• Adds DroneCAN GPS guidance plus responsive ADS-B vehicle, warning, alert, and stale states.

src/css/tabs/gps.css

map_generator.cssStyle the Map Generator workspace +686/-0

Style the Map Generator workspace

• Defines the map/sidebar layout, controls, warnings, caches, terrain grid, modal progress, and Leaflet overrides.

src/css/tabs/map_generator.css

mission_planer.cssAdd survey-grid toolbar icon +4/-0

Add survey-grid toolbar icon

• Styles the new mission grid generator action.

src/css/tabs/mission_planer.css

advanced_tuning.htmlAdd manual launch and Auto Speed settings +42/-0

Add manual launch and Auto Speed settings

• Exposes manual-throttle launch and fixed-wing Auto Speed limits, channel, smoothing, and minimum throttle.

tabs/advanced_tuning.html

auxiliary.jsCategorize Auto Speed and Multi Function modes +2/-2

Categorize Auto Speed and Multi Function modes

• Adds the new modes to their appropriate fixed-wing and miscellaneous sections.

tabs/auxiliary.js

configuration.htmlExpose INA226 sensor settings +24/-3

Expose INA226 sensor settings

• Adds I2C bus, address, and shunt resistance controls while separating INA226 and ADC fields.

tabs/configuration.html

configuration.jsToggle INA226-specific configuration +20/-1

Toggle INA226-specific configuration

• Uses firmware setting metadata to display only controls relevant to selected voltage and current meters.

tabs/configuration.js

dronecan.htmlAdd DroneCAN management interface +78/-0

Add DroneCAN management interface

• Provides bus configuration, node discovery, detail, parameter, save, and restart UI areas.

tabs/dronecan.html

dronecan.jsImplement DroneCAN node and parameter management +484/-0

Implement DroneCAN node and parameter management

• Adds node polling, typed parameter reads/writes, validation, EEPROM actions, rebooting, and shared-slot retry handling.

tabs/dronecan.js

gps.htmlExpand GPS and ADS-B panels +21/-6

Expand GPS and ADS-B panels

• Moves GPS protocol selection, adds DroneCAN guidance, and introduces ADS-B warning and vehicle list sections.

tabs/gps.html

gps.jsAdd firmware-driven GPS and ADS-B diagnostics +208/-21

Add firmware-driven GPS and ADS-B diagnostics

• Loads live GPS provider choices and renders ADS-B vehicles, alerts, warning radii, and robust emitter types.

tabs/gps.js

map_generator.htmlAdd Map Generator tab interface +210/-0

Add Map Generator tab interface

• Defines controls for terrain and radio targets, providers, selection, caching, SD sync, ZIP export, and progress.

tabs/map_generator.html

map_generator.jsImplement terrain and radio map generation +2573/-0

Implement terrain and radio map generation

• Generates INAV terrain DAT files from Copernicus or SRTM, exports radio tiles, caches downloads, and syncs SD or ZIP output.

tabs/map_generator.js

mission_control.htmlAdd accessible survey-grid mission controls +51/-2

Add accessible survey-grid mission controls

• Adds labels for map actions and a configurable grid survey panel.

tabs/mission_control.html

mission_control.jsGenerate survey missions and improve waypoint editing +790/-95

Generate survey missions and improve waypoint editing

• Adds polygon sweep generation, previews, RTH/heading markers, keyboard navigation, insertion hints, and safer deletion flows.

tabs/mission_control.js

mixer.htmlIntegrate timer controls and servo warnings +8/-7

Integrate timer controls and servo warnings

• Moves timer mode controls into the output table and adds content for invalid servo target warnings.

tabs/mixer.html

onboard_logging.htmlSupport terrain-aware logging status +28/-21

Support terrain-aware logging status

• Adds a high-rate terrain warning and makes SD-card status available for terrain-only logging.

tabs/onboard_logging.html

onboard_logging.jsWarn about high logging rates with terrain enabled +35/-10

Warn about high logging rates with terrain enabled

• Loads terrain_enabled before rendering and warns when the selected Blackbox rate exceeds 25 percent.

tabs/onboard_logging.js

osd.htmlExpose OSD refresh-rate setting +5/-0

Expose OSD refresh-rate setting

• Adds a firmware-backed OSD framerate selector and help text.

tabs/osd.html

osd.jsAdd dedicated terrain AGL OSD element +70/-6

Add dedicated terrain AGL OSD element

• Adds terrain capability detection, symbol and unit-aware preview for element 171, alongside synced Auto Speed and GPS diagnostics elements.

tabs/osd.js

pid_tuning.htmlAdd Auto Speed PID row +26/-18

Add Auto Speed PID row

• Adds the twelfth PID bank row for speed control and normalizes surrounding markup.

tabs/pid_tuning.html

Bug fix (17) +561 / -168
dronecanAsyncRequestParse.jsParse DroneCAN async request responses safely +19/-0

Parse DroneCAN async request responses safely

• Returns fresh status and sequence objects for full, short, or empty responses to prevent stale request state.

js/dronecanAsyncRequestParse.js

dronecanAsyncRetry.jsDefine DroneCAN busy retry behavior +13/-0

Define DroneCAN busy retry behavior

• Adds async request status constants and bounded BUSY retry logic.

js/dronecanAsyncRetry.js

dronecanNodeIdValidation.jsValidate DroneCAN node identifiers +9/-0

Validate DroneCAN node identifiers

• Restricts node IDs to integer values from 1 through 127 before configuration is saved.

js/dronecanNodeIdValidation.js

dronecanParamValidation.jsValidate DroneCAN numeric parameter ranges +21/-0

Validate DroneCAN numeric parameter ranges

• Rejects out-of-range int64 values and non-finite float values before encoding.

js/dronecanParamValidation.js

groundstation.jsGuard ground-station telemetry formatting +9/-5

Guard ground-station telemetry formatting

• Displays placeholders instead of malformed values when LTM telemetry fields are unavailable.

js/groundstation.js

ltmDecoder.jsReset LTM telemetry between connections +45/-30

Reset LTM telemetry between connections

• Centralizes telemetry initialization and clears parser and telemetry state on reset.

js/ltmDecoder.js

ltmProtocolGate.jsGate LTM decoding after MSP detection +41/-0

Gate LTM decoding after MSP detection

• Prevents MSP payloads from being misidentified as LTM and activating Ground Station mode.

js/ltmProtocolGate.js

msp.jsPrevent MSP polling from entering CLI streams +13/-2

Prevent MSP polling from entering CLI streams

• Stops initial and retried queue insertion while CLI mode is active and resets receive timestamps on disconnect.

js/msp.js

outputMapping.jsAlign output assignment with firmware behavior +178/-39

Align output assignment with firmware behavior

• Adds firmware-reported assignments, PINIO and beeper handling, dedicated-timer priority, and corrected motor numbering.

js/outputMapping.js

serial_backend.jsIsolate LTM fallback and expand PID state +43/-25

Isolate LTM fallback and expand PID state

• Routes LTM through the protocol gate, resets it across sessions, and allocates the Auto Speed PID bank.

js/serial_backend.js

servoMixerTargetWarning.jsDetect invalid servo mixer targets +14/-0

Detect invalid servo mixer targets

• Returns warning details when a rule targets a servo beyond the number of configured rules.

js/servoMixerTargetWarning.js

action_decompiler.jsDecompile PWM-on-pin actions +6/-6

Decompile PWM-on-pin actions

• Emits pwmOnPin(duty, pin) with firmware-compatible operand ordering.

js/transpiler/transpiler/action_decompiler.js

wizard_ui_bindings.jsLoad GPS providers from firmware settings +12/-5

Load GPS providers from firmware settings

• Replaces the hardcoded protocol list with the connected firmware's gps_provider table.

js/wizard_ui_bindings.js

onboard_logging.cssShow SD status for terrain-only logging +8/-2

Show SD status for terrain-only logging

• Allows SD-card information when terrain logging is available without Blackbox support.

src/css/tabs/onboard_logging.css

cli.jsClose CLI initialization polling race +8/-6

Close CLI initialization polling race

• Marks CLI active before queue flushing and suppresses autocomplete cache output from the prompt.

tabs/cli.js

mixer.jsUse firmware-authoritative output assignments +116/-45

Use firmware-authoritative output assignments

• Renders timer groups, PINIO/beeper modes, direct assignments, fallback previews, and invalid servo target warnings.

tabs/mixer.js

ports.jsApply and lock serial function baud rates +6/-3

Apply and lock serial function baud rates

• Initializes default baud selections, propagates uniqueness changes, and disables baud controls for locked functions.

tabs/ports.js

Refactor (1) +1 / -1
decompiler.jsRecognize PINIO PWM actions +1/-1

Recognize PINIO PWM actions

• Updates action operation recognition from legacy LED PWM naming to PINIO PWM.

js/transpiler/transpiler/decompiler.js

Tests (11) +2453 / -0
outputMapping.test.mjsCover firmware-compatible output assignment +1002/-0

Cover firmware-compatible output assignment

• Adds extensive cases for timer priority, numbering, overflow, LED, beeper, PINIO, and output counts.

js/tests/outputMapping.test.mjs

pinio_pwm.test.cjsTest PINIO PWM transpiler round trips +187/-0

Test PINIO PWM transpiler round trips

• Covers compilation, decompilation, and round trips for LED and USER pins.

js/transpiler/transpiler/tests/pinio_pwm.test.cjs

run_pinio_pwm_tests.cjsAdd PINIO PWM test runner +18/-0

Add PINIO PWM test runner

• Loads the ESM decompiler and executes the dedicated PINIO PWM suite.

js/transpiler/transpiler/tests/run_pinio_pwm_tests.cjs

test_dronecan_async_result.mjsTest DroneCAN async result decoding +344/-0

Test DroneCAN async result decoding

• Covers state prefixes, node information, typed parameters, large integers, and sequence preservation.

test_dronecan_async_result.mjs

cli-tab-msp-polling.test.mjsTest CLI polling race prevention +572/-0

Test CLI polling race prevention

• Executes adapted production modules to verify status polling and enqueue retries cannot leak into active CLI streams.

tests/cli-tab-msp-polling.test.mjs

dronecan-async-busy-retry.test.mjsTest DroneCAN BUSY retry limits +35/-0

Test DroneCAN BUSY retry limits

• Verifies retries occur only for BUSY responses while attempts remain.

tests/dronecan-async-busy-retry.test.mjs

dronecan-async-request-parse.test.mjsTest fresh DroneCAN request parsing +44/-0

Test fresh DroneCAN request parsing

• Covers full, short, empty, and sequential responses to prevent stale status or sequence values.

tests/dronecan-async-request-parse.test.mjs

dronecan-node-id-validation.test.mjsTest DroneCAN node ID validation +31/-0

Test DroneCAN node ID validation

• Covers valid bounds, invalid ranges, non-integers, NaN, and infinity.

tests/dronecan-node-id-validation.test.mjs

dronecan-param-value-validation.test.mjsTest DroneCAN numeric parameter validation +45/-0

Test DroneCAN numeric parameter validation

• Covers int64 boundaries and rejection of invalid or non-finite numeric values.

tests/dronecan-param-value-validation.test.mjs

ltm-decoder.test.mjsTest LTM reset and MSP protocol gating +84/-0

Test LTM reset and MSP protocol gating

• Verifies connection resets clear telemetry and valid MSP traffic blocks LTM-shaped payloads.

tests/ltm-decoder.test.mjs

servo-mixer-target-validation.test.mjsTest servo target warning rules +91/-0

Test servo target warning rules

• Covers valid targets, excess targets, unused rules, duplicates, added rules, and target zero.

tests/servo-mixer-target-validation.test.mjs

Documentation (5) +7804 / -0
AGENTS.mdDocument repository architecture and contributor guidance +216/-0

Document repository architecture and contributor guidance

• Adds an AI-agent-oriented project guide covering architecture, workflows, testing, conventions, and MSP safety patterns.

AGENTS.md

README.mdDocument map and terrain generation workflows +156/-0

Document map and terrain generation workflows

• Adds user documentation for terrain DAT generation, radio map tiles, providers, caching, SD sync, and attribution requirements.

README.md

msp-async-data-access.mdDocument safe asynchronous MSP data access +105/-0

Document safe asynchronous MSP data access

• Explains MSP race conditions and callback sequencing, with OSD examples and an audit checklist.

docs/development/patterns/msp-async-data-access.md

messages.jsonLocalize new maintenance features +376/-0

Localize new maintenance features

• Adds English strings for terrain AGL, mapping, DroneCAN, ADS-B, auto speed, survey grids, logging, and related controls.

locale/en/messages.json

messages.jsonAdd complete Italian translation catalog +6951/-0

Add complete Italian translation catalog

• Introduces an Italian localization catalog covering the configurator interface and new maintenance features.

locale/it/messages.json

Other (4) +21 / -5
localization.jsEnable Italian localization +1/-1

Enable Italian localization

• Adds Italian to the selectable language list.

js/localization.js

inav_constants.jsSynchronize new firmware logic operation constants +10/-2

Synchronize new firmware logic operation constants

• Adds altitude target and inverse trig operations while renaming LED_PIN_PWM to PINIO_PWM.

js/transpiler/transpiler/inav_constants.js

package.jsonAdd map and terrain processing dependencies +7/-2

Add map and terrain processing dependencies

• Adds GeoTIFF, JSZip, Leaflet, drawing, and geocoder packages.

package.json

styles.cssImport Map Generator and DroneCAN styles +3/-0

Import Map Generator and DroneCAN styles

• Registers the new tab-specific stylesheets.

src/css/styles.css

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 31, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (6) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Terrain element initialization race ✓ Resolved 🐞 Bug ≡ Correctness
Description
HARDWARE.update() invokes its completion callback without waiting for terrain_enabled, so OSD
item generation can evaluate OSD_TERRAIN_AGL.enabled() while useTerrain is still false. The
dedicated terrain element is then omitted from the tab until a later reinitialization.
Code

tabs/osd.js[R3639-3641]

+        mspHelper.getSetting("terrain_enabled").then(function(data) {
+            HARDWARE.capabilities.useTerrain = Boolean(data && data.value);
+        })
Evidence
The new element is filtered by useTerrain, which starts false. The setting promise is launched
alongside the RX/sensor request chain, but only the sensor chain controls the callback that proceeds
to build the OSD UI.

tabs/osd.js[1388-1392]
tabs/osd.js[3594-3604]
tabs/osd.js[3624-3643]
tabs/osd.js[3661-3664]
tabs/osd.js[2441-2452]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The OSD initialization callback can run before `terrain_enabled` has populated `HARDWARE.capabilities.useTerrain`, hiding the terrain OSD element.
## Issue Context
Include the terrain setting request in `HARDWARE.update()`'s completion chain, with a safe fallback when the setting cannot be read.
## Fix Focus Areas
- tabs/osd.js[3639-3643]
- tabs/osd.js[3661-3663]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Inverse trig decompiles incorrectly 🐞 Bug ≡ Correctness
Description
Math.acos, Math.asin, and Math.atan2 compile to operations 58–60, but the condition decompiler
does not handle those operations. Decompiling such logic emits a warning and substitutes true,
silently changing the program's behavior.
Code

js/transpiler/transpiler/expression_generator.js[R248-250]

+      const arg = this.getOperand(this.arrowHelper.extractIdentifier(expr.arguments[0]) || expr.arguments[0], activatorId);
+      const operation = mathMethod === 'acos' ? OPERATION.ACOS : OPERATION.ASIN;
+      return { type: OPERAND_TYPE.LC, value: this.pushLogicCommand(operation, arg, { type: OPERAND_TYPE.VALUE, value: 0 }, activatorId) };
Evidence
The generator emits the three newly defined operation IDs, while the decompiler switch handles only
SIN/COS/TAN and maps every unknown operation to the literal true.

js/transpiler/transpiler/expression_generator.js[243-262]
js/transpiler/transpiler/inav_constants.js[89-91]
js/transpiler/transpiler/condition_decompiler.js[101-107]
js/transpiler/transpiler/condition_decompiler.js[123-131]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New inverse-trigonometric expressions compile successfully but cannot round-trip through the decompiler and become `true`.
## Issue Context
Add decompiler handling for ACOS, ASIN, and ATAN2 with the same operand ordering used by the expression generator.
## Fix Focus Areas
- js/transpiler/transpiler/expression_generator.js[243-262]
- js/transpiler/transpiler/condition_decompiler.js[101-131]
- js/transpiler/transpiler/inav_constants.js[89-91]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Logging tab stalls on failure 🐞 Bug ☼ Reliability
Description
load_terrain_setting() sends MSP2_BLACKBOX_CONFIG only from a fulfillment handler and has no
rejection fallback. If either setting request rejects, load_html() is never reached and the
Onboard Logging tab remains unloaded.
Code

tabs/onboard_logging.js[R54-55]

+    function load_terrain_setting() {
+        mspHelper.getSetting("terrain_enabled").then(function(data) {
Evidence
The prior direct Blackbox request was replaced by an optional setting lookup, but the Blackbox
request now exists only after successful promise fulfillment. getSetting() performs MSP promises
that can reject.

tabs/onboard_logging.js[46-64]
js/msp/MSPHelper.js[3499-3509]
js/msp/MSPHelper.js[3569-3579]
tabs/onboard_logging.js[91-94]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A rejected `terrain_enabled` lookup prevents the Onboard Logging tab from loading.
## Issue Context
Terrain warning support is optional and must not become a prerequisite for the existing Blackbox UI. Continue with `MSP2_BLACKBOX_CONFIG` on both fulfillment and rejection.
## Fix Focus Areas
- tabs/onboard_logging.js[54-64]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Grid handlers accumulate 🐞 Bug ☼ Reliability
Description
Mission Control registers the new grid actions as delegated document handlers on every
initialization but never removes them during cleanup. Revisiting the tab therefore makes one click
or input event invoke multiple stale and current grid closures, causing duplicate draw interactions,
previews, or generation attempts.
Code

tabs/mission_control.js[R4271-4274]

+        $(document).on('click', '#gridPatternButton, #gridPattern', function (e) {
+            e.preventDefault();
+            e.stopPropagation();
+            startGridPolygonDraw();
Evidence
The click and input handlers are attached to the persistent document object without namespaces or
matching off() calls. In contrast, the keyboard handler explicitly replaces its namespaced
predecessor, and cleanup currently only destroys the elevation chart.

tabs/mission_control.js[4271-4274]
tabs/mission_control.js[4440-4453]
tabs/mission_control.js[4621-4623]
tabs/mission_control.js[5577-5583]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Grid event handlers survive Mission Control cleanup and are duplicated every time the tab is initialized.
## Issue Context
Namespace delegated document handlers and remove them before rebinding and/or in the tab cleanup path. Also cancel any active grid interaction during cleanup.
## Fix Focus Areas
- tabs/mission_control.js[4271-4274]
- tabs/mission_control.js[4440-4453]
- tabs/mission_control.js[5577-5583]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Non-Windows SD eject broken 🐞 Bug ≡ Correctness
Description
The renderer accepts only a Windows drive-letter path before calling ejectDrive, although the
selected directory is an OS-native path. Normal macOS and Linux paths are rejected outright;
moreover, the Linux main-process branch could only receive a single letter rather than the
block-device path it passes to udisksctl -b.
Code

tabs/map_generator.js[R1598-1601]

+            // Extract drive letter from path (e.g. "D:\..." → "D")
+            const driveLetter = sdPath.match(/^([a-zA-Z]):/);
+            if (!driveLetter) {
+                $('#mapgen_status').text('Cannot determine drive letter from SD path.');
Evidence
The directory picker stores native filesystem paths, but the eject click handler returns unless the
path starts with X:. The IPC handler further sanitizes its argument to one letter and supplies
that letter to both diskutil and udisksctl.

tabs/map_generator.js[1584-1604]
js/main/main.js[476-495]
js/main/preload.js[77-78]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
SD eject cannot operate on macOS or Linux because the renderer requires a Windows drive letter and the IPC contract strips all device-path information.
## Issue Context
Resolve the selected mount path to the correct platform-native volume/device identifier in the trusted main process, then invoke each platform's eject command with that identifier. Do not clear the saved link when eject fails.
## Fix Focus Areas
- tabs/map_generator.js[1584-1615]
- js/main/main.js[476-495]
- js/main/preload.js[77-78]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (2)
6. DroneCAN UTF-8 text corrupted 🐞 Bug ≡ Correctness
Description
DroneCAN node names and string parameter values are decoded by treating each UTF-8 byte as a Unicode
code point. Any non-ASCII text is therefore mojibake in the node and parameter UIs, for example
café displays as café.
Code

js/msp/MSPHelper.js[R1619-1622]

+                            const name_len = data.getUint8(offset++);
+                            result.name = String.fromCodePoint(
+                                ...new Uint8Array(data.buffer, data.byteOffset + offset, name_len));
+                            offset += name_len;
Evidence
Both decoding paths use String.fromCodePoint(...bytes), which does not perform UTF-8 decoding.
Their results are then directly stored and rendered by the DroneCAN tab.

js/msp/MSPHelper.js[1619-1622]
js/msp/MSPHelper.js[1655-1659]
tabs/dronecan.js[118-127]
tabs/dronecan.js[243-246]
tabs/dronecan.js[394-395]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
DroneCAN text decoding treats encoded bytes as independent characters and corrupts non-ASCII names and values.
## Issue Context
Use a UTF-8 `TextDecoder` over the bounded byte arrays for both node names and string parameter values, while retaining malformed/truncated response handling.
## Fix Focus Areas
- js/msp/MSPHelper.js[1619-1622]
- js/msp/MSPHelper.js[1655-1659]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. PINIO mode preview ignored 🐞 Bug ≡ Correctness
Description
The mixer exposes timer mode PINIO / PWM, but the JavaScript fallback mapper has no branch that
interprets this override and instead allows the timer's pads to be assigned as motors, servos, LED,
or beeper. After direct assignments are invalidated by local mixer edits, the output preview can
therefore contradict the selected PINIO mode.
Code

js/outputMapping.js[R215-218]

+                // Pass 1: skip dedicated overrides — they were handled (or intentionally skipped) in Pass 0
+                if (!isDedicated && (mode === self.TIMER_OUTPUT_MODE_MOTORS || mode === self.TIMER_OUTPUT_MODE_SERVOS)) {
+                    continue;
+                }
Evidence
PINIO is a new selectable override value, but preassignment recognizes PINIO only from static
special labels. The two priority passes special-case only MOTORS and SERVOS, so mode 4 falls through
the automatic assignment conditions; mixer edits explicitly invalidate firmware direct assignments
and use this fallback table.

tabs/mixer.js[108-116]
js/outputMapping.js[42-47]
js/outputMapping.js[173-178]
js/outputMapping.js[203-232]
tabs/mixer.js[173-175]
tabs/mixer.js[880-885]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The fallback output mapper ignores the selectable PINIO timer override and displays unrelated assignments.
## Issue Context
Give PINIO dedicated override semantics in `getTimerMap()` consistent with firmware, including pads that do not already carry a PINIO special label, and add fallback-path tests.
## Fix Focus Areas
- js/outputMapping.js[173-232]
- tabs/mixer.js[108-116]
- tabs/mixer.js[173-175]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more'

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread tabs/osd.js Outdated
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

Configurator test build ready — commit fd2b69f

Download build artifacts for PR #2728

Available platforms (scroll to the Artifacts section at the bottom of the run page):

  • Windows x64 (ZIP, MSI) and x32 (ZIP, MSI)
  • macOS arm64 (ZIP, DMG) and x64 (ZIP, DMG)
  • Linux x64 (DEB, RPM, ZIP) and aarch64 (DEB, RPM, ZIP)

A GitHub login is required to download artifacts. Build is for testing only.

@Jetrell Jetrell added this to the 10.0 milestone Sep 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

@sensei-hacker
sensei-hacker merged commit e2a6416 into iNavFlight:maintenance-10.x Sep 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants