Revert ASSA tag RTL layout permutation; add Avalonia canary tests#12598
Merged
Conversation
…hting text box)" This reverts commit f329ae5.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #12567 per the analysis in its review thread: the rendering half works, but clicking inside an ASSA tag in an RTL line throws
InvalidOperationExceptionfrom Avalonia's hit-testing, and the click-to-caret path (TextPresenter.MoveCaretToPoint→TextLayout.HitTestPoint) has no overridable seam to translate permuted layout indices back toText. 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/UIpin the Avalonia limitations and fail (loudly, with instructions) when an Avalonia upgrade delivers a missing piece:ClickToCaretPathHasNoOverridableSeam— reflection check thatMoveCaretToPoint/HitTestPoint/HitTestTextRange/HitTestTextPositionare 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
GetTextBoundsthrow 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