Configurator as Web APP (PWA)#2448
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
|
I think websockets wrap it in HTTP requests. They aren't raw sockets, as I understand it. Both Electron and PWA support web sockets, though. So one solution would be something along these lines, roughly: BUUUUT I have another idea in mind I'm going to try. |
|
@Scavanger I don't know if you've seen my other comments, but ... I now have SITL mostly running in the browser, compiled with webassembly. It runs in-browser can responds to MSP communication. So no platform-specific SITL needed for Configurator. |
…ividual objects - Updated all tabs to replace the global TABS object with individual tab objects (e.g., loggingTab, magnetometerTab, etc.). - Changed the way active tabs are set by comparing against the tab object instead of string literals. - Exported each tab object for better modularity and maintainability. - Ensured all tab initialization and cleanup functions are correctly referenced to their respective objects. This should help to optimise the tabs and prevent some of the tabs from loading incorrectly in PWA.
This commit fixes three issues in the JavaScript Programming tab:
1. **Fix silent code dropping for invalid function calls**
- Previously, code like `inav.override.flightAxis(180);` was silently
discarded without any error message
- Now generates clear error: "Cannot call 'X' as a function"
- Added extractCalleeNameForError() helper to show full call path
- Location: js/transpiler/transpiler/parser.js
2. **Add comprehensive intermediate object detection**
- Detects when users try to use objects as if they were properties
- Catches: assignments, function calls, expressions, comparisons
- Examples caught:
* `inav.override.flightAxis.yaw = 180` (missing .angle)
* `gvar[0] = inav.flight + 1` (flight is an object)
* `inav.override.vtx(3)` (vtx is object, not function)
- Provides helpful suggestions showing available properties
- Locations:
* js/transpiler/transpiler/property_access_checker.js
* js/transpiler/transpiler/analyzer.js
3. **Fix missing i18n text in JavaScript Programming tab header**
- Added i18n.localize() calls in tab initialization
- Added CSS to fix paragraph spacing (margin-bottom: 10px)
- Locations:
* tabs/javascript_programming.js (lines 84, 91)
* tabs/javascript_programming.html (line 217-219)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Changed addError to addWarning with type 'error' in parser - Made transpile() fail when parser errors are present - Prevents silent code dropping from succeeding compilation
This commit completes the transpiler validation improvements by: 1. Enhanced intermediate object detection (property_access_checker.js): - Now uses raw API definitions instead of processed structure - Simplified logic per user suggestion: just check typeof === 'object' - Catches 2-level objects (e.g., inav.override.vtx) - Catches 3-level objects (e.g., inav.override.flightAxis.yaw) - Catches category-only access (e.g., inav.flight) 2. Improved error messages (analyzer.js): - Shows available properties for intermediate objects - Differentiates simple vs deeply nested objects - Provides actionable suggestions 3. Comprehensive test coverage: - test_examples.mjs: All 22 examples still compile (no regressions) - test_validation_fixes.mjs: 8/8 validation tests pass All invalid code now generates helpful error messages instead of: - Being silently dropped - Failing later in codegen with cryptic messages - Passing through to generate invalid logic conditions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Address Qodo code review feedback: check result.warnings.errors instead of result.errors for semantic/validation errors.
Set tpa_rate = 80 for airplane presets ("Airplane with a Tail" and
"Airplane without a Tail"). This addresses feedback from PR #11222
that fixed-wing aircraft benefit from higher TPA values.
Multicopter presets retain their existing tpa_rate = 20 setting.
…y key Prevents generating error suggestions containing 'undefined' when nested.properties is an empty object. Addresses qodo-merge-pro bot suggestion on PR iNavFlight#2514. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The plotElevation() function was commented out in commit 8d5870b due to ESM module compatibility issues. This fix: - Adds Chart.js v4.4.1 with full ESM support to package.json - Imports Chart.js properly as ES module - Uncomments the plotElevation() function This restores the terrain elevation profile chart feature for mission planning safety checks.
The plotElevation() function calls `new Chart()` which expects Chart to be available in the global scope. While we correctly imported Chart.js as an ES module, it was only available within the module scope. This change exposes Chart on the window object so the elevation plotting function can access it.
The plotElevation() function had Chart.js code only for empty missions (dummy data). When missions had waypoints, it prepared elevation data but only had a commented-out Plotly.newPlot() call, so no chart rendered. Changes: - Add Chart.js rendering after elevation data preparation (line 4352+) - Convert Plotly trace data to Chart.js datasets format - Display WGS84 terrain elevation (orange, filled area) - Display mission altitude (blue line with waypoint markers) - Properly destroy existing chart before creating new one - Store chart instance globally for cleanup on subsequent calls Both empty and non-empty mission cases now create Chart.js charts.
Code review identified several issues that needed addressing: CRITICAL fixes: - Replace hardcoded test data in empty mission case with proper empty chart - Add canvas element validation before Chart instantiation - Remove all unused Plotly code structures (trace objects, layout vars) - Fix chart title to not depend on removed Plotly code IMPROVEMENTS: - Add try-catch error handling for async elevation data fetch - Add safe array checks for Math.min/max to prevent empty array errors - Change var to const for immutable values (modern JavaScript) - Clear chart instance reference (set to null) after destruction - Add console error messages for debugging The plotElevation() function is now a clean Chart.js-only implementation without any Plotly remnants, proper error handling, and validation.
…ctivity When waypoints are dragged, the elevation chart should update smoothly. The previous approach of destroying and recreating the chart on every update was causing the chart to not refresh when waypoints were moved. Chart.js update() method is designed for this use case: - Preserves the chart instance - Updates data and options - Triggers smooth re-render with animations - More efficient than destroy/recreate This fixes the issue where dragging a waypoint didn't update the elevation profile.
…cted Previously, plotElevation() was only called if the dragged waypoint matched selectedMarker. This meant dragging an unselected waypoint wouldn't update the chart. Now plotElevation() is called for all waypoint drags: - If waypoint is selected: updates elevation + runs full async logic - If waypoint is not selected: updates elevation chart only This ensures the elevation profile always reflects the current mission geometry after any waypoint is moved.
Per code review feedback, adds two important improvements:
1. Race condition protection:
- Track elevation update sequence number
- Ignore stale data from late-returning API calls
- Prevents chart showing outdated elevation when waypoints dragged rapidly
2. Disable chart animations during updates:
- Use chart.update('none') instead of chart.update()
- Improves performance during drag operations
- Prevents animation queueing and visual lag
These fixes ensure the chart always shows current data and responds
smoothly even with rapid waypoint dragging or slow network connections.
…commands readme: Add debugging info
Update ru translation
…indows-binaries Fix postPackage hook to remove non-native SITL binaries from macOS builds
…validation Fix transpiler validation and improve error messages
…ic-tpa-defaults Add TPA rate defaults to fixed-wing presets
…vation-chart-esm Fix: Re-enable terrain elevation chart with Chart.js ESM support
removed old pre 9.0 values I missed
…eed-defaults correcting vspeed defaults in presets
|
Feature complete!
|
|
Well done. Any community testing/feedback.Sent from my Galaxy
-------- Original message --------From: Andi Kanzler ***@***.***> Date: 07/02/2026 23:20 (GMT+00:00) To: iNavFlight/inav-configurator ***@***.***> Cc: Philip ***@***.***>, Comment ***@***.***> Subject: Re: [iNavFlight/inav-configurator] Configurator as Web APP (PWA) (PR #2448) Scavanger left a comment (iNavFlight/inav-configurator#2448)
Feature complete!
Works inkl. Demo mode, (full*) SITL support and some Goodies:
Update dialog
Nice message boxes
File manager for EEprom files
= Network support (Sim interface, TCP Uarts) need a local Websocket-to-Socket proxy.
https://inav-configurator.pages.dev/
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
*** Work in Progess ***
Preview,
only partiallyworking now: https://inav-configurator.pages.dev/Now fully functional (only Bugfixing now) inkl. Demo mode and SITL
Working:
To do:
- Add more bridge code to replace elctron api calls (Dialgos, load/save file, ...)- Remove update-Not- working, :SITL, inkl Simulator imterface. But needs a local Websocket-to-Socket Proxy, because Applications in the browser are only allowed to comunicate via Websockets.
Things to consider:
Any other suggestions?
Github pages will not work, because SITL webassembly needs a special HTTP-Header, wich is impossible to set here. Cloudflare pages as alternative?