Repository navigation
fix(rtl): lay a line out in the page's direction, not its first letter - #13
Conversation
A line on a page set right to left that starts with a Latin word, such as `TODO: <Arabic>`, hung from the right edge but read left to right inside it, so `TODO` was drawn at the far left end of the line. parley takes a paragraph's base direction from its first strong letter and 0.11 gives no way to set it, so the page's direction never reached the bidi algorithm. The bidi painter now lays such a line out with the page's direction mark (RLM or LRM) in front, as a paragraph's own mark already does, and moves every byte parley hands back past the mark. The drawing, a click, a double click, the caret, the selection and the arrow keys all take the page's direction, so they keep using one layout. A new rtl_quality test measures the order on the page, a click at each edge and the caret at the start. docs/gaps.md drops the fixed item and corrects the numbered-item one: the number is on the right already; only its full stop is on the other side from a browser's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for contributing and for the fix this could be related to this issue as well |
✅ Final Review: PR #13 RTL FixStatus: READY FOR DECISION 📊 Summary
🔧 What Was FixedProblem: Mixed-direction text (e.g., "TODO: نص عربي") on RTL pages displayed incorrectly because app read first character instead of page direction. Solution: Force page direction using Unicode marks (RLM/LRM), matching how browsers and Word handle RTL text. Evidence: Same bug exists in Microsoft OneNote (acknowledged by users, Microsoft Learn Q&A Nov 2024). 🎯 Regression TestTest:
📈 Code Quality
📊 Coverage Report
✅ Verification Checklist
🎯 Next StepTest the 7 RTL scenarios in NoteCraft to confirm all visual behavior is correct. Detailed test report available at: PR_13_FINAL_REPORT.html Review completed with comprehensive code analysis, diff comparison, coverage tracking, and regression test verification. |
A line on a page set right to left that starts with a Latin word, such as
TODO: <Arabic>, hung from the right edge but read left to right inside it, soTODOwas drawn at the far left end of the line. parley takes a paragraph's base direction from its first strong letter and 0.11 gives no way to set it, so the page's direction never reached the bidi algorithm.The bidi painter now lays such a line out with the page's direction mark (RLM or LRM) in front, as a paragraph's own mark already does, and moves every byte parley hands back past the mark. The drawing, a click, a double click, the caret, the selection and the arrow keys all take the page's direction, so they keep using one layout.
A new rtl_quality test measures the order on the page, a click at each edge and the caret at the start. docs/gaps.md drops the fixed item and corrects the numbered-item one: the number is on the right already; only its full stop is on the other side from a browser's.
What and why
Quality level L3 (see SKILLS/nc-devx/SKILL.md)
mainand has no merge commits (the pre-push hook checks this)cargo xtask cipasses (the pre-push hook and CI run it)coveragejob's warnings are read;cargo xtask coverage --updateis inthis pull request if coverage rose
docs/commands.md(regenerated),docs/gaps.md,docs/testing.md,docs/mcp.md,docs/control-protocol.md, as they applyCommandSpecwith a testcargo xtask demo-check, the format parity test, and a side byside look at both formats
cargo xtask screenshotsif they changedassets/ordocs/images/have a row inATTRIBUTION.mdHow it was checked