Repository navigation
fix(mobile): copy complete chat replies and loaded markdown - #26152
Conversation
|
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
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. |
|
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 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. |
|
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. |
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.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
cd42778c-7b84-40bd-9cee-5acdf3b2206e
📒 Files selected for processing (3)
mobile/src/session/MobileNativeChatLongPressContent.tsxmobile/src/session/MobileNativeChatMessage.copy.test.tsxmobile/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.
| onLongPress={onLongPress ?? ignoreLongPress} | ||
| onPress={onPress} | ||
| accessible={false} |
There was a problem hiding this comment.
🎯 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.tsxRepository: 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 1Repository: 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.

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.
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.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 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
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
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