Uh oh!
There was an error while loading. Please reload this page.
feat(swift-ios): attach images pasted into the composer - #7601
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces a new feature (image paste support in the composer) with significant new logic including text reconciliation, async task lifecycle management, and paste text normalization. New features with this level of new state management and behavior warrant human review. An unresolved Medium-severity finding about potential ordinal collisions also requires attention. You can add or adjust custom eligibility rules. Learn more. |
Uh oh!
There was an error while loading. Please reload this page.
saphid
commented
Aug 20, 2026
Current-head paste-flow proof — |
36621f9 to
da648bbCompareThere was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit da648bb. Configure here.
| } else { | ||
| pendingItemsByOperation.removeValue(forKey: operation) | ||
| } | ||
| } |
There was a problem hiding this comment.
Ordinal collision after failed intake
Medium Severity
completeItem frees a pending slot on failure while the in-flight operation still assigns filenames from its original firstOrdinal plus offset. A concurrent paste or drop can then plan the same ordinal, so two attachments both land as the same Image N.jpg.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit da648bb. Configure here.
saphid
commented
Aug 27, 2026
Closing as superseded. The image-paste behavior shipped via merged #7607. The surviving real defect—attachment ordinal collisions during failed or concurrent intake—continues as the focused lane saphid/t3code-personal#153, to be fixed as a small PR against current main. |




Observed problem and reproduction
Paste an image into the native SwiftUI composer with the long-press menu or Cmd-V. Before this work, image-only pasteboards did nothing because SwiftUI cannot observe paste on iOS and
UITextViewhides its normal Paste entry for image-only content.The current head also covers related failures found after replacing the editor: marked-text composition could fight external SwiftUI binding changes, rich-text paste could retain attachments or styling, and asynchronous image intake could finish after the composer changed thread or project.
Cause
The composer used a SwiftUI text input with no UIKit
paste(_:)hook. Image attachments entered through picker, camera, and Files paths only. Replacing the input exposed ownership gaps around focus, IME reconciliation, paste normalization, task cancellation, and context-scoped result acceptance.Change and boundary
The composer now uses a
UITextViewwrapper that offers Paste for image content when the selected model accepts images. Pasted providers use the existing downscale, JPEG re-encode, thumbnail, andFeatureDraftAttachmentpipeline. Text-only paste delegates to normal behavior, then restores plain composer styling.A reconciliation state machine defers external rewrites during marked-text composition. Image intake tasks are keyed to the attachment context, cancelled on context change or disappearance, and rejected if stale. Multiple images preserve order up to the existing eight-image limit and disclose overflow.
Non-goals
No new attachment wire format, server behavior, provider-specific image list, or parallel upload path. Accompanying text from an image-bearing pasteboard is intentionally not inserted because copied images often also carry a URL. React Native mobile, web, and desktop are unchanged.
Affected areas
Affected client: SwiftUI mobile composer in both existing-thread and new-thread flows.
Platforms: iOS simulator and one physical iPhone acceptance record.
Providers: the UI gates paste on the selected model's existing image capability. No adapter changes.
Contracts/connections: existing attachment upload contracts and connection behavior are reused.
Validation
Current head:
da648bbd.xcodebuild test -only-testing:T3CodeTestson the recorded iOS 26.5 simulator: 291 tests across 33 suites passed,** TEST SUCCEEDED **, exit 0.ComposerImagePasteTests,FeatureComposerPowerTests, andAttachmentPreparationTests: 22 tests across 3 suites passed, exit 0.Risks, untested paths, and known gaps
Evidence
No current-head screenshots or video are embedded. Earlier light-only captures predated the current editor and growth semantics, so they are intentionally not presented as proof of this head.
Owning issue and stack
Owning issue: saphid/t3code-personal#126. This PR targets the open SwiftUI parent branch and depends on #5178 landing. It is not stacked on #7345. The owning queue marks it superseded by merged #7607. Maintainer edits are enabled.