Repository navigation
Give every value the direction of its own text - #194
Conversation
|
Review by a fresh reviewer (diff and issue only), and what became of each point. Fixed in fc1817c.
After the fix: |
|
The first visual run showed a fault of this pull request, before any baseline was taken: in right to left, every label of a tree went to the far end of its row, away from its icon, with the count against it. A box that stretches across its row (an item of a tree, an option of a combobox, the text beside an avatar, the name of a file) takes a short text to its far end under |
|
Visual baselines, taken from run 46582460046 (on d94c633) and reviewed one by one; committed in db1c3eb. Only the five
No other capture in the three themes changed. |
Text in the other direction gets one rule, written down first as decision record 0015, then applied to the stylesheet.
The record
unicode-bidi: plaintext: data of the host or words a person typed, whose language the library cannot know. A cell of a table, the value of a description list, the actions of a card, and the parts that hold a name or a title, with the parts that already did. Words of the interface (labels, headings of the navigation, segments, the titles of cards and disclosures, the choices of a select) follow the page and are not isolated; a host that puts a value there usesdir="auto".dir="auto"does: a short English title in a right-to-left cell sits at the left. The record says why (an inline wrapper in every cell would change the markup of every part, and cutting the beginning of a title is the worse fault) and how a host keeps one edge for a column.What was measured to decide it is in the record: without isolation, an English title in a right-to-left box loses its beginning and draws its question mark first;
text-align: match-parentdoes not keep a short value on the page's edge in Chromium; an element withdir="auto"alone inside an isolated cell does not either.The stylesheet
The rule goes on the box that holds the text, never on a box that can hold only a number, a badge or a control: such a box takes left to right and leaves its place in the page. So:
unicode-bidi: plaintexton the elements in a cell offl-table(but its title and meta blocks) and on the elements in those two; the cell keeps the page's direction, so a number stays at the end of its column and a badge at its start;ddof a description list, and on the children offl-card__actions;Every part that cuts its text was looked at. The parts of the interface (navigation labels and heading, segments, the titles of cards and disclosures, the bar note, the select), the form controls (an input, the field of a combobox) and the boxes that stretch across their row (an item of a tree, an option of a combobox, the text beside an avatar, the name of a file) follow the page. For the last group the record says the cost: a long English name there in a right-to-left page is cut at its beginning, since a stretched box with
plaintexttakes a short name to the far end of its row, away from its icon, as the first CI run of this pull request showed in the tree. RECIPE section 7 states the rule.Decisions
plaintexton the part, not a wrapper and not a parameter: the record weighs the three.Tests
Foundations/TextDirectionTests, one test per rule, each putting an English title into a right-to-left page and an Arabic one into a left-to-right page, in static rendering (the text is put in by script):AValueKeepsTheOrderOfItsOwnText: a table title link and an element of its meta line, an element of a description list value, a link among the actions of a card and a tag: the last character of the value is drawn after its first in its own direction.AStretchedLabelKeepsItsTextAtTheStartOfItsRow: a short English name in a right-to-left tree stays at the start of its row.ACellKeepsThePlaceOfWhatItHoldsInThePagesDirection: in a right-to-left table, a number stays at the end of its column, and a badge and the link of a title in the page's language at the start of their cells.ACutValueLosesItsOwnEnd: at 320 pixels, the page header title, the current level of a breadcrumb (which had the rule already) and a tag are cut, and their first character is in view.Without the stylesheet change the first two fail on every part but the breadcrumb (checked on the base branch); the third failed on the first version of this pull request, which isolated whole cells. All three pass.
dotnet build -c Release -warnaserrordotnet test --project tests/FluentCMS.Components.Testsdotnet test --project tests/FluentCMS.Components.Browser --filter-namespace ...Foundations --filter-namespace ...Data --filter-namespace ...Layout --filter-namespace ...Navigation(three modes)Layout.DisclosureRoundTripTests.EarlierAcknowledgementsCannotUndoLaterNativeToggles(Server)failed once in the full run and passed 5 of 5 alone (the disclosure is not changed here)node design/tools/contrast.mjsnpx --yes markdownlint-cli2@0.24.2 "**/*.md"Not run locally: Firefox and WebKit (nightly), the visual job (CI only).
Visual baselines
The light captures should not change: a value in the page's own language is laid out as before. The
dark-compact-rtlcaptures change where a part holds English text in a right-to-left page: it is now laid out left to right and, where it is short, sits at the left. Each changed capture is reviewed from the CI artifact.Closes #172