Skip to content

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
devfrom
codex/gps-track-recorder
Draft

feat(gps): GPS track recorder + live own-ship (record→saved route; show-my-location) — closes #676 - DO NOT MERGE#862
msupino wants to merge 35 commits into
devfrom
codex/gps-track-recorder

Conversation

@msupino

@msupino msupino commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Fixes #861. Supersedes #849 (folded in its live own-ship).

Device-GPS feature for #676:

Implementation: dedicated docs/app/gps.js (watchPosition, accuracy+min-move filter, iterative overflow-safe Douglas–Peucker, save via canonical serializeRoute with a deep-cloned guarded state swap that does not mutate the loaded route). Shared drawOwnShip(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.

msupino added 20 commits June 18, 2026 21:05
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
)
@msupino msupino changed the title feat(gps): GPS track recorder (record flown path → saved route) feat(gps): GPS track recorder + live own-ship (record→saved route; show-my-location) — closes #676 Jun 18, 2026
@msupino msupino closed this Jun 18, 2026
@msupino msupino reopened this Jun 18, 2026
msupino added 2 commits June 19, 2026 06:23
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.
@msupino msupino changed the title feat(gps): GPS track recorder + live own-ship (record→saved route; show-my-location) — closes #676 feat(gps): GPS track recorder + live own-ship (record→saved route; show-my-location) — closes #676 - DO NOT MERGE Jun 21, 2026
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.
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.

1 participant