fix: paste-as-text shortcut on non-Latin layouts #28470
main fromrefs/pull/28470/head·merged by maria-rcks View on GitHubThe large-paste toast says "Use Ctrl+Shift+V to keep a large paste inline", but on a Cyrillic or Greek layout that shortcut does nothing: isPasteAsTextShortcut compares event.key to "v", and there event.key is "М". The paste still gets folded into a pasted-text.txt attachment.
It now falls back to the physical key (code: "KeyV") when the layout types a non-Latin letter, the same rule the keybinding matcher uses (resolveEventKeys in packages/shared/src/keybindings.ts). Latin layouts still follow the letter they type, so a Dvorak or Colemak user's Ctrl+Shift+V keeps working and the key in the V position is not claimed.
This is a small fix for an obvious bug (the app recommends a shortcut that cannot work on these layouts), so it goes under the small-fix exception in CONTRIBUTING rather than a prior issue.
Replaces #13411, which was closed for missing test results and interaction evidence. Both were added there on 20 Oct with a reconsideration request; this is the same fix rebuilt on current main, as the closure guide's replacement route.
Verification#
Web dev server (vp run dev) from a worktree at main 8b74a69019, Windows 10, isolated .t3 state, headless Edge at 1100×700. A 39 KB build log on the clipboard (over the 32 KB attachment line). The keys go in through CDP Input.dispatchKeyEvent with exactly what a Russian layout reports for that key (key: "М" Cyrillic, code: "KeyV", virtual key 86), then the same chord with key: "V" for an English layout. After each paste the script read the composer back.
| Russian layout, Ctrl+Shift+V | English layout, Ctrl+Shift+V | |
|---|---|---|
| main | pasted-text.txt attachment, toast recommends Ctrl+Shift+V | inline, 40,905 characters |
| fix | inline, 40,905 characters | inline, 40,905 characters |
vp test run src/textPaste.test.tsinpackages/client-runtime: with main'stextPaste.tsthe new case fails (1 failed); with the fix, 1 passed. The case also pins that a Latin layout typingkon theKeyVkey is not treated as V.
Not checked: macOS (Cmd+Shift+V goes through the same function, untested), the Electron shell, and mobile, which does not use this shortcut.
Before (main 8b74a69019), recording: v2-paste-before.mp4

After (with this fix), recording: v2-paste-after.mp4

Model and harness#
Claude Opus 5.5 (high effort) in Claude Code, run from T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
d359ae0Macroscope's review found this PR approvable — The paste-as-text shortcut now recognizes the physical V key on non-Latin layouts while preserving existing Latin-layout and modifier behavior. Its effects remain confined to explicitly requested composer paste handling.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 8b74a69
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d0e89550-e384-4b50-a9ff-c5263e40cbb9
Commits-
Reviewing files that changed from the base of the PR and between 8b74a69019e3d0f5be62dc118c526669002fc195 and d359ae07aa3590171e965c199c46cabcb7494c64.
Files selected for processing: 2-
packages/client-runtime/src/textPaste.test.tspackages/client-runtime/src/textPaste.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
Walkthrough
-
The paste-as-text shortcut detector now checks the physical key code when the typed key is not an ASCII letter. The function accepts an optional
codeproperty. Tests cover non-Latin input, Latin input, and a typed V from a different physical key.Changes: Paste-as-text shortcut
Layer / File(s) Summary Shortcut key detection and tests
packages/client-runtime/src/textPaste.ts,packages/client-runtime/src/textPaste.test.tsThe detector uses the typed key for ASCII letters and falls back to the physical key code otherwise. Tests cover non-Latin and Latin input, plus a typed V from a physical key other than KeyV.Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the main change: fixing the paste-as-text shortcut on non-Latin keyboard layouts. Description check The description explains the problem, implementation, scope exception, replacement issue, verification steps, observed results, and untested environments. It does not use separate Problem, Change, or … Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Description check
-
Explanation
The description explains the problem, implementation, scope exception, replacement issue, verification steps, observed results, and untested environments. It does not use separate Problem, Change, or Scope and approval headings, but the required information is present and the description is substantially complete.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Note
Written by
gpt-6.1-solon behalf of MariaVerified in a real dev environment#
Verified unchanged head
d359ae07aa3590171e965c199c46cabcb7494c64againstgithub/mainat7195b69954on Linux, using the real dev web app, repository Playwright, and/usr/bin/google-chromeat 1440×1000. Ran one dev server at a time with isolated state. Added the real repository through the app and created a thread with Codexgpt-6.1-solthrough the local proxy. No mocks or replay provider.Copied the same 35 KB source excerpt to the browser clipboard. CDP dispatched Ctrl+Shift+V with
key: "М",code: "KeyV", virtual key 86, and modifiers 10; Chrome delivered the paste to the actual composer.- Main reproduced the bug:
pasted-text.txtattachment and the toast recommending Ctrl+Shift+V. - PR head kept it inline with all source characters preserved. Submitted that paste through the UI; real Codex returned
PASTE_RECEIVED_28470. The response survived a page reload. - Russian paste-to-focus and Greek shortcut input stayed inline.
- English Ctrl+Shift+V and Latin V on
Periodstayed inline. Latin k onKeyVand ordinary Ctrl+V kept the large-paste attachment behavior. vp test run packages/client-runtime/src/textPaste.test.tspassed throughblacksmith-check: 1 file, 1 test. Existing CI has no failing or pending checks. No fix or push was needed.
Before, main:

After, PR head:

Recording (displayed as a GIF for GitHub): main reproduction, PR inline paste, submission, and real provider response. Idle time between paste and submission is cut. Uploaded playback and seeking were checked in Chrome.

Not verified#
Native Electron menu/clipboard integration, macOS Cmd+Shift+V, Windows, and native iOS/Android clients were not exercised on this Linux web run. Keyboard layouts were represented by CDP key/code values; an OS layout switch and physical keyboard were not exercised. Other providers, relay, and tunnel connections were not exercised.
- Main reproduced the bug:
maria-rcks merged this2101c6f
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes