Skip to content

Plan iCloud sync and add reader profile foundation - #15

Merged
serabi merged 6 commits into
mainfrom
add-icloud-sync-adr
Jul 10, 2026
Merged

serabi merged 6 commits into
mainfrom
add-icloud-sync-adr

Conversation

@serabi

@serabi serabi commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Record the iCloud book sync and reader profile decision in an ADR
  • Add reader profile and reading state models for per-profile reading data
  • Scope progress, bookmarks, and saved words to the active reader profile
  • Add parent-facing Reader Profiles management in Settings: add, switch, edit, and parent-gated delete
  • Keep shared books separate from profile-scoped words, bookmarks, progress, and settings
  • Audit and update app colors so shared UI text, borders, semantic colors, and bright-filled controls meet WCAG contrast targets

Cleanup (no users yet)

Since the app has no shipped users, this branch keeps the model clean rather than backward-compatible:

  • profileID on Bookmark/SavedWord is required (non-optional) with synthesized Codable
  • Removed the local-data migration pass; there is no legacy data to migrate
  • Dropped the now-dead lastReadProgression/lastReadLocatorJSON fields from Book
  • activeProfile is a pure read; default-profile setup runs once at launch to avoid mutating state during view updates

Verification

  • xcodebuild test -project Piperly.xcodeproj -scheme Piperly -destination 'platform=iOS Simulator,name=iPad (A16),OS=26.4' passes
  • WCAG AA contrast audit passes for shared app surfaces and reader themes

serabi added 2 commits July 9, 2026 18:21
Persisted stores decoded whole arrays with try? decode([T].self), so one
legacy or corrupt record dropped the entire array to [], and the next save
overwrote the good persisted bytes with an empty array. Making profileID a
required field on Bookmark/SavedWord turned every pre-profiles blob into
exactly such a failure.

Decode element-by-element via a FailableCodable wrapper so a bad record is
skipped instead of failing the array, and refuse to overwrite a store whose
non-empty bytes decoded to nothing. Legacy Bookmark/SavedWord blobs without
profileID now decode to a sentinel and are rehomed onto the active profile
on load rather than being orphaned.

Adds LegacyDecode tests covering legacy-blob survival, mixed-array recovery,
and the no-overwrite-on-total-corruption guard.
@serabi
serabi merged commit 9c65139 into main Jul 10, 2026
2 checks passed
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