Add cross-platform folder/file picker for local backup export in Kotlin Multiplatform
Session from pi-coding-sessions on Hugging Face by championswimmer · MIT · condensed by Coders Talk
Let users pick the folder/file location when exporting a local backup, instead of always saving to a fixed path, and make this work across Android, iOS, Desktop and Web.
- +0Prompt · +0In local file backup we don't let users pick the export folder. Research KMP file/folder picker options via Perplexity, then implement picking the export location.
- +0mAgent did · +0mResearched KMP file/folder picker options via Perplexity (after fixing tool call errors), landed on FileKit as the best cross-platform library, explored its source for save/directory picker APIs, then implemented a JFileChooser-based picker for desktop's LocalFileBackupTransport.
- +4mPrompt · +4mMake this fully cross platform so Android, iOS and Web can also pick the export location, not just desktop.
- +4mAgent did · +4mExplored DI modules per platform, integrated FileKit for Android/iOS/Desktop, and built a custom TypeScript/wasm interop layer with the File System Access API (showSaveFilePicker) for Web. Added expect/actual LocalBackupPicker files per platform, wired new backup modules into Koin DI across all four platforms, added FileKit gradle dependencies, and iteratively fixed compile errors (base64/blob conversions, TS return types) until all targets compiled.
- +13mAgent did · +13mRemoved the old desktop-only LocalFileBackupTransport.kt now that a shared PickerLocalBackupTransport replaced it, verified no dangling references, and re-ran builds for desktop, wasm, Android and iOS to confirm everything compiled after cleanup.
- +15mPrompt · +15mRename PickerLocalBackupTransport to LocalFileBackupTransport, it's not self-explanatory. Simple rename refactor.
- +15mAgent did · +15mRenamed the file and class, updated all imports and instantiation call sites across Android, iOS, Desktop and Wasm DI modules, then recompiled all four targets to confirm the rename didn't break anything.
- +16mOutcome · +16mCommitted and pushed 19 files changed (422 insertions, 131 deletions) to arnav/mutli-backup-transports, with successful compiles across desktop, wasm, Android and iOS simulator targets.
Next time I'd just say upfront that the picker needs to work on Android, iOS and Web too, not just desktop — that would have saved a whole extra research and implementation pass. Asking the agent to research via Perplexity first was useful since it found FileKit, which handled most platforms, but Web still needed custom TypeScript interop for the File System Access API. The rename request at the end was quick and clean since the agent updated every call site and reverified builds.