Repository navigation
fix(docx): name what a table's cell is composed of by its cell in the report - #953
Merged
Merged
Conversation
… report - The layout lays a composed cell's content out under its table and gives it no path of its own, so every note about a node there carried none: 216 of the corpus's 1384 notes. Two cells composed alike could not be told apart, nor which cell a note was about. - DocxLayoutMetrics names such a node under its table's path by its cell, row[r]/cell[c] (the cell's index among those authored for the row), then by its own segment, nested tables included. No layout path reads so, so the node still finds no placement of its own. The cell paths are merged in only where the flow names nothing: a node in the flow too keeps the flow's path, and one at several places the last. - Told by its path, a composed node's losses go into one note, as a flow node's do. - The file is unchanged: the 62 corpus DOCX are byte for byte the same and so is the text of their notes. The 17 notes left without a path are about the whole document.
DemchaAV
marked this pull request as draft
October 24, 2026 08:29
- What a table's cells hold is named once the flow is named (indexCells), under the table's own path: a table in the flow and in another table's cell named what it held under that cell, the table itself under the flow. pathsWithin, which the page-zone lookups use, is the layout's paths alone again. - The text match skips a table with no fragments of its own: one composed in a cell, whose text the table holding it lays out. - The report's contract names the paths that are not a node's: page N, section N and section N, page N; and that a note about the whole document or a page zone's node has none. The cell index is the cell's among those authored for the row, which a row span from above moves on too. - CHANGELOG: only an anchor's loss joins a composed node's note. - Tests: through the export, a table in a cell; a table in the flow and in a cell; a row span; the composed capsules told apart by path.
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
A DOCX export's report names each node it could not carry as authored by the node's path, the one the layout graph addresses it by. The layout lays a composed cell's content (
DocumentTableCell.node(...)) out under its table and gives it no path of its own, so every note about a node there hadpath == null.That was 216 of the corpus's 1384 notes: a rounded panel's corners in
CobaltRota's schedule, inline icons and rating dots drawn as pictures in CV sidebars, a nested chip's right border and left edge. Two cells composed alike could not be told apart, nor which cell a note was about.What changed
DocxLayoutMetricsnames what each table cell holds, after the flow is named, under the table's path by its cell, then by its own segment (indexCells):row[r]/cell[c], whereris the row's index among the table's rows andcthe cell's among the cells authored for that row, from 0 — not its column in the grid, which a cell spanning columns before it or rows into its row from above moves on;CobaltRota[0]/Schedule[0]/row[7]/cell[7]/ShiftBlock[0]/row[1]/cell[0]/Chip[0].pathsWithin, which the page-zone lookups use, stays the layout's paths alone.DocxExportReport.Builder.addTo, which tells nodes by path). With its outline entry not written either, it gave two notes, and gives one.DocxExportReport's contract now also names the paths a note may carry that are not a node's —page N, and in a document of several sectionssection Norsection N, page N— and that a note about the whole document or about a node of a page zone has none.matchComposedTextskips a table with no fragments of its own: a table composed in a cell, whose text the table holding it lays out.DocxExportReport's Javadoc and in the recipe;Verification
DocxComposedCellPathTest(8 new tests):DocxCellRuleRoomTestandDocxTableColumnsLeftToTheEditorTestasserted a null path for composed content; they now assert the cell path.DocxPanelLayerAlignTestasserts a composed layer's path.DocxCarriedWithoutReportTesttells the composed capsules apart by their paths.DocxAnchorWithoutABookmarkTestgains a composed section with one note../mvnw -B -ntp clean verify -pl <core, render-pdf, render-docx, render-pptx, templates, testing, qa, coverage> -am→ BUILD SUCCESS: core 823, render-pdf 339, render-docx 2137, testing 5, render-pptx 142, templates 127, qa 1830../mvnw -f examples/pom.xml test→ BUILD SUCCESS, 93 tests.Lane: shared-engine (render-docx).
DocxExportReportis@Beta; its record is unchanged, and whatNote.path()holds is documented.