Skip to content

fix(web): prevent duplicate quotes from dead keys - #12644

Closed
SpizzyCoder wants to merge 1 commit into
pingdotgg:mainfrom
SpizzyCoder:fix/composer-dead-key-quotes
Closed

SpizzyCoder wants to merge 1 commit into
pingdotgg:mainfrom
SpizzyCoder:fix/composer-dead-key-quotes

Conversation

@SpizzyCoder

@SpizzyCoder SpizzyCoder commented Sep 19, 2026 •

Copy link
Copy Markdown

What Changed

Restrict the composer's selection-wrapping behavior to actual text selections and skip it during composition.

Why

With a US International keyboard layout, typing a quote dead key followed by Space duplicates the quote. The composer treated the composition replacement range as selected text and applied quote wrapping.

The guard lets native composition finish while preserving quote wrapping for explicitly selected text.

UI Changes

None

Validation

  • Quote key + Space inserts one apostrophe.
  • Double-quote key + Space inserts one double quote.
  • Quote key + vowel still produces the expected accented character.
  • Selecting a word and typing a quote using Right Alt + Shift still wraps it.
  • 111 related tests passed.
  • Web typecheck, targeted lint, and formatting checks passed.

Checklist

  • This PR is small and focused
  • I explained what changed and why

Summary by CodeRabbit

  • Bug Fixes
    • Improved text editing behavior during composition and dead-key input.
    • Prevented surrounding markers from being applied prematurely while native text input is still in progress.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 19, 2026
@SpizzyCoder
SpizzyCoder force-pushed the fix/composer-dead-key-quotes branch from ad62c77 to 3673163 Compare September 19, 2026 22:54
@macroscopeapp

macroscopeapp Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at ad62c77

Macroscope's review found this PR approvable — This is a small, isolated composer bug fix that preserves explicit selection wrapping while allowing native dead-key composition to complete normally. It does not alter product defaults, schemas, deployment, or static-analysis behavior.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

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: 87903b6b-ee8a-4a8e-9e80-efd3a4759746

📥 Commits

Reviewing files that changed from the base of the PR and between d6f2913 and 3673163.

📒 Files selected for processing (1)
  • apps/web/src/components/ComposerPromptEditorTiptap.tsx

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


📝 Walkthrough

Walkthrough

The prompt editor now skips surrounding-marker logic during composition, with non-text selections, empty selections, or mismatched input ranges. Existing wrapping checks remain for explicitly selected text.

Changes

Prompt composition handling

Layer / File(s) Summary
Guard explicit text input handling
apps/web/src/components/ComposerPromptEditorTiptap.tsx
handleTextInput returns false for composing input, non-TextSelection selections, empty selections, or ranges that do not match the input range. Existing single-character and SURROUND_CLOSE checks remain unchanged.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the dead-key quote duplication fix, which is the main change in the pull request.
Description check ✅ Passed The description explains what changed, why the change is needed, and that there are no UI changes. It also includes validation results and confirms that the change is small and focused. The descriptio…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check 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.

@adolago

adolago commented Sep 30, 2026

Copy link
Copy Markdown

Since v0.0.43 made the Tiptap composer the default (#12160), this affects every US-International (dead-key) user in everyday typing, not only quote + Space. On v0.0.44 (Linux, Hyprland on Wayland, layout us variant intl), typing I've in the composer produces a doubled apostrophe. In the 0.0.44 bundle the surround handleTextInput in ComposerPromptEditorTiptap still has no composition guard, so the dead-key composition range (from !== to) is wrapped as if it were a selection, which is exactly what this PR fixes.

Could this be merged and included in the next release?

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

This changes composer text entry, but the PR supplies no before/after images or interaction recording. The written manual checks cover useful cases; please show quote plus Space, quote plus vowel, and explicit-selection wrapping with a US International layout in a short comparison recording, as required by verification, then request reconsideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants