Commit Graph
2 Commits
Author SHA1 Message Date
Incido Developer 5bce1934c1 feat(phase-1/m4.3a): :core:settings → multiplatform (androidTarget + jvm)
Verbatim M4.2 (:core:domain) playbook — both source files moved UNMODIFIED
into commonMain (git records the rename; UserSettings.kt is a pure rename).
This is the visibility gate for M4.3's AppGraph: a KMP commonMain cannot see
plain kotlin("jvm") modules, and M4.3's container seam needs
SettingsRepository/UserSettings from composeApp commonMain.

One new seam, justified per §9 (never widen silently): kotlinx.coroutines
`runBlocking` has no commonMain declaration, so SettingsRepository.snapshot()
now goes through an internal expect/actual `blockingFirst(Flow<T>): T`.
Both actuals are the identical two-liner because both targets are JVM.
Same startup-safety contract (block off the UI thread at startup only).

Consumers unchanged by design: :desktopApp (plain jvm) and :composeApp's
androidMain resolve through variant metadata — zero import changes.

Verification (both green):
  ./gradlew assembleDebug :composeApp:compileKotlinJvm :core:data-jvm:smoke
      → BUILD SUCCESSFUL — RESULT: M1a PASS (one run, all consumers)
  ./gradlew :desktopApp:run --args="--data-dir /tmp/incido-desktop-smoke --self-test --exit-after 6"
      → SELFTEST wrote note id=1 → RENDER notes=1 selected=1
  git diff core/data/objectbox-models → empty (ID model file unchanged)
2026-10-06 16:27:10 +13:00
Incido Developer 8db835640e feat(phase-1/m3.1): :core:settings — SettingsRepository shared, store injected
Milestone M3 task 1 (DESKTOP_PHASE_PLAN §5): move UserSettings +
SettingsRepository into a plain kotlin("jvm") module so the desktop
build reads/writes the SAME preferences keys and .preferences_pb format
the phone uses. Package name org.incido.compose.data.settings kept, so
the Android diff is file moves + one constructor change.

Seam: SettingsRepository now takes an injected DataStore<Preferences>.
Android supplies the preferencesDataStore(name = "incido_settings")
Context-extension store (new AndroidSettingsStore.kt, moved verbatim);
desktop builds it with PreferenceDataStoreFactory.create(
corruptionHandler = ReplaceFileCorruptionHandler, produceFile) — the
Phase-0 API delta (no Context extension on the multiplatform core
artifact). snapshot() keeps runBlocking for startup-only use.

DesktopContainer grows settingsRepository first, mirroring AppContainer
construction order ahead of M3's cipher install. dynamic_color /
use_biometric / block_screenshots keys ride along but have no desktop
UI — hidden, not faked (M3 exit rule).

Verified: ./gradlew assembleDebug (green; :app needed :core:settings on
its classpath — MainActivity reads userSettingsFlow, same pattern as
:core:domain) + ./gradlew :desktopApp:run --args="--data-dir
/tmp/incido-desktop-smoke --self-test --exit-after 6" (RENDER/SELFTEST
sequence intact) + ./gradlew :core:data-jvm:smoke (green).
2026-10-06 06:20:13 +13:00