Skip to content

fix(mobile): copy complete chat replies and loaded markdown - #26152

Merged
brennanb2025 merged 11 commits into
mainfrom
brennanb2025/ipad-chat-copy
Oct 12, 2026
Merged

brennanb2025 merged 11 commits into
mainfrom
brennanb2025/ipad-chat-copy

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1091 $\color{#cf222e}{\Huge{\mathbf{−}}}$​30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1061
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​248 $\color{#cf222e}{\Huge{\mathbf{−}}}$​75 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​173

ELI5

iPad users cannot easily transfer a complete formatted reply or Markdown preview into another chat. Formatted text spans separate selection areas, chat lacked whole-message Copy, and the open Markdown document hid Copy for ordinary editable files. This PR adds current-source Copy to those surfaces. The latest correction replaces mobile’s wide labeled message control with the compact Copy icon used by desktop chat.

What Changed

Copy sits below sent messages and replies at their existing edges, shown only after you tap that message (another tap hides it), the touch version of desktop's hover-only copy. Holding on text still selects it as before; a held press never toggles Copy. Full messages and full Markdown previews use a 24px button with a 14px lucide Copy icon that briefly becomes a green Check after a successful write. Message Copy retains Markdown, code, tables and list indentation from the current ordered text blocks, excluding tools and attachments. The action takes the current source when tapped. The existing copier now requires the message kind: literal visual-instruction text stays intact in your own messages, while agent replies keep omitting embedded-visual instructions outside fenced code. This also keeps Copy available when an own message consists only of that literal text.

File-preview Copy uses loaded source in both rendered and source mode; partial files still say “Copy loaded.” The open document keeps its existing labeled Copy action and copies the current local buffer, including unsaved edits, without saving. Android keeps its message action drawer. The correction leaves message structure and bubble styling untouched.

Both file-opening routes grant the existing device clipboard writer, so paired-web preview Copy reaches the device. Refused web copies show the existing compact mobile failure treatment: red Copy with “Couldn't copy” for accessibility; partial controls retain “Failed.” Native refusals retain the alert. A refused write still reports failure if a reply changes during the attempt, while a source change clears an old success confirmation.

Intended differences from desktop: touch-first native and paired-web Copy stays visible, including when using an iPad trackpad; desktop reveals controls on hover where supported. Mobile retains visible failure feedback, while desktop chat silently catches rejection. Partial-source labels disclose the loaded limit, and the ready-document reader keeps its existing action/toast alongside Save and Discard; desktop has no equivalent whole-document source Copy control. No new timestamp, scroll control or selection view is added.

Why

Whole-source Copy gives the iPad a direct transfer action while preserving native formatted text and its existing selection controls. The existing source serializer, viewing-device clipboard writer and document action keep copying independent of rendering and saving. The compact icon matches desktop chat without changing that proven behavior.

Continuous selection across formatting and a separate “Select text” view remain deferred; the new view awaits Brennan’s decision.

Linked Issue

Reported in the iPad chat feedback, items 1 and 8. No separate issue was opened.

Visual Proof

Tap to show Copy (ed71125 + de9fa38), iPad Pro 11" simulator, iPadOS 26, paired to the mock host. Copy stays hidden until you tap a message; another tap hides it. Holding on text still selects it with the system menu and no longer toggles Copy.

No copy icons until a tap Tapped reply: Copy under that reply only Long press selects "check"; no Copy toggled
proof-1-hidden-until-tap.png proof-2-tapped-reply-shows-copy.png proof-3-long-press-selects-no-toggle.png

Also checked on that simulator: Copy on your own message and on a reply each put exactly the message text on the clipboard (read back with simctl pbpaste), with the green check; dragging a selection handle extends the selection; scrolling by dragging on messages moves the list without showing any copy icon. Not checked: VoiceOver, and a physical iPad with Magic Keyboard/trackpad.

Before: native iPad chat without whole-message Copy

Native transfer proof on the prior behavior head 39f5b23: portrait reply Paste, own-message Paste, landscape reply Paste, and README Paste in rendered and source modes.

The earlier M4Air Release run used an iPad Pro 13-inch (M5) simulator on iPadOS 26.5 and the real iOS long-press Paste action; every listed pasted value matched the expected Markdown exactly at 39f5b23.

Native evidence below is from 0783f30, before the tap-to-show change at ed71125; it shows the icon-only controls below replies on the left and own messages on the right, with a green Check after Copy. The second image shows a real native Paste into another chat’s composer, retaining the Markdown table pipes and closing prose. The coordinator recovered and checksum-verified these images after the driver reached its provider limit; I also inspected both images.

Final head: icon-only Copy and green Check

Final head: native Paste retains Markdown table source

Final-head QA limits: the complete pasted value was compared only at 39f5b23. The own-message literal visual-instruction Paste was not exercised on device and is covered by unit/consumer tests. The README preview icon was not re-captured at 0783. Native QA is accepted with those gaps stated.

Testing

  • Native transfer manually tested at 39f5b23 as listed above
  • Automated tests added/updated
  • Final-head message icon checked, with the QA limits above

At 0783f30, 148 focused tests in 15 files pass, along with mobile production typing, the existing 950-file test typing gate, lint, formatting and changed-code checks. The preceding integration also passed 34 web permission cases. A fresh reviewer passed 13 independent cases covering exact own source, directive-only Copy, agent filtering, fenced code, whitespace and both existing message-copy paths. Eight earlier headless Chromium cases verified the unchanged icon component with actual lucide SVG and an injected device boundary. Those cases prove component behavior, not native rendering or OS clipboard contents.

The required repository wrapper completed 22/23 checks, including full root typing. Its sole failure is five native import-cycle warnings in source and audit configuration identical to current main; no suppression, dependency or lockfile change was committed.

Before marking ready, CI on 0783f30 finished: 18 checks passed, 19 expected draft/event/scope checks were skipped, and none failed or remain pending. PR checks and Mobile CI passed, along with the supporting checks. Ten unit-test shards passed 113,174 tests, mobile passed 10,270 tests, and the browser suite passed 490 tests. The previously failing HTML-preview cases passed on Chromium and WebKit; the earlier failure’s runtime cause remains unresolved. CI’s native lint audit passed with zero warnings or errors. The stale label assertion is corrected and the already-landed main lint fix is included through one approved main sync. Native QA is accepted with the limits stated above; the PR is ready for review.

After marking ready, the two readiness runs completed: 3 checks passed and 21 were skipped, with none failed or pending. Readiness PR checks explicitly reused the successful required tests for the identical source and workflow; its repository checks and aggregate still ran. Headless scope detection found no affected inputs. The other skips were explained by scope or workflow dependencies; they do not establish platform or full-app coverage. Across both events, the raw record contains 21 successes and 40 expected skips, including historical same-head rows—not 61 fresh executions.

Review

Fresh functional and eight-area readiness reviews, without counsel as requested, accepted the final source with no open proven P0–P2 finding. Integration review reproduced a P2 own-message copy omission; the role-aware copier fixes it with failing-before and passing-after cases through both existing message actions. The stale visible-label assertion is also corrected. Earlier streaming failure, test typing, preview permission and invisible web failure defects remain fixed. One small success accessibility-name consistency nit is deferred: the result value says “Copied,” while the control’s original name stays “Copy message.” No newly lost functional announcement was demonstrated. The architecture review of the whole-source approach remains settled. No merge or auto-merge is authorized.

Agent skill upstream boundary

  • Not applicable.

Notes

Loaded SSH and folder-workspace content uses the existing viewing-device clipboard path; no remote protocol, persistence, dependency or native execution behavior changed. No end-to-end SSH session was run. Older shells retain the existing native-screen fallback when they cannot provide a route’s required clipboard permission.

The existing Android drawer’s mounted-source behavior is deferred. The listed native cases do not establish unsaved-reader Paste, physical Magic Keyboard/trackpad selection or native frame/battery performance. A dedicated Windowed Apps flow was not tested; the final screenshots show an iPad app window. Windows/Linux/WSL runtime, packaging, Android device execution and full paired-shell navigation were not exercised for this visual correction.

Checklist

  • Focused change with problem, user-facing outcome and approach explained
  • Native transfer and final message-icon evidence attached, with limits stated
  • Source review complete and proven functional findings resolved
  • Cross-platform and SSH/folder impact considered
  • Local outcomes and limitations classified above
  • Exact final-source CI and readiness-triggered checks completed
  • Final-head native evidence accepted with the limits above

@brennanb2025

Copy link
Copy Markdown
Contributor Author

On iPad, replies lack whole-message Copy and formatted text is difficult to transfer into another chat. This draft adds current-source Copy for replies and sent messages, loaded markdown file previews, and unsaved open documents; continuous text selection remains separate work.

Streaming updates no longer hide a pending native copy failure, and the three added tests’ type errors are fixed at 9e4d354cdb59. Two P2, cause: PR findings remain open:

  • MobileFileMarkdownPreview.tsx:70: the new Copy action reaches the device writer, but preview/explorer web routes lack its clipboard permission. Actual-module direct-preview/explorer tests make zero device calls; CI independently names the missing permission. Correct the route/navigation contract and update the old no-clipboard expectation.
  • MobileSourceCopyButton.tsx:58: failed web writes call an empty alert implementation. Real writer rejection and written: false cases show no dialog or alert and leave Copy unchanged. Reuse visible feedback while preserving the corrected operation lifetime.

Mobile CI passes production typecheck, the unchanged test typing gate and 10,137 tests (six skipped). All 21 checks finished: four passed, 15 skipped, two failed. The web job detects the preview mismatch, and aggregate verification propagates it. This is a new PR failure against main’s source/test contract; no equivalent main suite was run or claimed green.

Fresh whole-PR review stopped on these findings. Source readiness checks completed without counsel, but native AFTER Copy/paste, windowed layout and physical Magic Keyboard input are unverified. The helper failures are an evidence gap, not a reproduced Copy failure. Cross-format selection and baseline Android drawer streaming-copy staleness are deferred. Keep this draft; nothing was merged or set to auto-merge.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

iPad users had no simple way to transfer a complete formatted reply or loaded Markdown into another chat. This PR adds source Copy beside replies and sent messages, in both file-preview modes, and in the ready document reader, including unsaved edits. It preserves Markdown/code/table/list source and uses the existing device clipboard and document actions.

Fixed the streaming failure-feedback race, the new test typing errors, and both reviewed P2 web defects: file-opening routes now grant the existing clipboard writer, and web refusals visibly say Failed on the same Copy control. Fresh whole-PR and readiness reviews found no additional proven issues; continuous cross-format selection and a separate Select text document remain deferred.

All checks at 39f5b2396cd finished: 18 passed, 19 skipped, zero failed or pending. Mobile Checks passes production/test typing and 10,182 tests; PR Checks passes root typing, all root shards, relay integration, web bundle and aggregate verification. CI ran all 82 focused Copy cases and 34 permission cases. Local checks also pass apart from five import-cycle warnings whose source and audit configuration are identical to main; no rule or typing allowance changed.

Native final-source screenshots show the controls, but the laptop helper failed before actual Copy→Paste proof. The PR remains draft; the parent will run that proof on an M4Air Release simulator build with bundled JavaScript. The required steps are to tap the full reply’s Copy footer, open another chat/worktree, use the composer’s real Paste action, and screenshot/compare the pasted source; then repeat for own messages, both preview modes and an unsaved document. Physical Magic Keyboard/trackpad, native frame/battery performance, Windows/Linux/WSL runtime, full shell navigation and end-to-end SSH were not verified. Loaded SSH/folder content still uses the existing device-local action boundary, inspected in source.

Native controls visible; successful Paste not yet verified

@brennanb2025

brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

On iPad, formatted replies and Markdown documents span separate selectable text areas, making complete source difficult to transfer. This PR adds Copy below messages and to loaded Markdown previews, and keeps the reader's existing Copy action connected to its current document, including unsaved edits. Full-source controls now use desktop's compact Copy icon and briefly become a green Check after success. The existing source copier and device clipboard writer preserve Markdown independently of text selection or saving.

Copy takes the source at the tap. Refused writes remain visible during streaming, and both web preview-opening routes retain device clipboard permission. Partial previews still say “Copy loaded.” Native and paired-web controls remain visible for touch use, including an iPad with a trackpad; visible failure feedback and the reader's existing labeled action are intentional mobile differences. Message structure, user-bubble styling and the separate Select text view were left unchanged.

Fresh review fixed P2, caused by the review loop, at the source copier: the final main sync could strip a visibly literal visual-instruction line from an own message, or hide Copy when that was all the message. The existing copier now preserves ordinary own text exactly while retaining reply filtering. Five failing-before application cases and fresh independent diagnostics verified both existing message actions. The stale visible-label assertion was also corrected; the one approved main sync included the already-landed static-check fix. Earlier streaming failure, invisible web refusal and preview-permission findings remain fixed.

Before marking ready, at 0783f30, all 37 CI checks completed: 18 passed, 19 skipped for draft/event/scope, zero failed or pending. PR checks and mobile verification passed, including all unit shards, production/test typing and 490 browser cases. The prior HTML link case passed in Chromium and WebKit; its historical timeout cause remains unresolved. CI's native audit reported zero warnings. The required local repository checks passed 22 of 23 checks; the one failure is five warnings in source and audit configuration identical to incoming main. Local final-source validation also passed 148 focused tests in 15 files, and fresh reviewers passed 13 independent diagnostic cases. No open proven P0–P2 source finding remains.

After marking ready, the two readiness runs completed: 3 checks passed and 21 were skipped, with none failed or pending. Readiness PR checks explicitly reused the successful required tests for the identical source and workflow; its repository checks and aggregate still ran. Headless scope detection found no affected inputs. The other skips were explained by scope or workflow dependencies; they do not establish platform or full-app coverage. Across both events, the raw record contains 21 successes and 40 expected skips, including historical same-head rows—not 61 fresh executions.

Native evidence on 0783f30 shows icon-only controls and the green Check, and a real Paste into another chat whose visible tail retains Markdown table pipes and closing prose. The coordinator recovered and checksum-verified those images after the driver reached its provider limit; I inspected them firsthand. Native QA is accepted with these gaps: the full pasted value was compared only on 39f5b23, the literal own-message directive was not pasted on device (covered by source and message-action tests), and the README preview icon was not re-captured on 0783. Prior behavior head 39f5b23 has genuine Release iPad simulator Copy→Paste proof for replies in portrait and landscape, an own message and README previews in both modes. The listed native cases do not establish physical Magic Keyboard/trackpad behavior, continuous selection across formatting, a dedicated Windowed Apps flow or unsaved-reader Paste. Skipped platform, packaging and full-app CI lanes were not exercised; no real Android, Windows/WSL/Linux or SSH end-to-end run was added for this presentation correction.

Deferred P3, caused by the review loop: MobileSourceCopyButton.tsx:105 keeps “Copy message” as its successful accessible name while its result value says “Copied.” This differs from desktop; no lost functional announcement was proved. The separate Select text view still awaits Brennan, and the existing Android drawer's mounted-source behavior remains deferred. Review and native QA are accepted with these limits, and the PR is ready for review. No merge has been performed.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 8, 2026 05:16
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds copy controls for Markdown source in mobile file previews and session Markdown readers, plus eligible chat messages. A shared button handles clipboard feedback and pending-write results. Both file routes declare the clipboard grant. Chat copy text now varies by message role: user text retains visual directive lines, while other roles remove them. The session Markdown reader offers Copy for ready documents and labels truncated content as loaded content.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to de9fa

Screen-reader users on iOS cannot reveal the new full-message Copy control, although they can still use native text selection. This is a bounded accessibility gap and can be fixed in a follow-up.

Pre-merge checks · Passed 3 · Failed 2

Failed Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 21.05% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description is detailed and covers the change, rationale, visual proof, testing, limitations, and checklist. However, the required Linked Issue section is incomplete: it states that no separate is… Add a valid issue link or issue reference in the Linked Issue section. If the author is a maintainer and no issue is required, state the applicable repository-approved exception instead of leaving the required field empty.
Passed Passed checks (3 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the main user-facing change: copying complete chat replies and loaded Markdown on mobile.
Full details: Description check

Explanation

The description is detailed and covers the change, rationale, visual proof, testing, limitations, and checklist. However, the required Linked Issue section is incomplete: it states that no separate issue was opened and leaves Fixes # empty.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Like desktop's hover-only copy, the chat message copy button stays hidden
until the message is tapped; another tap hides it. The tap target is not a
single accessible element, so screen readers still reach the text inside.
…Copy

On iPad the release of a long-press selection, or of a selection-handle drag,
also counted as a tap and toggled the message's copy button. Claiming the long
press keeps only quick taps as toggles; native selection is unaffected.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd42778c-7b84-40bd-9cee-5acdf3b2206e
📥 Commits

Reviewing files that changed from the base of the PR and between 0783f30 and de9fa38.

📒 Files selected for processing (3)
  • mobile/src/session/MobileNativeChatLongPressContent.tsx
  • mobile/src/session/MobileNativeChatMessage.copy.test.tsx
  • mobile/src/session/MobileNativeChatMessage.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment on lines +23 to +25
onLongPress={onLongPress ?? ignoreLongPress}
onPress={onPress}
accessible={false}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

rg -n 'accessib|onPress|Copy|actions' mobile/src/session/MobileNativeChatMessage.tsx mobile/src/session/MobileNativeChatLongPressContent.tsx

Repository: stablyai/orca

Length of output: 2029


🏁 Script executed:

sed -n '1,380p' mobile/src/session/MobileNativeChatMessage.tsx
printf '\n--- MobileNativeChatLongPressContent.tsx ---\n'
sed -n '1,180p' mobile/src/session/MobileNativeChatLongPressContent.tsx
printf '\n--- related accessibility/copy/action references ---\n'
rg -n -F --glob '*.{ts,tsx}' -- 'accessibilityActions' mobile/src/session mobile/src/components || test "$?" -eq 1
rg -n -F --glob '*.{ts,tsx}' -- 'MobileSourceCopyButton' mobile/src/session mobile/src/components || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 15100


Provide an accessible way to reveal Copy.

onPress reveals the full-message Copy button, but the wrapper has accessible={false}. VoiceOver therefore cannot activate that action. Native text selection remains available, but it does not expose the full-message source-copy action. Add a named, operable accessibility action or another accessible path to Copy.

This is a minor issue because native selection provides a partial workaround; major severity is not justified.

…t-copy

# Conflicts:
#	mobile/src/session/MobileNativeChatMessage.tsx
…other tests do

vi.importActual with a relative path resolved from the mocker under CI's
runner and failed to find ../platform/clipboard.web; a plain import() in the
mock factory resolves from the test file.
@brennanb2025
brennanb2025 merged commit 94d2462 into main Oct 12, 2026
32 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/ipad-chat-copy branch October 12, 2026 22:55
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