fix: normalize dead-key grave input in composer#3158
Conversation
Co-authored-by: Codex <codex@openai.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3001509. Configure here.
ApprovabilityVerdict: Approved Straightforward bug fix that normalizes international keyboard dead-key grave characters to standard backticks in the composer. Changes are self-contained within input handling logic with clear intent and limited scope. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: Codex <codex@openai.com>

Summary
Root cause
Some keyboard layouts emit grave-like Unicode characters (
ˋ,‵,`) throughinsertCompositionTextafter a dead-key press. The composer accepted those literal characters, so Markdown inline-code delimiters were not recognized.Impact
Dead-key grave input now produces ASCII backticks only at the input boundary. Pasted text and non-dead-key Unicode content are left unchanged.
Validation
vp checkvp run typecheckcd apps/web && vp test run --project browser src/components/ChatView.browser.tsx -t "supports dead-key composition"Dead+U+02CB-> ASCII backtick passed locally and was removed.Closes #3142
Note
Normalize dead-key grave input to backtick in
ComposerSurroundSelectionPluginkeydownevents viarecentDeadKeyDownRefwith a 1,000 ms recency window; when a grave-lookalike character arrives viainsertCompositionTextwithin that window, it is treated as a backtick.hasCommandModifierhelper to centralize meta/ctrl modifier checks across key event handlers.Macroscope summarized 8c94e32.
Note
Low Risk
Scoped to composer keyboard/composition handling for a specific dead-key pattern; no auth, persistence, or broad input-path changes.
Overview
Fixes composer markdown inline-code behavior when some layouts emit grave lookalike Unicode (
ˋ,‵,`) viainsertCompositionTextafter a Dead key instead of ASCII`.ComposerSurroundSelectionPluginnow records a plain Dead keydown (1s window, cleared on most other keys but not plain Space) and, on matching composition input, runs the existing backtick surround path or inserts a literal backtick, then suppresses the lookalike character. Modifier checks use a sharedhasCommandModifierhelper. Pasted text and unrelated Unicode are unchanged.Reviewed by Cursor Bugbot for commit 8c94e32. Bugbot is set up for automated code reviews on this repo. Configure here.