Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

ClosedValeraZSD(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/13411/headopened 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 compared 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.

Verification

Web dev server (vp run dev) from a worktree at main 3982f20ce4, 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, 12 passed); with the fix, 13 passed. The case also pins that a Latin layout typing k on the KeyV key is not treated as V.
  • On current main 67c0fc0cda, textPaste.ts is unchanged; the composer's paste handler moved within ChatComposer.tsx but still arms the bypass from the same keydown check. The branch still merges cleanly.

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 3982f20ce4), recording: paste-before.mp4

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

After (with this fix), recording: 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.

Summary by CodeRabbit

  • Bug Fixes
    • Paste-as-text shortcuts now work with non-Latin keyboard layouts by recognizing the physical V key. Latin letter keys remain excluded.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: c6e8defd-5ff2-40b6-9437-825d532b819e

      📥 Commits

      Reviewing files that changed from the base of the PR and between b2b43bef73447c483ceae486890cb79f01c369cb and 40dfdd83a3975098d421c1cac7b9ae942ba9257d.

      📒 Files selected for processing (2)
      • packages/client-runtime/src/textPaste.test.ts
      • packages/client-runtime/src/textPaste.ts

      Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


      📝 Walkthrough

      Walkthrough

      The paste-as-text shortcut check now uses the physical V key code when the reported key is not an ASCII letter. Tests cover non-Latin and Latin keyboard layouts.

      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 shortcut check accepts an optional code value and uses KeyV when the reported key is not an ASCII letter. Tests cover non-Latin and Latin key values.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: chrisdeeming

      Merge Risk: ⚪ Minimal · up to 40dfd

      The non-Latin shortcut reaches both paste paths, and no remaining issue in the reviewed change warrants delaying merge.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely identifies the fix for paste-as-text shortcuts on non-Latin layouts.
      Description check✅ PassedThe description explains the problem, affected layouts, user impact, and implemented fix. It covers the required What Changed and Why content. The UI Changes section and checklist are omitted, but the…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

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

      Verdict: Approved at 40dfdd8

      Macroscope's review found this PR approvable — This is a small, localized fix to an existing paste shortcut, with tests covering non-Latin layouts and preserving Latin-layout behavior. It introduces no schema, deployment, security, default, or static-analysis changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Note

      This comment is posted by Julius' dot

      Closing for missing verification. This changes paste-as-text handling on non-Latin layouts, but there is no reported test run or observed after-check. Add the focused command and result, plus before/after interaction evidence showing a large paste stays inline and Latin shortcuts still work. See verification. Add the evidence and request reconsideration.

    5. juliusmarminge closed this

    6. Added the test run and before/after recordings the closure asked for: a paste over 32 KB with Ctrl+Shift+V on a Russian layout (main attaches it as pasted-text.txt; the fix keeps it inline) and on an English layout (inline in both, so Latin shortcuts still work). Commands, results and what was not checked are in the description under Verification. The bug is still on main 67c0fc0cda and the branch merges cleanly. Requesting reconsideration.

    7. Replaced by #28470, the same fix rebuilt on current main with a fresh test run and recordings.

Sign in to join this conversation.