monkeytype icon indicating copy to clipboard operation
monkeytype copied to clipboard

fix(funbox): proper rtl and ligature handling in polyglot with mixed languages (@byseif21)

Open byseif21 opened this issue 6 months ago • 1 comments

Description

This PR addresses an issue in Monkeytype's funbox "polyglot" mode where mixing right-to-left (RTL) and left-to-right (LTR) languages—while the main language is set to LTR—would break ligature rendering for RTL languages.

Key Changes

  • Introduces PolyglotResult type: The withWords method in funbox functions may now return a PolyglotResult object containing the generated wordset and metadata about directionality (allRightToLeft) and ligature support (allLigatures).

  • Updates polyglot logic: When polyglot mode is active, the system checks all included languages for RTL and ligature support and returns this info in the result.

Notes

  • Maintains backward compatibility for non-polyglot funboxes.
  • Adds runtime type checks for the new result type.
  • No breaking changes expected for existing test modes.

byseif21 avatar Jun 19 '25 13:06 byseif21

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: frontend/src/ts/test/test-logic.ts

Function Unhandled Issue
init Error: activeWord is undefined - can't update active element ...
Event Count: 2 Affected Users: 2

Did you find this useful? React with a 👍 or 👎

sentry[bot] avatar Jun 19 '25 13:06 sentry[bot]

handled in #6666

byseif21 avatar Sep 16 '25 23:09 byseif21