Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a65a492
feat(import): add ImportFormat.macdiveXml and source override
ericgriffin Apr 21, 2026
291072b
feat(import): detect MacDive native XML format
ericgriffin Apr 21, 2026
035fe95
feat(import): MacDive XML typed value classes
ericgriffin Apr 21, 2026
4af7674
feat(import): MacDive unit converter (imperial ↔ SI canonical)
ericgriffin Apr 21, 2026
5c9670d
feat(import): MacDiveXmlReader parses MacDive native XML into typed m…
ericgriffin Apr 21, 2026
64260e2
test(import): imperial-unit fixture and tests for MacDive XML reader
ericgriffin Apr 21, 2026
43b531e
feat(import): MacDiveXmlParser produces unified ImportPayload
ericgriffin Apr 21, 2026
264a2d2
feat(import): MacDive value mapper for water type / entry type / rating
ericgriffin Apr 21, 2026
357ef28
fix(import): route MacDive waterType/entryType through MacDiveValueMa…
ericgriffin Apr 21, 2026
f7687ba
feat(import): wire MacDiveXmlParser into universal import pipeline
ericgriffin Apr 21, 2026
5222dbf
test(import): strengthen MacDive XML wizard test to exercise parser
ericgriffin Apr 21, 2026
7274b60
test(import): MacDive XML real-sample regression (gated)
ericgriffin Apr 21, 2026
ab181db
chore: CHANGELOG and plan update for M2 completion
ericgriffin Apr 21, 2026
686f2f3
fix(lint): use const for constants, remove unused import
ericgriffin Apr 21, 2026
fd9c8bd
fix(import): address PR #254 review — MacDive XML consumer compatibility
ericgriffin Apr 23, 2026
efef749
fix(import): address PR #254 review round 2 — MacDive XML polish
ericgriffin Apr 23, 2026
28227e3
fix(import): dedup buddyRefs / tagRefs + use MacDiveValueMapper.rating
ericgriffin Apr 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ All notable changes to Submersion are documented in this file.
name and captain, dive operator, surface conditions, weather (stored
in the existing weather description field), plus site water type, body
of water, and difficulty rating.
- **MacDive native XML import.** MacDive's own `.xml` logbook format is now
a first-class import source. Unlike MacDive UDDF (which doesn't emit tags),
the native XML export carries dive tags — so users migrating tag metadata
from MacDive should choose this format. Supports both Imperial and Metric
unit modes; depths/temperatures/pressures are converted to the canonical
internal units at the reader boundary.
- **MacDive (XML) source override** in the import wizard's detected-source
dropdown, alongside the existing MacDive (CSV) option.
- Cross-format import deduplication: stable per-dive UUIDs from MacDive,
Shearwater Cloud, Subsurface SSRF, and generic UDDF are now preserved on
the `dive_data_sources` sidecar. Re-importing the same dives in a
Expand Down
23 changes: 23 additions & 0 deletions docs/superpowers/plans/2026-04-21-macdive-native-xml-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@

---

## Milestone 2 Status — COMPLETE

- All 11 tasks landed. 10 implementation commits + 1 commit that cherry-picked
the MacDiveValueMapper onto this branch after it originally landed on main
by mistake.
- New `ImportFormat.macdiveXml` with source override and format-detector
recognition (DOCTYPE + `<dives>`/`<schema>` fallback).
- `MacDiveXmlReader` produces typed `MacDiveXmlLogbook` from XML with SI
canonical units at the boundary. Imperial↔Metric verified via an explicit
imperial fixture.
- `MacDiveXmlParser` implements `ImportParser`, dedups sites/buddies/tags/gear
inline, routes raw MacDive strings through `MacDiveValueMapper` so
`waterType`/`entryType` resolve to Submersion enums.
- Gated real-sample test (`@Tags(['real-data'])`) asserts 540 dives, tag
preservation (20+ unique tags), site dedup, unit-conversion sanity.
- Full test suite passes (7000+ tests).

Next: M3 (MacDive SQLite) builds on top of this. Key shared assets —
`MacDiveValueMapper`, `MacDiveUnitConverter` — are reused by M3's SQLite
parser.

---

## File Structure

| File | Role | New / Modified |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
enum ImportFormat {
csv,
uddf,
macdiveXml,
subsurfaceXml,
divingLogXml,
suuntoSml,
Expand All @@ -16,6 +17,7 @@ enum ImportFormat {
String get displayName => switch (this) {
csv => 'CSV',
uddf => 'UDDF',
macdiveXml => 'MacDive XML',
subsurfaceXml => 'Subsurface XML',
divingLogXml => 'Diving Log XML',
suuntoSml => 'Suunto SML',
Expand All @@ -30,7 +32,7 @@ enum ImportFormat {

/// Whether this format has a parser implemented in v1.5.
bool get isSupported => switch (this) {
csv || uddf || subsurfaceXml || fit || shearwaterDb => true,
csv || uddf || subsurfaceXml || fit || shearwaterDb || macdiveXml => true,
_ => false,
};
}
Expand Down Expand Up @@ -123,6 +125,11 @@ class SourceOverrideOption {
format: ImportFormat.csv,
displayName: 'MacDive (CSV)',
),
SourceOverrideOption(
sourceApp: SourceApp.macdive,
format: ImportFormat.macdiveXml,
displayName: 'MacDive (XML)',
),
SourceOverrideOption(
sourceApp: SourceApp.divingLog,
format: ImportFormat.csv,
Expand Down
Loading
Loading