fix(app): native iOS text selection in assistant messages via UITextView

Fixes #238
Fixes #648
Refs #21
This commit is contained in:
Li Mu Zhi
2026-05-27 04:55:46 +00:00
committed by GitHub
parent 1908ab8765
commit 8aa1530be1
8 changed files with 134 additions and 16 deletions
@@ -8,6 +8,7 @@ import {
type ViewStyle,
} from "react-native";
import { StyleSheet } from "react-native-unistyles";
import { MarkdownTextSpan } from "@/components/markdown-text";
import * as Clipboard from "expo-clipboard";
import { Check, Copy } from "lucide-react-native";
import { highlightCode, type HighlightToken } from "@getpaseo/highlight";
@@ -119,7 +120,7 @@ export const HighlightedCodeBlock = React.memo(function HighlightedCodeBlock({
onPointerLeave={handlePointerLeave}
>
{keyedLines ? (
<Text style={innerTextStyle}>
<MarkdownTextSpan style={innerTextStyle}>
{keyedLines.map((line, lineIndex) => (
<React.Fragment key={line.key}>
{lineIndex > 0 ? "\n" : null}
@@ -128,9 +129,9 @@ export const HighlightedCodeBlock = React.memo(function HighlightedCodeBlock({
))}
</React.Fragment>
))}
</Text>
</MarkdownTextSpan>
) : (
<Text style={innerTextStyle}>{code}</Text>
<MarkdownTextSpan style={innerTextStyle}>{code}</MarkdownTextSpan>
)}
<CopyButton getCode={getCode} visible={controlsVisible} />
</View>