Skip to content

fix(input): support oe and ae ligature input (@Dawn-Fighter)#7953

Open
Dawn-Fighter wants to merge 2 commits into
monkeytypegame:masterfrom
Dawn-Fighter:fix-ligature-input-overrides
Open

fix(input): support oe and ae ligature input (@Dawn-Fighter)#7953
Dawn-Fighter wants to merge 2 commits into
monkeytypegame:masterfrom
Dawn-Fighter:fix-ligature-input-overrides

Conversation

@Dawn-Fighter
Copy link
Copy Markdown

Description

Fixes ligature input handling for words containing œ / Œ and æ / Æ.

Currently, words like œuvre, bœuf, cœur, or æther require typing the ligature character directly. This patch allows users to type the ASCII equivalents instead:

  • oe for œ
  • OE for Œ
  • ae for æ
  • AE for Æ

When the first character is typed, the input is normalized to the target ligature. When the completion character is typed, it is ignored instead of being counted as an incorrect extra character.

Closes #7921.

Verification

Automated:

pnpm vitest run frontend/__tests__/input/handlers/insert-text.spec.ts
pnpm oxlint --format agent --type-aware --type-check frontend/src/ts/input/handlers/insert-text.ts frontend/src/ts/input/helpers/ligatures.ts frontend/__tests__/input/handlers/insert-text.spec.ts
pnpm oxfmt frontend/src/ts/input/handlers/insert-text.ts frontend/src/ts/input/helpers/ligatures.ts frontend/__tests__/input/handlers/insert-text.spec.ts --check

Manual:

Tested locally with custom text:

œuvre bœuf cœur æther

Typed using:

oeuvre boeuf coeur aether

The ligatures were accepted correctly and the completion characters were not counted as incorrect input.

Thank you for maintaining Monkeytype. Kindly review when you have time, and please let me know if any changes are needed. Happy to update the patch.

Copilot AI review requested due to automatic review settings May 14, 2026 09:58
@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label May 14, 2026
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds ligature-aware input normalization so users can type decomposed sequences (e.g., oe) while matching ligature target characters (œ), and avoids stray “completion” characters being inserted after a ligature.

Changes:

  • Introduces ligatures.ts helper utilities to detect/normalize ligature overrides and ignore ligature “completion” insertions.
  • Integrates ligature logic into onInsertText and normalization flow in insert-text.ts.
  • Adds Vitest coverage for the new ligature helper behaviors.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
frontend/src/ts/input/helpers/ligatures.ts New helper functions for ligature override matching and completion-ignore logic.
frontend/src/ts/input/handlers/insert-text.ts Hooks ligature logic into insert-text handling (ignore completion + normalize first char to ligature).
frontend/tests/input/handlers/insert-text.spec.ts New unit tests for ligature helper functions.

Comment thread frontend/src/ts/input/helpers/ligatures.ts Outdated
Comment thread frontend/src/ts/input/handlers/insert-text.ts
Comment thread frontend/__tests__/input/handlers/insert-text.spec.ts
@Dawn-Fighter
Copy link
Copy Markdown
Author

image

@Dawn-Fighter
Copy link
Copy Markdown
Author

@p00ya @radar @Sixeight please check the PR and comment what's necessary to change .. thank you so much for creating monkeytype .... because of you guys i learned to type faster improving my skills to this level now

Copy link
Copy Markdown
Contributor

@Leonabcd123 Leonabcd123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typing œuvre as ouvre is considered correct, even though it should be oeuvre.

@Dawn-Fighter
Copy link
Copy Markdown
Author

I was just solving a issue found on the page..

@Leonabcd123
Copy link
Copy Markdown
Contributor

Leonabcd123 commented May 14, 2026

I was just solving a issue found on the page..

Well, the fix isn't correct if it considers a ligature to be typed correctly when the second letter in it can be skipped.

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

Labels

frontend User interface or web stuff waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No "œ" support (French)

4 participants