fix(swift-ios): enable granular text selection - #6110
Draft
saphid wants to merge 2 commits into
Draft
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 |
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.
What Changed
Why
The native SwiftUI thread view only offered whole-message copying. People could not select a word, sentence, or code fragment with standard iOS selection handles.
This adds granular native selection while keeping message-level copy actions, streaming updates, accessibility actions, safe link routing, and the existing Markdown layout behavior.
Closes #6089.
UI Changes
Long-pressing rendered assistant prose or code now shows the native iOS selection handles and edit menu (Copy, Look Up, Translate). The appearance of messages is otherwise unchanged.
Verified in the iOS Simulator inside a live thread: native selection appeared on prose and the existing code-block controls remained available. A physical-phone acceptance pass will be attached after the approved-based combined build is installed.
Verification
MarkdownDocumentTests: 15 passed, 0 failed on iOS Simulatorgit diff --check: passedChecklist
Implemented with GPT-5.6 Sol in T3 Code/Codex. Independently reviewed by Claude Opus 5 high.
Note
Enable granular text selection in chat markdown messages
Text-based inline rendering withUITextView-backedMarkdownInlineTextviews, enabling native text selection across all block types (paragraphs, headings, lists, tables, code blocks).MarkdownSelectionContextandMarkdownSelectionSourceto propagate copy action metadata and stable selection state through the block view hierarchy.MarkdownSelectableTextAttributesto buildNSAttributedStringwith dynamic type fonts, colors, links, and code styling for selectable rendering.MarkdownSelectionRestoration, which restores ranges only when new text safely extends the previous content.codestyle toMarkdownInlineStylewith monospacedUIFontresolution, and pre-renders code block inline runs inMarkdownRenderCachefor reuse.onDismissKeyboardinstead of callingwindow.endEditingdirectly.Macroscope summarized f2657ef.