Skip to content

feat(pdf): debug node-label overlay - PdfDebugOptions with guides + semantic path badges#163

Merged
DemchaAV merged 1 commit into
developfrom
feat/pdf-debug-node-labels
Jun 11, 2026
Merged

feat(pdf): debug node-label overlay - PdfDebugOptions with guides + semantic path badges#163
DemchaAV merged 1 commit into
developfrom
feat/pdf-debug-node-labels

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

What

DebugMode grows a second overlay: semantic node labels. PdfDebugOptions (guides + node labels + label-text mode) configures the canonical PDF backend via GraphCompose.document(...).debug(...), DocumentSession.debug(...), or PdfFixedLayoutBackend.builder().debug(...).

With nodeLabels() enabled, every rendered node prints its stable semantic path — the same path layoutSnapshot() 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.
  • Debug overlays draw strictly on top of content, never touch measurement/pagination; disabled output stays byte-identical (covered by a same-length test, existing snapshots untouched).

Plumbing

  • New DebugOverlayExample (features/debug) registered in GenerateAllExamples + ShowcaseMetadata (new "Debug & Diagnostics" group), examples README row + section, committed preview assets/readme/examples/debug-overlay.pdf (1.7 KB).
  • CHANGELOG v1.8.0 → Public API entry.

Verification

  • 13 new tests: 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).
  • Full gate: ./mvnw verify -pl .1233 tests, 0 failures, javadoc green.
  • Badge placement tuned against the rendered PDF over two iterations (top-left covered content start; final corner-badge straddles the top edge so only an ascender half-strip can be covered).

…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.
@DemchaAV DemchaAV merged commit a211a8a into develop Jun 11, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/pdf-debug-node-labels branch June 11, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant