Repository navigation
Conversation
The paste interceptor read only item 0 of the clip, so a folded or input-limited paste silently dropped every later item. Join all URI-free text items with newlines, as Android's native paste does, before the size checks and event emission. Any URI item still leaves the whole clip to the native path, with no provider read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
Android composer paste interception read only
ClipDataitem 0. If that item triggered interception, trailing text items were silently dropped. A clip with a later URI item could also be partially intercepted, consuming the clip while forwarding only the first item's text.Change
Join all text items in a URI-free clip with newlines before the existing input-length and byte-size checks, then emit the complete joined text. If any item has a URI, leave the entire clip on the native paste path. The helper checks each URI before coercing that item, so clipboard measurement makes no content-provider reads.
Scope and approval
This is a small, focused fix for obvious clipboard data loss under the exception in CONTRIBUTING.md. The two changed files are
T3ComposerEditorView.kt, which owns clipboard extraction, and its existingComposerPasteTest.ktregression suite in the Android composer module.The overlap audit found #19114 unrelated to this fix. It changes Office-file preloading. #15030 and #18752 share the Android editor file but change hardware Return submission and touch/caret scrolling, respectively. Neither changes clipboard extraction or paste interception.
Verification
Five new Robolectric API-36 cases cover complete multi-item interception, native fallback with a URI in any item position, empty text, zero items, and single-item native paste with Undo. With JDK 21, the focused command from
apps/mobile/androidwas./gradlew :t3-composer-editor:testDebugUnitTest --tests 'expo.modules.t3composereditor.ComposerPasteTest' --console=plain.With the base production file at
7ac952cand the same regression tests, 11 tests ran and two failed, exposing dropped trailing text and interception of a clip with a later URI. With the candidate production file, all 11 tests passed.git diff --checkpassed. ktlint was unavailable and was not run.Device check
On Android 16 / API 36, both debug APKs used the same seeded, URI-free, three-item Android
ClipData. Each run pasted into an empty composer through the real native long-press menu's Paste action.7ac952c40531aa68986ca2a18c224edcbefefc723efb248851773734c511d46fa2afd0952590aa74eb3bdce2812171b7cdc0cb7a404127092d89895908f25d15c42b3c3f273318The app-produced file bytes exactly matched the seeded first item before and the complete newline-joined clip after. Attachments to embed when posting:
ITEM_2andITEM_3below the first item.Production fix
1b40176written with Claude Opus 5.5 viaclaude_autousing the Claude Code harness; tests52590aawritten with GPT-6.1 Sol using the Codex harness, both in T3 Code.