feat(pdf): debug node-label overlay - PdfDebugOptions with guides + semantic path badges#163
Merged
Merged
Conversation
…emantic path badges PdfDebugOptions (guides / nodeLabels / LabelText NAME|FULL_PATH) configures the canonical PDF backend through GraphCompose.document().debug(...), DocumentSession.debug(...), or PdfFixedLayoutBackend.builder().debug(...). PdfNodeLabelRenderer prints each node's stable semantic path once per owner and page as a corner badge straddling the top-right edge of the owner bounds (base-14 Helvetica, non-WinAnsi degrades to '?'). guideLines(boolean) became sugar over the options; disabled debug output stays byte-identical (same-length assertion). Ships DebugOverlayExample + gallery/README registration + committed preview, 13 new tests across unit/integration/visual. Full gate: 1233 tests, javadoc, BUILD SUCCESS.
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.
What
DebugModegrows a second overlay: semantic node labels.PdfDebugOptions(guides + node labels + label-text mode) configures the canonical PDF backend viaGraphCompose.document(...).debug(...),DocumentSession.debug(...), orPdfFixedLayoutBackend.builder().debug(...).With
nodeLabels()enabled, every rendered node prints its stable semantic path — the same pathlayoutSnapshot()reports — once per node and page, as a small corner badge straddling the top-right edge of the node's union bounds (5pt base-14 Helvetica on a pale halo; non-WinAnsi name characters degrade to?instead of failing the render). Spot a misplaced block on the sheet, read its badge, grep the name in your builder code.LabelText.NAME(default) — compact own segment (PriceSummaryTitle[0]);FULL_PATH— whole ancestry.guideLines(boolean)everywhere became sugar over the options object; node-label settings survive the toggle.Plumbing
DebugOverlayExample(features/debug) registered inGenerateAllExamples+ShowcaseMetadata(new "Debug & Diagnostics" group), examples README row + section, committed previewassets/readme/examples/debug-overlay.pdf(1.7 KB).Verification
PdfDebugOptionsTest(value semantics incl. null rejection),PdfDebugNodeLabelsTest(PDFTextStripper-based: NAME/FULL_PATH modes, off-by-default, guides-only isolation, CyrillicШапка→?????[0]degradation, disabled-options length identity),DebugNodeLabelsDemoTest(visual diff vs plain render > 500 px)../mvnw verify -pl .— 1233 tests, 0 failures, javadoc green.