Replace CSV export with NDJSON export as the sole Shortcuts export#556
Open
sudden-break wants to merge 1 commit into
Open
Replace CSV export with NDJSON export as the sole Shortcuts export#556sudden-break wants to merge 1 commit into
sudden-break wants to merge 1 commit into
Conversation
sudden-break
force-pushed
the
replace-csv-export-with-ndjson
branch
from
July 21, 2026 06:05
3354089 to
0cf52de
Compare
Removes ShortcutHealthExport (CSV format, noop_sync.txt) and makes ShortcutNdjsonExport the single Shortcuts export path. Produces 7 NDJSON .txt files for import into Apple Health via iOS Shortcuts. New files: - Strand/Data/ShortcutNdjsonExport.swift (core export logic) - StrandTests/ShortcutNdjsonExportTests.swift (unit tests) Deleted files: - Strand/Data/ShortcutHealthExport.swift (CSV export) - StrandTests/ShortcutHealthExportTests.swift (CSV export tests) Modified files: - StrandiOS/App/ShortcutExportSettingsView.swift — removed CSV card, NDJSON-only UI - StrandiOS/App/StrandiOSApp.swift — removed CSV background trigger - StrandiOS/App/RootTabView.swift — updated comment - Strand/Data/ShortcutHealthImport.swift — updated doc comments - Strand/Resources/Localizable.xcstrings — added translations for NDJSON strings - project.yml — updated comment Behavior: - One-time auto-migration: users with CSV export enabled get NDJSON enabled - Configurable 7/30/90-day lookback window - User-chosen output folder (or Documents fallback) - Delta export with watermark-based tracking - 8-language translations (de, es, fr, it, pt-PT, ru, zh-Hans, zh-Hant) - Existing ShortcutHealthImport (import from Apple Health) unchanged
sudden-break
force-pushed
the
replace-csv-export-with-ndjson
branch
from
July 21, 2026 06:13
0cf52de to
99a4e1b
Compare
Owner
ReviewThe NDJSON export itself is well-engineered — good test coverage (43 tests), correct delta export with watermark tracking, proper security (bookmark-based sandboxing), and the calorie dedup logic is sound. However, removing the CSV export entirely is a breaking change for any user who has an existing Shortcut built around parsing Suggestion: keep CSV as a legacy option and offer NDJSON alongside it.
This way the richer format is front and center without silently breaking anyone's automation. Minor code notes (not blockers)
|
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.
Summary
Removes
ShortcutHealthExport(CSV format,noop_sync.txt) and makesShortcutNdjsonExportthe single Shortcuts export path for sideloaded iOS installs that can't use HealthKit directly.Motivation
The existing CSV export produces a single flat file (
noop_sync.txt) withHR,HRV,Steps,yyyy-MM-dd HH:mmlines. The NDJSON export produces 7 structured.txtfiles (one per data category) that are easier to parse in Shortcuts and carry richer data (sleep stages, workouts, daily metrics, calorie dedup). Having one export path simplifies maintenance and the settings UI.What changed
New files:
Strand/Data/ShortcutNdjsonExport.swift— core export logic (517 lines)StrandTests/ShortcutNdjsonExportTests.swift— unit tests (660 lines)Deleted files:
Strand/Data/ShortcutHealthExport.swift— CSV export (213 lines)StrandTests/ShortcutHealthExportTests.swift— CSV export tests (284 lines)Modified files:
StrandiOS/App/ShortcutExportSettingsView.swift— removed CSV card, NDJSON-only settings UIStrandiOS/App/StrandiOSApp.swift— removed CSV background triggerStrandiOS/App/RootTabView.swift— updated commentStrand/Data/ShortcutHealthImport.swift— updated doc commentsStrand/Resources/Localizable.xcstrings— 64 new translation entries (8 languages)project.yml— updated commentExported files (7 NDJSON .txt files)
heart_rate.txthrv.txtsleep_sleeping.txtsleep_awake.txtworkouts.txtdaily_metrics.txtsummary.txtBehavior
Testing
What's NOT changed
ShortcutHealthImport(import from Apple Health) — completely separate, untouchedShortcutExportReadsprotocol — moved intoShortcutNdjsonExport.swift, still provides the test seamWhoopStoreconformance — preserved