docs(recipes): say that a table cell takes a direction too - #679
Merged
Conversation
The text-direction recipe still told readers that text in a table cell carries no direction, so Hebrew comes out of a cell reversed and Arabic unjoined, and that right-to-left text belongs in paragraphs instead. That was true when the page was written, with #536, and stopped being true two days later, when #558 gave DocumentTableStyle a direction of its own. The README and the backend capability matrix already say so; this page was the one place still saying the opposite. The stale paragraph under Where direction stops gives way to a Tables section that describes what the code does today: - the style builder's `direction(...)` takes `LTR`, `RTL` and `AUTO` and follows the cell-style cascade: `defaultCellStyle`, `columnStyle`, `rowStyle`, then the cell's own `withStyle`; - a composed-paragraph cell takes its direction from the paragraph; - `AUTO` is read per cell, over the whole cell; - a right-to-left cell sits at its right edge unless a `textAnchor` anywhere in its cascade says otherwise, a table-wide `TOP_LEFT` included; Word output is the exception, since the DOCX backend writes no alignment for a plain-text cell; - auto-width columns are measured on the joined Arabic forms, and a cell that declares nothing still draws Hebrew and Arabic the right way round. What still stops is stated where the old paragraph stood: only paragraphs and table cells declare a direction; a list carries none, so each item is a left-to-right paragraph and `align(TextAlign.RIGHT)` moves it to the right margin while its bullet stays at the item's left end; and column order is not mirrored. The new snippet carries a doc-example marker, so DocumentationSnippetCompileTest compiles it from now on.
DemchaAV
added a commit
that referenced
this pull request
Sep 12, 2026
Brings the 2.4.0 engine work onto the promotion branch: native letter spacing (#676), opt-in list hanging indent (#674), the resolved timeline rail (#671-#673), the row-child margin fix, the RTL documentation corrections (#679, #680) and the templates japicmp gate (#681). Eight files conflicted. CHANGELOG.md is a union of both v2.4.0 sections, with the branch-local "### Deprecated" folded into the house heading "### Deprecations" and the sections ordered the way released entries are. The other seven are generated and were regenerated from the merged source rather than resolved by side: knowledge/api/templates.json and .md through extract-api --from-reactor, and the five cv preview PDFs by re-rendering their example classes. Five qa baselines moved, all from f75def6, which stops a row child's horizontal margin being taken off twice. Each of the four layout snapshots changes by exactly one node's own horizontal margin - HeadingRule_EXPERIENCE +9.0, EducationHeadingRule +11.285, FooterDueIcon -3.479 (a negative margin) and FooterSite +1.693 (a right margin) - with startPage and endPage unchanged, so no page ownership moved. cobalt_rota keeps its geometry snapshot and moves only in pixels, inside composed table cells, which emit fragments rather than PlacedNodes and so cannot appear in a layout snapshot; the changed region is the day-header and note cells. One of 126 pixel baselines changed, verified by checksum before and after.
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.
Why
docs/recipes/text-direction.mdstill says that text in a table cell carries no direction: the same Hebrew string draws reversed in a cell, Arabic comes out unjoined, and right-to-left text belongs in paragraphs. That stopped being true with #558, which gaveDocumentTableStyleadirection(...)of its own. The README and the backend capability matrix already describe table-cell direction; this page was the one place contradicting them.What changed
DocumentTableStyle.Builder.direction(...)withLTR/RTL/AUTO, following the cell-style cascadedefaultCellStyle→columnStyle→rowStyle→ the cell's ownwithStyle.AUTOis resolved per cell and over the whole cell; a right-to-left cell takes its right edge only when notextAnchoris set anywhere in its cascade, so a table-wideTOP_LEFTpins it left; the DOCX backend writes no alignment for a plain-text cell; auto columns are measured on the joined Arabic forms; an undeclared cell still draws Hebrew and Arabic in order; a composed-paragraph cell takes the paragraph's direction.align(TextAlign.RIGHT)moves them to the right margin but leaves each bullet at the item's left end; column order is not mirrored.doc-examplemarker, soDocumentationSnippetCompileTestcompiles it.Verification
Each statement is tied to code and an existing test; no code changed.
RtlTableCellTest8,PptxTableCellDirectionTest7,DocxTableCellDirectionTest6, qaRtlAcrossBackendsTest+RtlScenariosVisualTest15.com.demcha.documentation.*plusEnginePdfBoundaryTest(links and anchors, recipe catalogue, canonical surface, coverage) 115 green; qaDocumentationSnippetCompileTest6 +DocumentationExamplesTest12 green. Breaking the new snippet on purpose turnsDocumentationSnippetCompileTestred and namestext-direction-table-cell, so the guard really covers it.node knowledge/tools/claims/check-claims.mjs --checkandnode knowledge/tools/routing/check-routes.mjsgreen;git diff --checkclean.Lane: canonical — docs only (
docs/recipes/text-direction.md).