Phase 1 M2 task 4, desktop half (tools/DESKTOP_PHASE_PLAN.md §4). New
--backup-export-enc <path> + --backup-passphrase <pw> flags drive the
exact calls the RequirePassphrase/Passphrase dialogs make, headlessly.
Verified across two launches on fresh libraries:
run A: import plain(27) → reimport skipped=27 → exported-enc=27 magic ok
run B: preview encrypted=true → imported=27 → wrong-pw preview rejected
→ reimport imported=0 skipped=27
Gotcha found (and honoured): EncryptedBackupCodec zeroes the passphrase
CharArray in BOTH encrypt and decrypt — the array is single-use fuel.
The dialogs already comply (fresh toCharArray() per call); the scripted
block re-derives it via newPw() for the same reason.
Device half (4b: phone re-imports a desktop-made envelope + sees the
dedupe snackbar) follows on Waydroid with the M2 wrap-up.
Phase 1 M2 task 3 (tools/DESKTOP_PHASE_PLAN.md §4). Logic lives in
BackupBridge so both platforms get it through the one bridge:
- BackupBridge.import gains skipExisting (default true) and returns
ImportSummary(imported, skipped). A note is skipped when the library
already holds the key (createdAt, updatedAt, sha256(content)) — the
triple the export preserves verbatim, trustworthy only since the M2
import-timestamp fix. Keys are snapshotted BEFORE importing, so two
genuinely identical notes inside one file still both import into a
fresh library; only a second import of the same file is a no-op.
Snapshotted keys include trashed notes. skipExisting=false restores
the old additive behaviour (the documented override).
- Android: BackupManager.import passes the flag and returns the summary
(signature-identical call for SettingsViewModel); its snackbar now
reports the skip count. Screen layouts untouched — exit criterion
"Android backup screens unchanged" holds.
- Desktop: the import confirm dialog swaps its "duplicates persist"
warning for a working "Skip notes that are already here" checkbox
(default ON); scripted path prints the re-import outcome.
- Format unchanged: formatVersion stays 1 (streaming/dedupe-at-format
level stays a Phase-2 formatVersion=2 idea).
Verification passed: :core:data-jvm:backupSmoke (new step — re-import
skipped=27, override added 27, store=54; RESULT M2 round-trip PASS on
the real export) + :desktopApp:run --args="--data-dir /tmp/incido-m2t3
--backup-import <export> --backup-export … --exit-after 8" (imported=27
skipped=0 → exported=27 → reimport imported=0 skipped=27, clean exit) +
assembleDebug + :core:data-jvm:smoke + :desktopApp:run --self-test —
all green; output recorded in DESKTOP_FEASIBILITY.md.
Known limitation (by design): attachments are not in the key.
Phase 1 M2 task 2 (tools/DESKTOP_PHASE_PLAN.md §4): :desktopApp can now
speak the phone's backup format through the extracted bridge.
- New BackupActions.kt: top-bar overflow menu (Import from file… /
Export plain / Export encrypted). Import = AWT FileDialog ->
BackupBridge.preview -> passphrase dialog on INCDBK1 (wrong passphrase
stays open for retry) -> BackupPreview confirm dialog -> import.
Export = save-picker -> exportPlain / passphrase + exportEncrypted.
All heavy bridge calls run on Dispatchers.IO; results via Snackbar.
- Same package-level BackupBridge calls Android's BackupManager shim
makes — format shared by construction, not reimplementation. Android's
PassphraseDialog.kt deliberately NOT ported (M4 moves the real one to
common code).
- :desktopApp gains implementation(:core:backup).
- Scripted headless path for CI: --backup-import/--backup-export drive
the identical bridge calls without dialog clicking.
Verification passed: :desktopApp:run --args="--data-dir /tmp/...
--backup-import <real phone export> --backup-export /tmp/m2t4-exp.json
--exit-after 8" (preview 27 / imported 27 / exported 27, clean exit) +
:core:data-jvm:backupSmoke on the DESKTOP-written export (all PASS) +
python cross-check: notes (createdAt,updatedAt,content) and attachment
Base64 identical phone->desktop->phone + assembleDebug +
:core:data-jvm:smoke + :desktopApp:run --self-test — all green.
Output recorded in DESKTOP_FEASIBILITY.md (incl. one unreproduced
first-run exit hang to watch in M5).
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.