Repository navigation
Integrate the real LUI Kotlin backend (KotlinHost) - #38
Merged
Merged
Conversation
- Bump the lui pin to 264aa9f67da0d0d3e413f9dfe970785e7286f23c (logseq/lui#135; re-pin to the merge SHA once that PR lands). - Rename every FlutterHost reference in shared/ to KotlinHost and android/flutter -> android/kotlin in extension profiles, fingerprints, and all flutter_* identifiers/comments; host code 4 now maps to KotlinHost (matching lui's components_bridge.ml table: 1 Web, 2 SwiftUI, 4 Kotlin, 6 GPUI), so iOS passes host code 2 and Android 4. - shared/: bare 'reactive' calls rewritten to Signal.map — the new lui.ppx expands bare reactive to dyn in element position while ~p:(reactive ..) labeled forms are kept for prop signals. - Delete the vendored android/lui module; :lui now resolves to ../lui/platform/android/lui via module include, the same consumption model as lui's examples/components/android. - LuiDispatch handles the widened LuiEvent sealed class (pointer, context-menu, load events have no chat FFI export and are dropped, matching upstream dispatchToBridge). - Disable :lui test tasks in this build; the backend's paparazzi tests need its standalone AGP 8.6.1 build. Verification: dune build @shared/native/runtest (719 tests), ./gradlew assembleDebug assembleProfile test all green against the real backend; profile APK runs on the chat_test emulator with a fresh x86_64 liblogseq_chat_core.so and renders the auth screen.
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
The minimal LuiExtensionRegistry.register overload defaults to an empty properties list, so every set-extension-prop op was rejected (e.g. native-navigation-stack.depth), leaving the retained tree wedged after the first navigation patch. Declare the schemas matching each fingerprint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates the real LUI Kotlin backend (logseq/lui#135, merged as
lui@afeb4cc) and renames the Android host profileFlutterHost→KotlinHostend to end. The vendoredandroid/luishim is gone;:luinow resolves to../lui/platform/android/luias a module include — the same consumption model as lui'sexamples/components/androidandapple/'s path-dep on../lui/platform/apple.logseq_chat.opam:luipin bumpeda2d1cfa→afeb4cc82c346deddb304248fd74d102b5907863(feat(android): Kotlin/Jetpack Compose backend lui#135, merged).components_bridge.mlin lui: 1 Web, 2 SwiftUI, 4 Kotlin, 6 GPUI):Native_bridge.host_kindis now the full table;logseq_chat_lui_initializecall sites usehostCode = 4on Android (LogseqChatNativeBridge.initialize) and2on iOS (LGChatRuntime.start— previously defaulted to1, which now resolves toWebHost).shared/: everyFlutterHost→KotlinHost,android/flutter→android/kotlinin extension profile strings and the fingerprint literals inapp_test.ml,apple/extension fingerprints, andChatExtensions.kt; allflutter_*identifiers renamed tokotlin_*.rg -il flutteris now zero outside.git/_build/duniverse.shared/reactive migration: the newlui.ppxexpands a barereactive f stodyn f s(element position,f : 'a -> t). All barereactivecalls feeding*_signalsetters andletbindings are now explicitSignal.map;~p:(reactive ..)labeled forms are unchanged so the ppx still produces prop signals.LuiDispatch: handles the widened upstreamLuiEventsealed class —PressDetail,Pointer{Down,Up,Enter,Leave},ContextMenuPress,PressModifiers,Loadare dropped because the chat FFI (logseq_chat_core_ffi.h) exports no entries for them, matching upstreamdispatchToBridge's treatment of unmapped events.android/settings.gradle.kts:include(":lui")withprojectDir = ../../lui/platform/android/lui.:luitest tasks are disabled in this build — its paparazzi suite needs the standalone AGP 8.6.1platform/androidbuild.Drift between my vendored
dev.luisurface and the real backendMinimal — every symbol the app imports (
LuiBackend,LuiEvent,LuiExtensionContext,LuiExtensionRegistry,LuiIconResolver,LocalLuiThemeDark) exists upstream with the same shape. The only deltas handled:LuiEventgrew the pointer/context-menu/load variants listed above.platform/android/lui/build.gradle.ktsappliesorg.jetbrains.kotlin.android+plugin.serialization+app.cash.paparazziunder AGP 8.6.1, while this app uses AGP 9.1 (android.builtInKotlin) — Gradle forbids mixed AGP versions in one build, and AGP 9 dropped thekotlin-androidplugin. To verify locally I edited the../luicheckout to drop those three plugin ids (no@Serializabletypes exist, and paparazzi is only needed by the backend's own tests). That edit is local-only — the lui repo should ship an AGP-9-compatible module build (or the host must stay on AGP 8).Verification
dune build @shared/native/runtest— 719 tests green.cd android && ./gradlew assembleDebug assembleProfile test— green against the real backend (:appunit tests pass;:luitests disabled as noted).test-android-native-script.sh,test-no-skip-support.sh,test-android-e2e-runner.shpass.liblogseq_chat_core.so(x86_64) + profile APK on thechat_testemulator: app launches,take_effect/apply_snapshot/apply_host_updatecycle confirmed in logcat, auth screen renders via the real backend:Link to Devin session: https://app.devin.ai/sessions/c2d54f90729342239d4afea72f403e41
Open in Devin Desktop: https://app.devin.ai/desktop/session/c2d54f90729342239d4afea72f403e41?variant=devin
Requested by: @tiensonqin