feat: support paragraph between borders (w:pBdr/w:between)#2302
feat: support paragraph between borders (w:pBdr/w:between)#2302gpardhivvarma wants to merge 2 commits intosuperdoc-dev:mainfrom
Conversation
…dev#2074) Flow `w:between` borders through the rendering pipeline so consecutive paragraphs sharing the same border definition display a horizontal separator line between them. - Add `between` to `ParagraphBorders` contract type - Include `between` in `normalizeParagraphBorders` side iteration - Add `bw:` segment to `hashParagraphBorders` in both hash util files - Add `computeBetweenBorderFlags` to pre-compute which fragments need the between border, following the `computeSdtBoundaries` pattern - Render between border as CSS `border-bottom` on decoration overlay - Handle header/footer sections, page splits, and patch invalidation - Add 55+ tests covering edge cases
caio-pizzol
left a comment
There was a problem hiding this comment.
@gpardhivvarma solid work — logic looks correct and well-tested with 55+ unit tests.
two things:
-
the incremental update path (renderer.ts:2207) where a fragment switches in/out of a between-border group isn't tested. there's a good example to follow in
clip-path-cache-invalidation.test.ts— render, change the data, re-render, check the element got replaced. -
we'll add a test document with between borders to the visual test suite on our end.
Cover the patch path in renderer.ts where a fragment switches in/out of a between-border group, verifying the DOM node is rebuilt when the betweenBorderMismatch flag flips.
|
@caio-pizzol please review this when you get the time. |
|
Closing in favor of #2324, which builds on this work with an improved between-border group model and extracts the rendering logic into a dedicated feature module ( Thanks for the initial implementation @gpardhivvarma! |
Summary
Closes #2074
w:betweenborders through the full rendering pipeline so consecutive paragraphs sharing the same border definition display a horizontal separator line between thembetweentoParagraphBorderscontract type andnormalizeParagraphBordersside iterationcomputeBetweenBorderFlagsto pre-compute which fragments need the between border (following thecomputeSdtBoundariespattern)border-bottomon the decoration overlay, with support for header/footer sections, page splits, and patch invalidationTest plan
normalizeParagraphBordersincludesbetweenside (pm-adapter tests)hashParagraphBordersincludesbw:segment (both hash util files)computeBetweenBorderFlags— matching borders, non-matching, page splits, same-block dedup, list items, mixed types, chains, empty/single fragments, missing lookup, asymmetric bordersapplyParagraphBorderStyles— activation, bottom border overwrite, partial specs, defaultsgetFragmentParagraphBorders— para, list-item, missing data, kind mismatch