feat(gps): GPS track recorder + live own-ship (record→saved route; show-my-location) — closes #676 - DO NOT MERGE#862
Draft
msupino wants to merge 35 commits into
Draft
feat(gps): GPS track recorder + live own-ship (record→saved route; show-my-location) — closes #676 - DO NOT MERGE#862msupino wants to merge 35 commits into
msupino wants to merge 35 commits into
Conversation
Brainstormed design for recording the flown track via device GPS: live own-ship + breadcrumb, auto-saved on stop as a timestamped saved-route entry (simplified waypoints + raw track) reusing the route library + Drive sync. Approach A (dedicated gps.js, shared own-ship renderer). Defaults: View/Set toggle, follow-on, simplify epsilon ~30 m.
6 TDD tasks: simplifier + gps.js skeleton, start/stop + filter, save-on-stop library entry, live breadcrumb + shared own-ship renderer, View/Set toggle + i18n + wiring + readout, docs + full regression.
…ve simplify Rewrites simplifyTrack to use an explicit stack (iterative Douglas–Peucker) eliminating the RangeError stack overflow on up to GPS_MAX_POINTS (50k) inputs. Adds stopGpsRecordingAndSave(): captures raw track, simplifies it, builds a validateRoute-passing route data via a guarded state swap + serializeRoute(), and persists a kind:'gps' entry (with full raw track) to the route library.
…erflow test gpsRouteDataFromPoints now snapshots and zeroes state.commChangeSuppressions and state.wind before calling serializeRoute(), restoring them in the finally block. Prevents user's current comm-change suppressions and route wind from polluting the saved kind:gps library entry. Overflow test: 60k->20k points, 35s->10s timeout; still exceeds ~15k recursion-overflow threshold, now runs in ~3s.
Add #gps-record button + #gps-readout span to toolbar (always-visible area, outside collapsed sections. Wire click handler in ui.js to toggle startGpsRecording / stopGpsRecordingAndSave with label swap between S.tbGpsRecord and S.tbGpsStop. Add en + he i18n strings for all GPS UI keys. Playwright test for toolbar toggle passes; spell lint clean. EOF )
…/NavigationApp into codex/gps-track-recorder
The desktop menubar refactor opens section dropdowns that overlap the inspector panel; three specs clicked inspector controls (#insp-close, the name input, the VOR selector) while those dropdowns intercepted the pointer. Call hideToolbarMenus() before the interaction, matching the pattern already used in ui-deep-coverage and bidi-regression.
…/NavigationApp into codex/gps-track-recorder
# Conflicts: # docs/app/draw.js
The inner loop called Math.hypot O(n²) times; on the 20k-point worst-case zigzag that blew past the 10 s test budget in CI. Compare squared perpendicular distances against eps² (no sqrt/hypot in the hot loop), flat lo/hi stack + Uint8Array keep-set. Identical kept set, far faster. Removed the now-unused _perpDeg helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #861. Supersedes #849 (folded in its live own-ship).
Device-GPS feature for #676:
kind:'gps'saved-route entry (simplified waypoints + raw track) carried by the existing Drive sync.Implementation: dedicated
docs/app/gps.js(watchPosition, accuracy+min-move filter, iterative overflow-safe Douglas–Peucker, save via canonicalserializeRoutewith a deep-cloned guarded state swap that does not mutate the loaded route). ShareddrawOwnShip(pos,hdg)renderer (sim + GPS, mutually exclusive); overlay breadcrumb (tune keys). EN+HE i18n; geolocation-disabled guards; error resets both toggles.Built spec → plan → subagent-driven TDD with per-task spec+quality review; final review caught a route-leg data-loss bug (fixed). 11 GPS tests incl. regressions for: loaded-route legs not mutated on save; own-ship preserved when stopping a recording while live is on; error resets both buttons.
v1 caveats: HTTPS-only; backgrounded-phone gaps (no wake-lock); resume-on-reload deferred.