Skip to content

fix(app): allow partial text selection on the markdown copy screen - #1449

Open
chphch wants to merge 1 commit into
slopus:mainfrom
chphch:fix/841-android-text-selection
Open

fix(app): allow partial text selection on the markdown copy screen#1449
chphch wants to merge 1 commit into
slopus:mainfrom
chphch:fix/841-android-text-selection

Conversation

@chphch

@chphch chphch commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The long-press "copy markdown" screen (text-selection.tsx) rendered the raw markdown in a read-only <TextInput editable={false}>. On Android a non-editable TextInput is not selectable at all, so the only copy path was the "Copy All" header button — there was no way to grab just a paragraph or a single line. This swaps it for a selectable <Text>, which brings up the native selection handles + copy toolbar on Android and iOS, so the markdown source is now partially selectable and copyable. The "Copy All" header button is unchanged.

This addresses the most acute part of #841 ("markdownCopyV2 only copies entire response"): once you're on the text-selection page you can now copy a portion instead of all-or-nothing. The broader ask in #841 — inline arbitrary selection directly on the rendered message and touch-visible per-block copy buttons — is left to a follow-up, since markdownCopyV2 intentionally disables inline span selection (so the native copy menu doesn't race the long-press gesture).

Verification

This is Android/iOS-native selection behaviour — the broken state (a non-editable TextInput being unselectable) only manifests on a touch device; on web the text is always selectable, so the web test harness can't exercise it. Checked: pnpm typecheck clean, and the change is the documented RN pattern for selectable read-only text (<Text selectable>). On-device repro: long-press a message → "copy markdown" screen → drag the selection handles over part of the text → native Copy.

The long-press "copy markdown" screen (text-selection.tsx) rendered the
raw markdown in a read-only <TextInput editable={false}>. On Android a
non-editable TextInput cannot be selected at all, so the only way to copy
was the "Copy All" header button — there was no way to copy just part of
the text.

Render the source as a selectable <Text> instead, which brings up the
native selection handles + copy toolbar on both Android and iOS, so users
can drag-select and copy a portion. The "Copy All" header button is
unchanged.

Addresses slopus#841 (the text-selection screen specifically — partial selection
now works there; inline per-paragraph selection on the message itself is
still tracked by the issue).
@chphch
chphch force-pushed the fix/841-android-text-selection branch from 8dd26e7 to bedffa7 Compare July 26, 2026 22:44
@chphch

chphch commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (3c0155c2) — was conflicting. Force-pushed, single commit.

Only the import line conflicted: main now uses Platform in this screen (the glass surface / platform-specific styles), while this PR drops TextInput. Kept Platform, dropped TextInput; the rest of the commit applied unchanged.

pnpm typecheck clean, app suite 779/779.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant