fix(docx): stand NavySidebar where the page sets it in Word — placed picture size, ring set-in, header margin, list sides - #802
Merged
Conversation
…e container's one layer set in from its edges
…d indent a list by its own sides
… its cell's hang, and pin the new rules with tests
…ge puts it, and pin both set-in edges
This was referenced Oct 1, 2026
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
In Word, everything in
NavySidebar's navy column stood 5.2pt high (3.3pt in LibreOffice). Its photo also stood a point below its ring, and itsCERTIFICATIONSheading stood a line above its badge. The column is a cell of the page's row, and its portrait is a 127pt ring round a 123.8pt photo, in a column 123.8pt wide.ACHIEVEMENTSandCERTIFICATIONSare lists indented 30pt to clear the badge beside their heading.What changed
writeImage. A picture the layout placed is written at the size it was placed, less its own padding.writeShapeContainer/layerSetIn. A shape container with a single layer keeps, as space above and below that layer, the gap the page leaves between it and the container's content top and bottom.hangBelowItsBoxtakes its overhang from the gap under the container, as before.blankZone/reachedPast. An empty header or footer against the page edge reaches a point into the page.placeBandalready holds it for a text band.writeList/indentListItemInside. A list's own left and right edges (margin and padding) indent its items.writeParagraphapplies to a paragraph's edges, the same editor slack in a cell included.CHANGELOG.md. Indocs/recipes/docx-export.md: the clipped-shape-container paragraph, the page-backgrounds paragraph (header and footer), and the paragraph on a list's own space.Verification
Full reactor gate:
./mvnw -B -ntp clean verify -pl :graph-compose-core,:graph-compose-render-pdf,:graph-compose-render-docx,:graph-compose-render-pptx,:graph-compose-templates,:graph-compose-testing,:graph-compose-qa,:graph-compose-coverage -amgives BUILD SUCCESS (core 818, render-pdf 339, render-docx 758, templates 142, testing 127, qa 1791).DocxPortraitTest(new).DocxPageBackgroundTest.DocxMultiSectionTest.anEmptyFooterDoesNotLiftABodyThatHasNoBottomMargin. A section with no margin and no footer, after one with a footer, writes its bottom margin as −1 twip and keeps its top at 0.DocxListNumberingTest.DocxHangingLeftTest.aListInACellOfAHangingRowMovesLeftWithTheTextBesideIt. In a hanging row's cell, a list and a title at the cell's padding stand the level's 9pt apart. The title stands where the page starts it, less the hang.DocxContainerSpacingTest.aShapeContainersEdgesAreSpaceAroundWhatItHolds. The paragraph after a row at the top of a 20pt rectangle now stands 7.05pt lower, as on the page: that is the space the outline holds under the row. 22 + 12.95 + 8 + 7.05 = 18 + 26 + 6.Each rule fails its own test when reverted:
Template corpus (62 documents), against
2.5-dev. Word, median drift of matched lines:NavySidebarSerifHeadlineProfessionalSidebarSidebarPortraitCharcoalGoldMonogramSidebarSlateOrangeMidnightNavyNavySidebar's photo now stands at 26.75pt from the page's top. The page puts it at 26.6pt; it stood at 27.7pt before.CERTIFICATIONSheading stands at 732.3pt in Word; the page puts it at 732.2pt.NavySidebaralone. The edge clamp and the hang in a list's indent change none of the 62.LibreOffice.
MidnightNavy, had its page row moved whole onto a second page, leaving the first empty. It now stands on one page, its lines within 0.1pt of where they stood.NavySidebargoes from 3.33pt to 2.87pt with the picture rules and to 2.8pt with the list rule.SerifHeadlinegoes from 1.03pt to 0.40pt with the picture rules.Known limits
docs/recipes/docx-export.mdrecords.layerSetInkeeps the set-in for a container with a single layer. A container of more layers, one of them written and the rest drawn, goes through the band path (writeOverlayBand), which this does not change.overlayDepth > 0), where the layer's box places them; a list in a card keeps the indent of the card's content.Lane: shared-engine (render-docx). No public API change.