Skip to content

feat(profiles): scope reader preferences - #17

Merged
serabi merged 3 commits into
mainfrom
codex/profile-preferences
Jul 14, 2026
Merged

serabi merged 3 commits into
mainfrom
codex/profile-preferences

Conversation

@serabi

@serabi serabi commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Store voice, speech rate, font size, reader theme, and voice-setup completion on each reader profile.
  • Route settings and reader screens through the active profile in BookStore instead of global app storage.
  • Enforce nickname-only validation when profiles are created, updated, or decoded.
  • Add focused coverage for defaults, profile switching, preference isolation, persistence, and invalid nicknames.

Why

Families can share one Piperly library while each reader keeps their own reading and voice preferences. Validation also belongs at the model boundary so invalid profile data cannot bypass the form.

Impact

Switching profiles now switches the reader's full preference set. Existing encoded profiles receive safe defaults for the new fields. Because there are no shipped users, this does not migrate values from the removed global preference keys.

Validation

  • Full iPad simulator suite before stacking: 38 unit tests and 1 UI launch test passed.
  • After rebasing onto the docs-only base: 8 focused reader-profile tests passed.

Stack


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

serabi added 2 commits July 9, 2026 18:23
ReaderProfile.init(from:) validated the decoded name with validatedNickname,
which throws for names that were valid under the old sanitizer (spaces,
digits). Combined with try? decode([ReaderProfile].self), one such legacy
name wiped the entire profiles array on upgrade. Decode now sanitizes the
name to a valid form (or defaultName); validation still throws at the
create/update boundary.
# Conflicts:
#	Piperly/Services/BookStore.swift
@serabi
serabi changed the base branch from codex/icloud-sync-design to main July 14, 2026 15:10
@serabi
serabi marked this pull request as ready for review July 14, 2026 15:10
@serabi
serabi merged commit 6c7acaf into main Jul 14, 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