Repository navigation
fix: smooth Android bottom tabs during IME dismissal #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d30f330
7d2f219
886859b
49f8d71
89125c3
2d021f8
39b23a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package com.logseq.logseq.ui.extensions | ||
|
|
||
| import androidx.compose.runtime.compositionLocalOf | ||
| import kotlinx.coroutines.flow.MutableSharedFlow | ||
| import kotlinx.coroutines.flow.SharedFlow | ||
|
|
||
| internal class ImeDismissalSignal { | ||
| private val mutableStarted = MutableSharedFlow<Unit>(extraBufferCapacity = 1) | ||
| val started: SharedFlow<Unit> = mutableStarted | ||
|
|
||
| fun notifyStarted() { | ||
| mutableStarted.tryEmit(Unit) | ||
| } | ||
| } | ||
|
|
||
| internal val LocalImeDismissalSignal = compositionLocalOf<ImeDismissalSignal?> { null } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -409,7 +409,6 @@ private fun NavigationBoundary(context: LuiExtensionContext) { | |
| // route; count=0 asks the core to settle instead of popping. | ||
| val backDepth = context.int("back-depth") ?: depth | ||
| val dismissesComposer = context.flag("composer-dismissal-enabled") | ||
| val occupies = context.flag("bottom-occupies-layout-space") | ||
| BackHandler(enabled = !LocalSidebarBlocksMain.current && (backDepth > 0 || dismissesComposer)) { | ||
| if (dismissesComposer) { | ||
| context.emit("dismiss-composer") | ||
|
|
@@ -431,26 +430,20 @@ private fun NavigationBoundary(context: LuiExtensionContext) { | |
| if (childIds.size == 2) { | ||
| // Second child is the bottom chrome. Hoist it out of the content | ||
| // column like iOS's safeAreaInset/overlay so the composer's | ||
| // internal `grow` props can't starve the journal. Unbounded | ||
| // height keeps it at natural size without querying intrinsic | ||
| // measurements unsupported by subcomposed LUI layouts. | ||
| if (occupies) { | ||
| Column(Modifier.fillMaxSize()) { | ||
| Box(Modifier.weight(1f)) { NavigationContent(context, childIds[0], dismissesComposer) } | ||
| Box(Modifier.wrapContentHeight(unbounded = true)) { | ||
| context.child(childIds[1]) | ||
| } | ||
| } | ||
| } else { | ||
| Box(Modifier.fillMaxSize()) { | ||
| Column(Modifier.fillMaxSize()) { NavigationContent(context, childIds[0], dismissesComposer) } | ||
| Box( | ||
| Modifier | ||
| .align(Alignment.BottomCenter) | ||
| .wrapContentHeight(unbounded = true), | ||
| ) { | ||
| context.child(childIds[1]) | ||
| } | ||
| // internal `grow` props can't starve the journal. Keep the | ||
| // content viewport full-size even when the core reserves space | ||
| // for editor chrome; resizing it during IME dismissal moves the | ||
| // edited block while the keyboard is still animating. Unbounded | ||
| // height keeps the chrome at natural size without querying | ||
| // intrinsic measurements unsupported by subcomposed LUI layouts. | ||
| Box(Modifier.fillMaxSize()) { | ||
| Column(Modifier.fillMaxSize()) { NavigationContent(context, childIds[0], dismissesComposer) } | ||
| Box( | ||
| Modifier | ||
| .align(Alignment.BottomCenter) | ||
| .wrapContentHeight(unbounded = true), | ||
| ) { | ||
| context.child(childIds[1]) | ||
|
Comment on lines
+439
to
+446
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Autocomplete covers the final block When a user types Devin left this for you to triage: Autocomplete can still overlay the final block because Android now overlays chrome without giving the scroll content a matching bottom inset. I recommend a human decide whether this blocks the PR; the correct fix is a measured scroll-content inset/dynamic spacer rather than restoring viewport resize during IME dismissal. Learn moreThe Android navigation stack puts editor chrome in its second child. That chrome stacks autocomplete above the editor toolbar. The outliner ends with a spacer that measures 120 dp on Android, while the suggestions panel measures 220 dp before counting the toolbar. When the chrome overlays the list, a short final row on a long page cannot scroll high enough to clear the suggestions. The previous reserved-height layout placed the list above the panel. Example: Scroll to the end of a long page, edit its final one-line block, and type Recommended fix: Keep the viewport size stable, but give the scrollable content enough bottom clearance for the actual overlay height. Ensure caret reveal accounts for that occluded region when suggestions open. Add a test that edits the last row of a long page with suggestions visible. Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| } | ||
| } | ||
| } else { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Required inline video attachment missing
The PR provides external WebP embeds, not the required GitHub video attachment with verified inline playback.
Devin left this for you to triage: The PR includes inline animated evidence, but not the repo-required GitHub mp4 attachment: both available GitHub tokens were rejected with 403 when gh --attach tried to upload the videos. A human with repository upload access should attach the mp4s or grant the automation permission.
Was this helpful? React with 👍 or 👎 to provide feedback.