feat(mobile): back swipe from scroll edges, Android text selection, terminal paste - #427
Merged
Merged
Conversation
Co-authored-by: Claude Code <noreply@anthropic.com> (cherry picked from commit 80b53730d1e821563e5c348fdf4f5fc7616a49f7)
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com> (cherry picked from commit 09d13de4381925fa2a6dea74eff8185fa301e905)
Co-authored-by: Jake Leventhal <jakeleventhal@me.com> Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com> (cherry picked from commit d5b94100863057fb4629f9ad4a35753d16917924)
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Three mobile interaction gaps, adopted from T3 Code.
What changed
Back swipe from a horizontal scroll edge. Swiping right to go back did nothing when the
gesture started inside a horizontally scrollable row — the code viewer, the tab strip, the
diff surface. The gesture was swallowed by the inner scroll view even when it was already
pinned at its left edge. A patch to
react-native-screenslets the screen's back gesture winonce the inner scroller has nothing left to scroll.
Selectable chat text on Android. Long-pressing an assistant message on Android selected
nothing; iOS already had native selection. This adds an Expo module
(
T3MarkdownTextSelectionModule) backed by an AndroidTextViewselection host, and routesSelectableMarkdownText.android.tsxthrough it. The iOS primitives were refactored alongsideit so both platforms share one component contract.
Paste the phone clipboard into the terminal. The mobile terminal had no way to paste.
There is now a
pastekey on the terminal accessory toolbar, andctrl/cmd+vthroughthe armed modifier does the same thing. Pasted text is bracketed-paste encoded and written in
chunks so a large paste cannot overrun the pty write path.
Terminal keyboard handling moved out of the route screen into
terminalInput.ts(modifier resolution, paste encoding, write chunking) and
terminalPaste.ts(clipboard readand write sequencing), both unit tested.
Adopted from T3 Code
80b53730d1e821563e5c348fdf4f5fc7616a49f7(#9493) back swipe from horizontal scroll edges09d13de4381925fa2a6dea74eff8185fa301e905(#8779) selectable chat text on Androidd5b94100863057fb4629f9ad4a35753d16917924(#9199) paste the phone clipboard into the terminalPylon adaptations
TerminalBufferStategains upstream'slifecycleVersion, which counts pty lifetimes so adelayed clipboard read is dropped when the terminal restarts underneath it. Pylon's terminal
buffer diverges from upstream here: PR #308 replaced the plain
bufferstring with ageneration-tracked
TerminalOutputStateand madeversionmonotonic so appends never replayretained history. Upstream's version of this change resets
versionto1on every snapshotand rebuilds the buffer from scratch.
The resolution keeps Pylon's incremental output and monotonic
version, and layerslifecycleVersionon top:terminalBufferStateFromSnapshotstill takescurrentand still returnsresetOutput(current.output, …)andcurrent.version + 1, and now carriescurrent.lifecycleVersionthrough.snapshotandrestartedcases passcurrentto it — a blind merge dropped thatargument on the
snapshotpath, which would have reset the output cursor generation andthe version on every re-attach.
lifecycleVersionadvances onrestarted, and on asnapshotthat arrives at a bufferthat already has content. The initial attach snapshot leaves it at 0, so the paste session
is not reset the moment the screen opens.
The host platform used to resolve
ctrlversuscmdnow prefers the server's reportedenvironment.platform.osand only falls back to guessing from the environment label.Verification
terminalSession,terminalInput,terminalPaste,terminalMenu.@t3tools/client-runtime,@t3tools/mobile,@t3tools/weball clean.knip:checkclean.The
pnpm-lock.yamlchange is patch-hash only — thereact-native-screenspatch contentchanged and the markdown-text local module gained an Android target. No new dependency;
expo-clipboardwas already present.Android native selection and the
react-native-screenspatch need a device or emulator pass;neither is exercised by the JS suites or by an iOS simulator build.
Model and harness: Claude Opus 5 via Claude Code.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.