fix(funbox): proper rtl and ligature handling in polyglot with mixed languages (@byseif21)
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.
🔍 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 👎
handled in #6666