Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: paste-as-text shortcut on non-Latin layouts #28470

MergedValeraZSD(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/28470/headmerged by maria-rcks View on GitHub

The 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+VEnglish layout, Ctrl+Shift+V
mainpasted-text.txt attachment, toast recommends Ctrl+Shift+Vinline, 40,905 characters
fixinline, 40,905 charactersinline, 40,905 characters
  • vp test run src/textPaste.test.ts in packages/client-runtime: with main's textPaste.ts the new case fails (1 failed); with the fix, 1 passed. The case also pins that a Latin layout typing k on the KeyV key 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

Before: on the Russian layout the paste becomes pasted-text.txt

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

After: on the Russian layout the paste stays inline

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

    2. Approvability

      Verdict: Approved at d359ae0

      Macroscope'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).
    3. Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      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.ts
      • packages/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 code property. 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.ts
      The 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: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: fixing the paste-as-text shortcut on non-Latin keyboard layouts.
      Description checkPassedThe 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 checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck 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
    4. maria-rckscommented

      Note

      Written by gpt-6.1-sol on behalf of Maria

      Verified in a real dev environment

      Verified unchanged head d359ae07aa3590171e965c199c46cabcb7494c64 against github/main at 7195b69954 on Linux, using the real dev web app, repository Playwright, and /usr/bin/google-chrome at 1440×1000. Ran one dev server at a time with isolated state. Added the real repository through the app and created a thread with Codex gpt-6.1-sol through 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.txt attachment 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 Period stayed inline. Latin k on KeyV and ordinary Ctrl+V kept the large-paste attachment behavior.
      • vp test run packages/client-runtime/src/textPaste.test.ts passed through blacksmith-check: 1 file, 1 test. Existing CI has no failing or pending checks. No fix or push was needed.

      Before, main:

      main turns the same Cyrillic shortcut paste into an attachment

      After, PR head:

      pr head keeps the same source excerpt inline

      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.

      main and pr paste behavior followed by the real Codex response

      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.

    5. maria-rcks merged this2101c6f

    6. maria-rcks closed this

Sign in to join this conversation.