Skip to content

Revert ASSA tag RTL layout permutation; add Avalonia canary tests#12598

Merged
niksedk merged 2 commits into
mainfrom
revert/assa-rtl-tag-layout
Jul 18, 2026
Merged

Revert ASSA tag RTL layout permutation; add Avalonia canary tests#12598
niksedk merged 2 commits into
mainfrom
revert/assa-rtl-tag-layout

Conversation

@niksedk

@niksedk niksedk commented Jul 18, 2026

Copy link
Copy Markdown
Member

Reverts #12567 per the analysis in its review thread: the rendering half works, but clicking inside an ASSA tag in an RTL line throws InvalidOperationException from Avalonia's hit-testing, and the click-to-caret path (TextPresenter.MoveCaretToPointTextLayout.HitTestPoint) has no overridable seam to translate permuted layout indices back to Text. The alternative LRM route fails on the same wall. Both are tracked upstream in AvaloniaUI/Avalonia#21792.

Canary tests

So the revert isn't forgotten, two tests in tests/UI pin the Avalonia limitations and fail (loudly, with instructions) when an Avalonia upgrade delivers a missing piece:

  • ClickToCaretPathHasNoOverridableSeam — reflection check that MoveCaretToPoint / HitTestPoint / HitTestTextRange / HitTestTextPosition are still non-virtual. If one becomes overridable, Fix ASSA tag backslash rendering in RTL lines in the syntax highlighting text box #12567 can come back with hit-test index translation.
  • AssaTagBackslashStillRendersDisplacedInRtlLines — renders {\an8}هذا through SE's real template (SyntaxHighlightingTextPresenter + Skia) and asserts the backslash still lands on the wrong side of the letter run. If Avalonia fixes the bidi ordering itself, this fails and the workaround becomes unnecessary.

To make the second test possible, the headless test app now draws with Skia (UseHeadlessDrawing = false + UseSkia()) instead of the drawing stub, so text-related tests exercise the app's real glyph metrics and bidi-run geometry. Full UI suite: 693/693 passing.

The zero-width-run GetTextBounds throw from the review thread is not pinned — it did not reproduce headlessly on macOS even with Skia shaping, so a canary asserting it would be red today.

🤖 Generated with Claude Code

niksedk and others added 2 commits July 18, 2026 12:24
The revert trades the displaced-backslash rendering back for stability, and
the missing pieces are Avalonia's to deliver (AvaloniaUI/Avalonia#21792).
These tests pin the current limitations: no overridable seam on the
click-to-caret path, and the tag backslash rendering displaced in RTL lines
through SE's real template. When an Avalonia upgrade fixes either, a canary
fails and flags that PR #12567 can be resurrected.

The headless test app now draws with Skia instead of the headless stub so
text tests exercise the app's real glyph metrics and bidi-run geometry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@niksedk
niksedk merged commit 00c127a into main Jul 18, 2026
1 of 2 checks passed
@niksedk
niksedk deleted the revert/assa-rtl-tag-layout branch July 18, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant