@devries-cameron20 / t3code-1 / commits / c5e6b24ff5
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(mobile): iOS multi-item text paste folds into an attachment (#37301)

Julius Marminge committed Nov 15, 2026 at 10:00 UTC c5e6b24ff5e1b752d91a75fa425322f5c90bf5cf
2 files changed +17 -1
apps/mobile/modules/t3-composer-editor/ios/T3ComposerEditorView.swift
+2 -1
@@ -250,8 +250,9 @@ private final class ComposerTextView: UITextView {
250 return
251 }
252 }
253 + // pasteboard.string is only the first item; super.paste inserts every text item.
254 if !bypassTextPasteInterception,
254 - let text = pasteboard.string, shouldInterceptTextPaste(text) {
255 + let text = pasteboard.strings?.joined(), shouldInterceptTextPaste(text) {
256 onPasteText?(text, selectedRange)
257 return
258 }
apps/mobile/modules/t3-composer-editor/tests/ios/main.swift
+15
@@ -237,6 +237,21 @@ for readOnly in [true, false] {
237 check(provider.loadCount == 0, "Locked inputs must not load pasted image providers")
238 }
239
240 +func interceptedPaste(_ items: [String]) -> String? {
241 + let savedItems = UIPasteboard.general.items
242 + defer { UIPasteboard.general.items = savedItems }
243 + let editor = ComposerTextView()
244 + editor.textPasteThresholdBytes = 32 * 1024
245 + var intercepted: String?
246 + editor.onPasteText = { text, _ in intercepted = text }
247 + UIPasteboard.general.items = items.map { [UTType.utf8PlainText.identifier: $0] }
248 + editor.paste(nil)
249 + return intercepted
250 +}
251 +let halfA = String(repeating: "A", count: 20_000)
252 +let halfB = String(repeating: "B", count: 20_000)
253 +check(interceptedPaste([halfA, halfB]) == halfA + halfB, "Text items that together reach the threshold must fold")
254 +
255 // Two-frame animated GIF: a mixed paste keeps the GIF's original bytes and the still image's PNG, in order.
256 private let gifBytes = Data(base64Encoded: "R0lGODlhAQABAIEAAP8AAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQACgAAACwAAAAAAQABAAAIBAABBAQAIfkEAAoAAAAsAAAAAAEAAQCBAP8AAAAAAAAAAAAACAQAAQQEADs=")!
257 private let gifProvider = NSItemProvider()