Merge varia-radar-overlay-widget into next-version#8
Closed
eried wants to merge 7 commits into
Closed
Conversation
New OverlayElementType.RADAR Overlay Studio control with three view modes (Lane / Mirror / Minimal), rendered both in the phone Overlay Studio and, via the existing customOverlayJson pipe, on the HUD's Custom screen. The radar data already exists on the phone (RadarRepository); this surfaces it for video overlays and the helmet HUD. hud-protocol: - HudState gains radarConnected / radarBatteryPercent / radarTargets (List<RadarTargetWire>); PROTOCOL_MINOR 7 -> 8 (additive, old HUDs ignore). - OverlayElementType.RADAR + radarMode / radarRangeM / radarShowDistanceLabels on OverlayElement. app: - HudServer.snapshot() maps the live RadarRepository frame to the wire. - HudDemoSource synthesises closing cars so the widget is testable on an emulator without a Varia. - RadarElement renderer (3 modes; threat colours from theme status tokens) + Studio editor wiring (picker entry, icon, config sheet, defaults) + OverlayPresetJson radar fields (save/load + wire payload). hud: - RadarElement renderer twin; StudioElementData carries the radar frame; CustomOverlayScreen's hand-rolled parser reads the radar fields. tests: - Wire round-trip + additive-compat (frozen v1.0 still decodes, MINOR bump). The Varia is rear-facing with no bearing, so Mirror lights both sides by the worst threat level (spelled out in the config hint). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A "12 m" string centred as a whole left the digits sitting left of centre (the unit's width pushed them over). Put the distance number on its own centred line with the unit + closing speed on a smaller line below, so the number reads dead-centre between the chevrons in both the phone Studio and the HUD. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…/varia-radar-overlay-widget
Addresses a tester whose HUD link died after ~2 min and only a Motoeye reboot recovered it, plus the goal that reconnect be snappy internally without flashing the disconnect alert on a brief blip. Detection / reconnect (internal, fast): - Phone OkHttp pingInterval 15s -> 5s: a frozen/half-open HUD (frame sends still succeed into the TCP buffer) is now caught by a missed pong in ~5s, not 15s, so the dial loop rediscovers + reconnects promptly. - HUD Ktor pingPeriod 15s -> 5s, timeout 30s -> 12s: frees the connection (peer/status) and unblocks the incoming loop within ~12s of the phone vanishing instead of 30s. - connSeq guard: a stale, slowly-timing-out handler can no longer clobber the status/peer of a newer connection from a fast reconnect. Resilience (self-recover without a reboot): - Partial CPU wake lock while the link is up (+ WAKE_LOCK permission) so the Ktor server, UDP beacon and watchdog can't be frozen by a suspend window. - Watchdog interval 30s -> 10s so a wedged listener restarts in ~20-30s; it now also revives the mDNS advertise if it was down, without a full restart. Visual alert stays relaxed: the disconnect splash remains gated by HudApp's existing 10s reconnect grace, decoupled from the now-faster internal detection so a quick reconnect never flashes it. Diagnostics: HudServer records watchdogRestarts / lastEndReason / lastDisconnectMs and logs the end reason + a per-connection token so the next "link died" report carries the cause. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Tapping Overwrite on a same-named preset actually saved "name (1)" instead of replacing it. Cause: savePreset did delete()+createFile() over the Storage Access Framework, which races the provider and dedupes the new file's display name to "name (1).json". Now it writes IN PLACE to the existing document (createFile only when the name is new), with "wt" so a shorter preset can't leave stale trailing bytes. The overwrite confirmation is now a three-way choice -- Cancel / Keep both / Overwrite. "Keep both" saves under the next free "name (n)" (the old accidental behaviour, now intentional); Overwrite replaces in place. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Lands the work that's on top of the shared hud-auto-discovery base: - Varia radar overlay-studio widget (Lane / Mirror / Minimal), rendered in the phone studio and on the HUD Custom screen. - Snappy HUD reconnect + resilience (5s/12s heartbeats, 10s watchdog, CPU wake lock, mDNS revive, connection-token guard, diagnostics). - Overlay Studio "Overwrite" now overwrites in place (no "name (1)" duplicate) + a Keep both / Overwrite / Cancel choice. next-version already carries hud-auto-discovery + Varia dashboard support; those are the shared base, so the merge was conflict-free. Build green (app + hud + hud-protocol tests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Integrates the Varia radar overlay widget + HUD reconnect/resilience + an Overlay Studio save fix into
next-version.next-versionalready carrieshud-auto-discovery+ the Varia dashboard support (shared merge base), so this merge was conflict-free and builds green (:app,:hud,:hud-protocoltests).What this adds on top of next-version
OverlayElementType.RADAR) — Lane / Mirror / Minimal modes, rendered in the phone Overlay Studio and mirrored to the HUD's Custom screen viacustomOverlayJson. New compactRadarTargetWireon the wire (PROTOCOL_MINOR7→8);HudDemoSourcesynthesizes cars for emulator testing.WAKE_LOCKperm), a connection-token guard so a stale handler can't clobber a fresh reconnect, and disconnect diagnostics. The visual disconnect splash stays on the existing 10s grace (relaxed) — decoupled from the faster internal detection. Targets a tester whose HUD link died after ~2 min and needed a reboot.name (1)due to SAFdelete()+createFile()racing the provider), plus a Cancel / Keep both / Overwrite dialog.Testing
:hud-protocolwire round-trip + additive back-compat (radar fields, MINOR bump).🤖 Generated with Claude Code