Repository navigation
Fix Android editor flicker and layout alignment - #163
Merged
Merged
Conversation
Comment on lines
+423
to
+433
| val inputTransformation = remember { | ||
| InputTransformation { | ||
| val boundary = nativeValue.prefix.length | ||
| if (boundary > 0) { | ||
| if ((0 until changes.changeCount).any { changes.getOriginalRange(it).min < boundary }) { | ||
| revertAllChanges() | ||
| } | ||
| selection = TextRange(selection.start.coerceAtLeast(boundary), selection.end.coerceAtLeast(boundary)) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
🔍 Prefix guard reverts whole IME batch on boundary edits
The guard in inputTransformation calls revertAllChanges() when any change's original range starts inside the retained prefix. An IME batch that both touches the prefix and inserts new editable text loses the new text too. Normal typing appends past the boundary, so this needs confirmation only for autocorrect or composition that spans the split.
Was this helpful? React with 👍 or 👎 to provide feedback.
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.
Switching directly from editing block A to block B briefly rendered A's text in the reused editor. Apply the incoming block identity, title, and caret before drawing its first frame. Keep the source text and caret stable during Enter handoff, including rapid input.
The Android layout changes also center the sign-in label and flashcard completion state, give the encrypted-graph unlock form equal horizontal insets with reachable keyboard actions, and set Favorites and Recent page rows to 48 dp. The layout changes are conditional on the Kotlin host.
Use matching typography for block reading and editing, Logseq's selected menu colors, and a 24 dp page-reference toolbar icon. The delete menu targets the displayed block after its route opens and confirms with Delete block?.
The direct editor-switch, completion-centering, unlock-inset, and sidebar-spacing failures were reproduced before fixing them. Local validation passed 33 Android test cases and all 1,302 OCaml core tests. Android tests cover the first frame of direct editor switching, repeated taps between two blocks while retaining native editor identity, Enter input buffering, text layout, empty-state centering, unlock form insets with the keyboard open, and sidebar row spacing.
Four broader Android checks also fail on main, covering search dismissal, toolbar height, an external caret request, and the long sync-error scroll target. These baseline failures were verified separately.