Skip to content

refactor(shared): clarify alarm values and coordinator ownership - #81

Merged
t-regbs merged 6 commits into
mainfrom
codex/cleanup-shared
Nov 6, 2026
Merged

t-regbs merged 6 commits into
mainfrom
codex/cleanup-shared

Conversation

@t-regbs

@t-regbs t-regbs commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Why

Alarm equality includes construction-time fields, theme decoding is duplicated, and ViewModel constructors obscure the shared coordinator owner. Scheduling an unsaved alarm also silently selects the newest saved row.

What changed

  • Create drafts through Alarm.newAlarm, keep persisted values in equality, and update all draft callers plus Swift's generated copy call.
  • Use explicit stable theme storage IDs and inject the existing coordinator directly; remove unused persistence forwarding APIs.
  • Reject ID0 before scheduling, while preserving saved identities and negative test fixtures.

Scope

  • Shared model, preferences, ownership and their Android/Swift callers. Database schema and durable recovery behavior are unchanged.
  • Existing uncommitted audio work is excluded and was checked separately for compatibility.

Blast Radius

The generated Swift copy signature and internal ViewModel constructor change. Theme IDs remain LIGHT=0, DARK=1, SYSTEM=2 with invalid values using SYSTEM; every production scheduling caller supplies a saved identity.

Verification

  • Reproduced the ID0 fallback before fixing it; added alarm equality, mapper round-trip and theme persistence regressions.
  • Combined cleanup passes 526 host and 399 Kotlin native tests, Android assembly/lint, fresh framework export and Swift compilation; 28 Xcode cases pass with one expected iPad-only skip; all five actual Android startup-theme cases pass.
  • Audio-overlay compatibility passes 533 host tests with one mechanical test-constructor adjustment. Fresh independent review found no defects.

@t-regbs
t-regbs merged commit 4107316 into main Nov 6, 2026
3 of 8 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