fix(rtl): sizes, speeds and times left read in the language's direction and fit their column
With sizes in the language's units, the left-to-right number cells of the Import
tables and the Jobs speed and time-left columns put the unit after the number on
screen, so an Arabic or Hebrew reader met the unit first ("18,6 كيلوبايت"), and the
fixed column cut the longer word off. These cells and their headers now follow the
reading direction at the end of the cell, and the Import size columns size to their
content; bare numbers (percentages) stay left-to-right islands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
5 files changed
+28
-23
No files matched your search
@@ -144,9 +144,13 @@ public sealed class ImportScreenSmokeTests
|
||||
foreach (var template in app.FindAll<TextBox>().Where(t => EditBehavior.GetField(t) is { } f && (f == import.FolderTemplate || f == import.FileTemplate)))
|
||||
Assert.Equal(FlowDirection.LeftToRight, template.FlowDirection, "name templates read left to right");
|
||||
Assert.Equal(FlowDirection.LeftToRight, TextFor(app, import.NamePreview).FlowDirection, "the name preview reads left to right");
|
||||
// A size carries the language's unit, so it reads in the language's direction, whole, at the end of its cell.
|
||||
var size = TextFor(app, import.Sessions[0].Row.SizeText);
|
||||
Assert.Equal(FlowDirection.LeftToRight, size.FlowDirection);
|
||||
Assert.Equal(TextAlignment.Right, size.TextAlignment, "numbers stay right-aligned");
|
||||
Assert.Equal(FlowDirection.RightToLeft, size.FlowDirection);
|
||||
Assert.Equal(TextAlignment.Right, size.TextAlignment);
|
||||
var shown = size.ActualWidth + size.Margin.Left + size.Margin.Right;
|
||||
size.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
||||
Assert.True(shown >= size.DesiredSize.Width - 0.5, $"the size column fits the whole size ({shown:0.#} < {size.DesiredSize.Width:0.#})");
|
||||
Assert.Contains("←", import.Sessions[0].Row.TimeText);
|
||||
await app.ExpectAsync<ImportView>("import-plan-ar");
|
||||
|
||||
|
||||
Reference in new issue
Block a user