feat(phase-1/m1b): :desktopApp — desktop shell over the real repository

Phase 1 milestone M1b: a Compose Multiplatform window driven by the same
NoteRepositoryImpl the Android app uses, over its own ObjectBox library.

  DesktopContainer  mirrors AppContainer's construction order (store,
                    CipherHolder, repository). Owns its library at
                    $XDG_DATA_HOME/incido — a separate library per machine,
                    since ObjectBox is single-writer; the backup file (M2)
                    is the only bridge to the phone. --data-dir opens
                    another library, e.g. one pulled off a phone.
  Main.kt           two panes, save-as-you-type with a 400ms debounce,
                    favourite toggle. Material 3 defaults on purpose: the
                    app's theme and screens arrive with the M4 composeApp
                    conversion, which deletes this stand-in.

Verified headlessly (--self-test drives the same repository calls the "+"
button and the star make, --exit-after auto-closes), against a library
previously written by :core:data-jvm:smoke — i.e. a different module's
generated MyObjectBox, same schema:

  RENDER notes=0 selected=null    first frame (collectAsState initial value)
  RENDER notes=1 selected=1       ObjectBox flow delivered
  SELFTEST wrote note id=2        write path through the UI's own calls
  RENDER notes=2 selected=2       and it came back through the flow
  reopen -> RENDER notes=2        persisted

Gotcha recorded in the findings doc: the first composition always sees the
empty initial value of collectAsState, so anything asserting on note counts
must watch the flow rather than the first frame.

Still synthetic: theme + screens. Not wired yet: settings, encryption (M3),
backup bridge (M2), packaging (M5). assembleDebug verified green.
This commit is contained in:
Incido Developer committed 2026-10-05 18:28:24 +13:00
1 parent 9fe4763aa7
commit 5f45b0921b
7 files changed
+442

No files matched your search

+30
View File
@@ -233,3 +233,33 @@ Also fixed while here: `.gitignore` had `**/objectbox-models/`, which meant the
schema contract was **not in version control** — a fresh clone regenerated
UIDs. `default.json` is now tracked (everything else in that directory stays
ignored). This matters more now that two modules generate against it.
**M1b — desktop shell over the real repository: DONE.** New `:desktopApp`
(Compose Multiplatform, `compose.desktop` DSL, no explicit `application`
plugin — see the spike finding). `DesktopContainer` mirrors Android's
`AppContainer` construction order and owns its own library at
`$XDG_DATA_HOME/incido`; `--data-dir` opens any other library.
Verified headlessly (`--self-test` drives the same repository calls the "+"
button and the star make, `--exit-after` auto-closes):
```
library : /tmp/incido-desktop-smoke # written by :core:data-jvm:smoke
RENDER notes=0 selected=null # first frame (collectAsState initial)
RENDER notes=1 selected=1 # ObjectBox flow delivered
SELFTEST wrote note id=2 # write path through the UI's calls
RENDER notes=2 selected=2 # and it came back through the flow
--- reopen ---
RENDER notes=2 selected=2 # persisted
```
Two things that run proves beyond what the spike did: the desktop build reads a
library written by a *different* module's generated `MyObjectBox` (one schema,
two codegens), and ObjectBox's reactive flow feeds a Compose Desktop
composition. Note the first frame is always the empty initial value — anything
asserting on note counts must wait for the flow, not the first composition.
Still synthetic in this build: the theme (Material 3 defaults, not Incido's)
and the screens (this is a two-pane stand-in). Both are replaced by the M4
`composeApp` commonMain conversion. Not yet wired: settings, encryption (M3),
backups (M2), packaging (M5).