Skip to content

fix: smooth Android bottom tabs during IME dismissal - #299

Open
tiensonqin wants to merge 7 commits into
mainfrom
devin/1795827363-android-ime-bottom-tabs
Open

tiensonqin wants to merge 7 commits into
mainfrom
devin/1795827363-android-ime-bottom-tabs

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Android now keeps the outliner viewport full-size while editor chrome appears or disappears, matching the iOS overlay model instead of relayouting the journal when bottom-occupies-layout-space changes. This prevents the edited block and caret from moving while the IME is still animating.

The root Compose host also detects the start of an IME hide animation with WindowInsetsAnimationCompat and notifies the focused outliner editor immediately. The editor keeps an animated-inset watcher as a fallback for hosts/tests without that signal, replacing the previous visibility-plus-300ms path that reached the core only near the end of the keyboard transition. Before closing editing it flushes pending input after structural handoff reconciliation, and it abandons a stale dismissal if the IME rises again during quick reopening or a canceled Back preview.

Added an Android regression test covering the stable outliner viewport invariant.

Evidence

Final end-to-end validation at 39b23a37:

Final IME validation

Final validation key frames

Android Back before:

Android Back before

Android Back after:

Android Back after

Toolbar Hide keyboard after:

Toolbar Hide keyboard after

Validation

  • python3 scripts/test-android-jni-boundary.py: pass
  • python3 scripts/test-android-native-packaging.py: pass
  • ./gradlew -PlogseqAndroidAbi=x86_64 :app:testDebugUnitTest: pass
  • AndroidEditorKeyboardTest: 32/32 pass
  • AndroidOutlinerToolbarTest#editorChromeDoesNotResizeTheOutlinerViewport: pass
  • Emulator end-to-end validation at 39b23a37: rapid input before Android Back persisted, the edited block position stayed stable, bottom tabs returned during both IME dismissal animations, quick reopening worked after both paths, and Enter immediately followed by Back completed without visible text loss.

Shared core files were unchanged in the final diff, so dune build @shared/native/runtest was not required.

Not verified: the PERFORMANCE.md release-device comparison on a representative large graph with RTC active. Validation here used the API 36 emulator with a debug build and a small disposable graph; input-loss and transition timing were checked, but release latency/stall measurements remain unverified. Predictive-Back cancellation was covered in implementation logic but not separately gesture-tested.

Known pre-existing test failures

The full AndroidOutlinerToolbarTest class still has 2 failures (editorUsesTheNativeFloatingToolbarContainer and anExternalCaretRequestStillUpdatesTheNativeEditor). I ran the same class against the unmodified base revision and it failed with the same 2 assertions, so they are not introduced by this change.

Link to Devin session: https://app.devin.ai/sessions/c99e7ff785234cef9c1a3e8ca38fc944
Open in Devin Desktop: https://app.devin.ai/desktop/session/c99e7ff785234cef9c1a3e8ca38fc944?variant=devin
Requested by: @tiensonqin


👀 2 findings for you to triage · Follow Devin's work

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

Devin Review found 6 findings. Devin fixed 4 findings; 2 findings are left for you to triage below.

Fixed by Devin (4)
  • Release-device editing validation not documented — The PR now explicitly documents that release-device large-graph RTC latency measurements were not run and what remains unverified.
  • Release editing measurements not documented — The PR now explicitly documents the missing release-device large-graph RTC comparison and the debug-emulator/small-graph verification scope.
  • Keyboard dismissal drops buffered split text — Fixed by using the existing guarded NativeEditorInput flush, which never publishes the visible suffix over a pre-split block during a handoff.
  • Canceled Back gesture ends editing — Fixed by ignoring transient inset reductions while the root animation signal is available unless the IME reaches zero.

View findings in Devin Review · Follow Devin's work

Devin Review

Copy link
Copy Markdown
Contributor

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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +439 to +446
Box(Modifier.fillMaxSize()) {
Column(Modifier.fillMaxSize()) { NavigationContent(context, childIds[0], dismissesComposer) }
Box(
Modifier
.align(Alignment.BottomCenter)
.wrapContentHeight(unbounded = true),
) {
context.child(childIds[1])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Autocomplete covers the final block

When a user types / in the final short block of a long page, NavigationBoundary overlays that block with suggestions. The 120 dp end spacer cannot scroll the block clear of the 220 dp suggestions panel.

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 more

The 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 / after a space. The suggestions overlay the block even at the end of the scroll range, where the user needs to see and place the caret.

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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 findings. All 2 findings are left for you to triage in Devin Review.

View findings in Devin Review · Follow Devin's work

Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant