Repository navigation
test(qa): hold the ways a page breaks inside a panel in the DOCX fidelity corpus - #965
Merged
Merged
Conversation
…lity corpus The DOCX fidelity corpus had no document in which a page breaks inside a panel, so the gate holding every line of the corpus in LibreOffice and Word could not see an editor set one off the page again. A synthetic family joins it, built for shapes no preset has: a page break among a card's children and inside a card nested in it, breaks the page ignores in a row's column and a stack's layer, and a bordered card whose table runs over three pages with other margins from the second. ObsidianInvoice and MeteredInvoice with their line items repeated join the invoices. The Word and Windows LibreOffice baselines take the five documents' rows alone.
…elity baseline The five documents' rows come from the pull request's first CI run, in which the DOCX Fidelity job failed on them alone, each not yet in the baseline. LibreOffice 24.2 sets each on the pages the PDF does; the two long invoices' line items stand high page after page, as the presets' long tables do, and their last pages, where the page break after the cards and the gap above the closing row are, within 0.8pt. The fixture's Javadoc says what the bordered card's spacing limit looks like when a change tips it there; CONTRIBUTING says a preset on a longer fixture stays in its family's corpus class; the Word fidelity script's synopsis names the synthetic documents.
The gate holds the lines it finds; ObsidianInvoice's line items stand high in LibreOffice 24.2 without growing page after page, as MeteredInvoice's do. The bordered card's Javadoc says to check the export's report before re-spacing it, as a lost section at the cut looks the same in the gate.
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
The ways a page breaks inside a panel are each held by unit tests and qa tests that read the written DOCX:
Each was measured in Word and LibreOffice once, when it was fixed. No document of the DOCX fidelity corpus has any of these shapes, so the gate that holds every line of the corpus where the editor set it — LibreOffice in CI, Word on Windows — would not notice an editor setting one of them off the page again.
What changed
SyntheticDocxCorpus(new familysynthetic): documents built for shapes no preset has on its own fixture.break_in_panel: a card with a page break among its children and a card nested in it with a break of its own, over three pages.break_in_column: page breaks in a row's column and in a stack's layer, on one page.card_over_pages: a bordered card whose table of 60 rows, its header repeated, runs over three pages, the pages after the first set against a larger top margin. It is spaced so that page 1's rows leave room for the paragraph that ends a Word section at the cut: at a gap of 8 or 10pt the export names page 2's margins instead, and both editors set page 2 with page 1's (measured: 52.9pt high).InvoiceDocxCorpus:obsidian_long(line items ×12: the card run over four pages with other margins from page 2, and the break after the info cards) andmetered_long(×9: the gap above the closing row carried onto page 4). ItswithLinesRepeatedreplaces the private copies inInvoicePanelOverPagesDocxTestandInvoiceNaturalPageBreakDocxTest.DocxFidelityCorpusTest.corpus()takes the synthetic family: 62 documents → 67.word-windowsandlibreoffice-windowstake the five documents' rows alone, copied from what their runs measured; the presets' rows stay as recorded. Word here is now 16.0.20527 and the presets' rows were recorded with 16.0.20430: retaking them would carry that build's drift into this change.libreoffice-linuxtakes the five rows from this PR's first CI run (artifactdocx-fidelity-40241271303), where the job failed on those five alone, each not yet in the baseline. A comment under each file's header says where the added rows were measured.CONTRIBUTING.md(the corpus's synthetic documents, where a preset on a longer fixture and a shape no preset has join), thedocx-fidelityjob's comment inci.yml, the synopsis ofword-fidelity.ps1, the CHANGELOG.Measured
Pages, lines found, then the median and p90 of the found lines' drift down (pt); the gate holds each line's drift across as well:
synthetic-break_in_panelsynthetic-break_in_columnsynthetic-card_over_pagesinvoice-obsidian_longinvoice-metered_longObsidianInvoice's info cards to page 5 (the 17 lines not found; page 5 128.6pt low), where Word and LibreOffice 24.2 keep them on page 4.ObsidianInvoice's by up to 10pt;MeteredInvoice's more so page after page, by a median of 52 and 87pt on its second and third pages, 16 of its lines on another page — as it sets the presets' long tables (invoice-meteredalone: p90 10.6pt). The last pages, which carry the page break after the cards and the gap above the closing row, stand within 0.8pt:ObsidianInvoice's page 5 at +0.02pt,MeteredInvoice's page 4 at −0.52pt.ObsidianInvoice's info cards and totals stand up to 1.9pt low. Across, Word setscard_over_pages's amounts 36.4pt left — its table's first column narrower than its grid, 49 of 114 lines — where LibreOffice keeps the grid (0.6pt).break_in_panel's card after its explicit breaks stand 3 to 5pt high. LibreOffice 24.2 also sets a card's text right — 8.6pt inbreak_in_panel, 7.1pt incard_over_pages— as it does some of the presets' panel lines in its baseline (cv-panelup to 8.6pt); 26.8 on Windows does not.Tests
render-docxinstalled, and the corpus run against the extended baselines; each sabotage alone, and every one caught:synthetic-break_in_panel; a break written in a row's column (fix(docx): write no page break in a row's column, a stack's layer or a table's cell #961) failssynthetic-break_in_column; a panel run over pages written as one table (fix(docx): cut a panel whose table runs over pages into a table a page #962), and no section at a panel's cut where the margins change (fix(docx): end a page-margin section at a panel's cut #963), each failsynthetic-card_over_pages; a row opening its page holding no gap carried there (fix(docx): break a page after a card where the layout breaks it #964) failsinvoice-metered_long.invoice-obsidian_long(17 lines lost, the rest of page 5 123.5pt off); a rule opening its page holding no space above it (fix(docx): break a page after a card where the layout breaks it #964) fails it too (its page-5 lines 13pt high). LibreOffice 26.8 lets that one through: it carries Obsidian's info cards to page 5 either way.ObsidianInvoice×12's page 5 13.0pt high andMeteredInvoice×9's page 4 12.8pt high in LibreOffice 24.2 (measured for fix(docx): break a page after a card where the layout breaks it #964). Against these rows, page 5 at +0.02pt and page 4 at −0.52pt, that is past the gate's 0.5pt, so CI fails both. Keep-with-next in a cell is held by Word alone: LibreOffice keeps the cards on page 4 with it or without it. For fix(docx): cut a panel at a page break in a section or panel inside it #960 to fix(docx): end a page-margin section at a panel's cut #963, CI sets the three synthetic documents as 26.8 does: the same pages and lines found, the same median and p90 down to the hundredth.scripts/docx-visual/word-fidelity.ps1(Word 16.0.20527) → the corpus test inwordmode passes on all 67 documents against the extendedword-windows.-Dgraphcompose.docxFidelity=libreoffice→ the five new documents pass against the extendedlibreoffice-windows;invoice-obsidianandproposal-indigofail as on2.5-dev(below).InvoicePanelOverPagesDocxTest(3) andInvoiceNaturalPageBreakDocxTest(2) pass on the sharedwithLinesRepeated../mvnw -B -ntp -f aggregator/pom.xml clean verify -pl <core, render-pdf, render-docx, render-pptx, templates, testing, qa, coverage> -am→ BUILD SUCCESS: core 823, render-pdf 339, render-docx 2256, testing 5, render-pptx 142, templates 127, qa 1835../mvnw -f examples/pom.xml test→ BUILD SUCCESS, 93 tests.Named, not fixed
synthetic-break_in_panelhas it; no preset breaks a page inside a panel.card_over_pagesis spaced around a limit of fix(docx): end a page-margin section at a panel's cut #963: at a gap of 8 or 10pt above the card, page 1's rows leave no room for the paragraph that ends a Word section at the cut, the export names page 2's margins, and both editors set page 2 with page 1's, about 53pt high. A change to a table's metrics can tip it there; the class's Javadoc says so, and the answer is to re-space the fixture.MeteredInvoice's more so page after page and with 16 lines on another page, as it does the presets' long tables. The gate compares each line's drift to its baseline's either way, so on those pages a change that moves lines back toward the page passes; their last pages, where the P0-5 shapes are, stand within 0.8pt and are held.card_over_pages's table 36.4pt left, the table nested in the card with its first column narrower than its grid; LibreOffice keeps the grid. Nothing to do with the page breaks; the baseline holds it.ObsidianInvoice's info cards to page 5 with its line items repeated 12 times, where LibreOffice 24.2 and Word keep them on page 4. It did so before the page break after the cards was fixed as well (the same document exported before and after it, converted by the same 26.8: identical). The Windows baseline holds it as it stands.libreoffice-windowsalso failsinvoice-obsidianandproposal-indigoon2.5-devitself: LibreOffice 26.8 sets each on 2 pages against the page's 1. It set them so before the page break after a card was fixed too (the export before that change, converted by the same build); an earlier change since that baseline was taken (2026-10-14) moved them. This change exports both as before, and the five new documents pass it.-Dgraphcompose.docxFidelity.update=truekeeps one note: the comment saying where the five documents' rows were measured goes with it.Lane: tests (qa). No public API change, and no change to the export.