Skip to content

Add per-sample compass heading capture (DC_SAMPLE_BEARING)#563

Merged
ericgriffin merged 8 commits into
mainfrom
worktree-flythrough-pr1
Jul 11, 2026
Merged

Add per-sample compass heading capture (DC_SAMPLE_BEARING)#563
ericgriffin merged 8 commits into
mainfrom
worktree-flythrough-pr1

Conversation

@ericgriffin

@ericgriffin ericgriffin commented Jul 11, 2026

Copy link
Copy Markdown
Member

Foundation PR for the 3D dive flythrough (spec: docs/superpowers/specs/2026-07-11-3d-flythrough-design.md): per-sample compass heading end-to-end, from the dive computer into the database. Data-pipeline only - no UI changes and no new dependencies.

Compass heading end-to-end

  • New nullable dive_profiles.heading column (degrees 0-359), schema v105. v104 is reserved by the in-flight weight-planner branch; the beforeOpen backstop heals any merge-order gap. Migration tests cover forward, idempotency, backstop heal, and the version-ladder tripwire.
  • Shared C capture: libdc_download.c now handles DC_SAMPLE_BEARING (previously silently discarded), with the standard UINT32_MAX sentinel.
  • All four platform serializers updated: Android JNI double-array grows 21 to 22 elements (heading at index 21, with a size guard) plus both Kotlin decoders; Swift; Linux FlValue; Windows EncodableValue.
  • Pigeon ProfileSample.heading (double?) regenerated across all platforms.
  • Dart pipeline: domain ProfileSample, ProfilePointData, DiveProfilePoint (copyWith/props), all repository mapping sites, and persistence in BOTH download and reparse, so existing dives gain heading via re-parse of stored raw data.
  • Fixed a latent trap: macos/Classes/DiveComputerApi.g.swift was a stale copy that Pigeon regen never updates (swiftOut only targets ios/Classes). It is now a symlink to the iOS copy, matching the plugin's existing C-file pattern.

Why

Compass heading is the highest-fidelity input for reconstructing a dive's horizontal path between GPS entry/exit points (heading dead-reckoning with closure correction onto the anchors). It also stands alone as useful logged data. Without this PR, bearing samples reported by the computer are discarded at parse time.

Verification

  • flutter analyze: no issues.
  • flutter test test/core/database/ test/features/dive_log/ test/features/dive_computer/: 2334 tests pass.
  • Full CI green on all five platforms (25/25 checks).

Pending

  • Device smoke test with a bearing-reporting computer (heading lands in dive_profiles on download; re-parse backfills an existing dive).

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/core/database/database.dart 93.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ericgriffin ericgriffin self-assigned this Jul 11, 2026
@ericgriffin ericgriffin moved this from Backlog to In review in Submersion Release Tracker Jul 11, 2026
@ericgriffin ericgriffin changed the title Add per-sample compass heading (DC_SAMPLE_BEARING) and three_js spike Add per-sample compass heading capture (DC_SAMPLE_BEARING) Jul 11, 2026
Weight planner (#564) landed as v104; heading stays v105. Both onUpgrade
blocks and beforeOpen backstops kept in numeric order. Exact-latest
version tripwire moves from the v104 test to the v105 test.
@ericgriffin
ericgriffin merged commit fff08da into main Jul 11, 2026
30 of 31 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Submersion Release Tracker Jul 11, 2026
@ericgriffin
ericgriffin deleted the worktree-flythrough-pr1 branch July 11, 2026 18:58
ericgriffin added a commit that referenced this pull request Jul 11, 2026
The dive placed in a reconstructed 3D seascape: the swim path dead-reckoned
from per-sample compass heading (#563) and swim-speed estimate, anchored at
the entry GPS fix and rubber-banded to the exit fix; threaded through a
synthesized seafloor heightmap (the diver's deepest excursions are known
points, elsewhere interpolated), viewable above and below a translucent
waterline. Honest by construction: 'estimated path' and 'synthesized
seafloor' captions are always shown. DeadReckoningService + TerrainBuilder
+ SpatialPathBuilder + SpatialGeometryService (all pure) + providers +
SpatialSitePage, reachable from a terrain action on dive detail. Extends
ScrubPath with a 3D (Z) cursor track and SceneBounds with a scene Z range.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant