Commit Graph
8 Commits
Author SHA1 Message Date
Incido Developer 018db4819c feat(phase-1/m4.4d): shared settings sections to commonMain
AppearanceSection / BackupSection / AboutSection + the building-blocks
helpers (SettingsSection, SettingsToggle, SettingsRow) lifted verbatim
to commonMain as internal — desktop settings (M4.5) composes exactly
these. SettingsScreen keeps the Android-only Security section, the
PIN/biometric screens, the timeout dialog and all SAF wiring.

Design decision (as planned): full commonization of the 1026-LOC
screen buys nothing — SecuritySection is BiometricPrompt + PIN state
machines and the export/import pickers are SAF; sharing the sections
shares the UI, each platform keeps its plumbing. Two callbacks went
nullable to HIDE platform-incapable rows (dynamic color on desktop,
Carnet importer) — Android passes non-null so its pixels are unchanged.

Verified: ./gradlew assembleDebug :desktopApp:build SUCCESSFUL
+ :composeApp:compileKotlinJvm :composeApp:compileDebugKotlinAndroid
+ :desktopApp:run --self-test (SELFTEST id=1 -> RENDER notes=1
selected=1).
2026-10-06 18:56:44 +13:00
Incido Developer 6b5c24e1bc feat(phase-1/m4.4c): editor to commonMain; intake/voice/back seams
NoteEditorScreen + its private helpers move to commonMain. New seams (§6.3/6.5):

- EditorIntake (interface + expect rememberEditorIntake): Android actual
  holds the verbatim launcher code (camera TakePicture + permission
  chain, SAF OpenDocument, RECORD_AUDIO dance, FileProvider/
  ACTION_VIEW open, Toasts, createTempCameraUri/queryDisplayName);
  JVM actual = AWT FileDialog picker + Desktop.open/xdg-open, with
  supportsCamera/supportsVoice=false so the editor HIDES camera + mic
  buttons instead of stubbing them (§6.5).
- VoiceNoteSlot expect composable: Android renders the untouched
  VoiceNoteSection (MediaStore recorder); JVM renders nothing.
- PlatformBackHandler: activity-compose BackHandler on Android, no-op
  on desktop (Esc routing is M5 polish).
- securityManager param became the neutral beginExternalActivity:
  (() -> Unit)? lambda (Android names the Android type only in its
  actual; call sites unchanged). VoiceNoteSection takes the same
  lambda now; App.kt adapts the one call site.

Verified: ./gradlew assembleDebug :desktopApp:build SUCCESSFUL
+ :composeApp:compileKotlinJvm :composeApp:compileDebugKotlinAndroid
+ :desktopApp:run --self-test (SELFTEST id=1 -> RENDER notes=1
selected=1) + :core:data-jvm:smoke (M1a PASS); models clean.
2026-10-06 18:51:47 +13:00
Incido Developer 56949c485f feat(phase-1/m4.4b): image-decode seam; viewer + list move to commonMain
expect/actual decodeImageBytes (§6.3 image-decode): Android actual is
the verbatim BitmapFactory.decodeByteArray + asImageBitmap; JVM actual
is skia Image.makeFromEncoded().toComposeImageBitmap() with
runCatching to keep the null-on-failure contract BitmapFactory gave
the screens. Screens switch produceState<Bitmap?> ->
produceState<ImageBitmap?> and the three BitmapFactory call sites
(list thumbnail, viewer, editor thumbnail stays with the screen next
step). Dispatchers.IO -> the existing M4.3c ioDispatcher seam
(identical actuals).

Verified: ./gradlew :composeApp:compileKotlinJvm
:composeApp:compileDebugKotlinAndroid (BUILD SUCCESSFUL); full gate +:desktopApp:run --self-test + :core:data-jvm:smoke run at the end
of the step chain.
2026-10-06 18:31:08 +13:00
Incido Developer bdb3d7157d feat(phase-1/m4.4a): first screens to commonMain + shared clipboard
Pure moves: IncidoDrawer, ReleaseNotesDialog, PassphraseDialog
(clipboard: Context.getSystemService -> LocalClipboardManager, the
SAME API both targets ship in Compose 1.7.3 - the section 6.3
LocalClipboard+ClipEntry swap is a Compose 1.8-only API, recorded
for M5+). PassphraseGenerator moves behind an internal expect/
actual secureRandomInt (blockingFirst precedent; identical
SecureRandom actuals - both targets ARE the JVM).

New seams justified: secureRandomInt (java.security is not common);
commonMain gains jetbrains lifecycle viewmodel-compose +
runtime-compose (the SAME coordinates androidMain resolved since
M4.1) and material-icons-extended (moved with the screens).

Verified: ./gradlew assembleDebug :desktopApp:build SUCCESSFUL
+ :composeApp:compileKotlinJvm + :desktopApp:run --self-test
(SELFTEST id=1 -> RENDER notes=1 selected=1) + :core:data-jvm:smoke
(M1a PASS); objectbox-models clean.
2026-10-06 18:26:07 +13:00
Incido Developer 59bd6e106b feat(phase-1/m4.3c): ViewModels off APPLICATION_KEY; DesktopContainer implements AppGraph
Completes the M4.3 container seam:

* NoteListViewModel + NoteEditorViewModel (UiStates and SharedImage
  included) move to commonMain. NoteEditorViewModel had zero android.*
  imports; its four withContext(Dispatchers.IO) sites become
  withContext(ioDispatcher) — a new internal expect/actual whose ACTUALS
  are literally Dispatchers.IO on both targets, so Android behaviour is
  byte-identical (invariant §2.1), merely spelled through the seam.
* New commonMain EncryptionBadge/LibraryVerification: the read-only
  mirror of :core:data's EncryptionVerification. Required because
  :core:data is an androidLibrary invisible to commonMain and must stay
  so (invariant §2.3 — objectbox-android vs objectbox-java classpaths).
  AppGraph gains encryptionBadge; both containers map the real verifier
  result 1:1 at their own seam.
* SettingsViewModel stays in androidMain (SecurityManager, Keystore key
  provider, BackupManager Uri IO, CarnetImporter are genuine Android-only
  services — the graph was NOT widened to fake them, §9) but its factory
  now takes the concrete AppContainer via a new LocalAndroidContainer,
  provided alongside LocalAppGraph in IncidoApp. No APPLICATION_KEY /
  IncidoApplication reference survives in ANY ViewModel: all six call
  sites (drawer, list, editor, settings, pin setup, pin change) build
  factories from the graph/container locals at composition time.
* M4.3 exit proof: DesktopContainer : AppGraph — the same face
  (noteRepository/settingsRepository/encryptionBadge) the commonMain
  ViewModels consume, compiler-checked by :desktopApp building against
  :composeApp's jvm target. repository → noteRepository rename.
  The stand-in two-pane UI still runs (M4.5 consumes the real screens).

Verification (all green, one suite):
  ./gradlew assembleDebug :composeApp:compileKotlinJvm :desktopApp:build
      → BUILD SUCCESSFUL
  ./gradlew :desktopApp:run … --self-test --exit-after 6 → SELFTEST id=1, clean exit
  ./gradlew :core:data-jvm:smoke → RESULT: M1a PASS
  crypto legs (separate processes): leg-A ALL-OK → LEG-B PASS/ALL-OK
  git diff '*/objectbox-models/*' → empty
2026-10-06 16:42:48 +13:00
Incido Developer cd363c7aa5 feat(phase-1/m4.3b): AppGraph seam + first commonMain ViewModel (§6.4 probe GREEN)
M4.3's container seam, proven with the smallest ViewModel:

* commonMain di/AppGraph.kt — the platform-neutral container face
  (noteRepository + settingsRepository) plus LocalAppGraph /
  requireAppGraph. Scope discipline per §9: only services BOTH platforms
  can honestly serve; Keystore/SecurityManager/BackupManager/CarnetImporter
  stay on the concrete AppContainer.
* :core:settings + lifecycle-viewmodel enter commonMain (settings as api —
  AppGraph exposes it). Lifecycle coordinates are the SAME
  org.jetbrains.androidx.lifecycle 2.8.4 aliases androidMain already
  resolved since M4.1, so the §6.4 "verify the artifact set" question is
  answered GREEN for both targets and the state-holder fallback is NOT
  needed: DrawerViewModel moves with its androidx.lifecycle.* imports
  UNCHANGED (offline set keeps the androidx FQCNs).
* DrawerViewModel.Factory(APPLICATION_KEY as IncidoApplication) →
  factory(graph: AppGraph). AppContainer implements AppGraph; IncidoApp
  provides LocalAppGraph at the root (same fallback chain it already used).

Verification (one run):
  ./gradlew :composeApp:compileKotlinJvm assembleDebug → BUILD SUCCESSFUL
  (jvm target = first compile of a commonMain ViewModel on desktop deps)
2026-10-06 16:33:53 +13:00
Incido Developer 9ad7c60537 feat(phase-1/m4.2): :core:domain → multiplatform (androidTarget + jvm); NoteColors to commonMain
Phase-0 recommendation #1 ("core:domain is already JVM-clean —
convert it first; zero code changes"), now unlocked by M4.1: common
source sets cannot see plain kotlin("jvm") projects, so the domain
deploy was the gate for making composeApp's commonMain depend on
Note/NoteColor/NoteRepository. Sources move untouched (pure renames);
Flow moves implementation → api (it is in the public repository
interfaces — was already leaking, now stated).

androidTarget() drags in the AGP plugin + a namespace — the module is
now a library-for-Android too, but emits no Android-specific code and
needed no manifest (AGP 8 + namespace). Plain-JVM consumers
(:core:data-jvm, :core:backup, :core:settings, :desktopApp) and AGP
consumers (:core:data, :app) resolve through variant metadata with
ZERO import or build-line changes — verified below.

Then composeApp: api(project(":core:domain")) in commonMain (up from
androidMain), NoteColors.kt moves to commonMain — first real shared
UI-layer file with a domain dependency.

Verified: ./gradlew assembleDebug + :composeApp:compileKotlinJvm +
:core:data-jvm:smoke (M1a PASS) in one run, and
:desktopApp:run --args="--data-dir /tmp/incido-desktop-smoke3
--self-test --exit-after 6" (SELFTEST wrote note id=1).
2026-10-06 12:20:05 +13:00
Incido Developer fef8f9c2e9 feat(phase-1/m4.1): :composeApp in-place → Kotlin Multiplatform (androidTarget + jvm)
Plan §6.1 step 1, the conservative shape: build converts, Android code
moves UNMODIFIED (git shows pure renames; behaviour diff = zero), and
commonMain starts with only the files that compile for both targets
today — theme Color/Type, PasswordPolicy, ReleaseNotes, LinkedShare-
Composer — behind two new expect/actual seams (justification per §9):

* platformDynamicColorScheme — Android actual keeps the pre-M4
  Build.VERSION + dynamicColorScheme branch verbatim; JVM actual
  returns null (desktop hides dynamic color, per M3's posture).
* relativeTimestamp — Android actual is DateUtils verbatim; JVM
  actual is a java.time approximation of the same format (English-
  only until M4 follow-up; desktop has no locale switch yet).

New friction found paying itself into §3/§2 (all fixed in-tree):
* kotlinMultiplatform must be registered at the ROOT with apply false
  like the other Kotlin markers — sibling modules' markers put KGP on
  the buildscript classpath and the subproject request then dies with
  the kapt-style 'already on classpath with unknown version' (§2.5).
* KMP source-set dependency handlers: platform(libs.x) returns raw
  notation, not a Dependency — use project.dependencies.platform(…);
  debugImplementation is not on the handler (moved to a project-level
  dependencies block); androidTestImplementation dropped (no tests).
* ColorScheme is androidx.compose.material3.ColorScheme, NOT
  ui.graphics — desktop ships it inside material3-desktop, no extra
  artifact needed.
* AGP 8.7.2 > KGP 2.0.21's tested max 8.5 — warning only, same as
  the kapt modules; assembleDebug green.

Deliberate deferrals (documented in the build file): :core:domain is
still kotlin("jvm") so commonMain can't see it — NoteColors moves
when domain converts (M4.2, per the Phase-0 recommendation); screens,
ViewModels and AppContainer move with the container seam (M4.3).

Verified: ./gradlew :composeApp:compileKotlinJvm + assembleDebug +
:core:data-jvm:smoke (M1a PASS) + :desktopApp:run --self-test
(SELFTEST wrote note, clean exit) + git status clean over
core/**/objectbox-models (ID model file unchanged, invariant 2).
2026-10-06 12:15:15 +13:00