Commit 6e46bd2
committed
fix(footnote): broaden preferred-reserve candidate filter for partial splits (SD-2656)
Vivienne's feedback on the rendering-fidelity PR called out footnotes
splitting across pages even when Word fits them on a single page.
Repro fixtures: 086 Carlsbad and b89cc7aa.
## Root cause
`isMandatoryOnlyFootnotePage` only flagged a page as a preferred-reserve
trial candidate when:
actual_band ≈ mandatory AND lastAnchorRenderedLines <= 1
The scorer therefore never considered pages where the last anchor rendered
2+ lines and the remainder still spilled. These "partial split" cases are
the most common user-visible bug because the reader has to scroll to the
next page mid-footnote.
Repro on b89cc7aa.docx:
page 16 — anchors=[4], mand=36, pref=82, actual=51, lastL=2, fn4 spilled
Repro on 086 Carlsbad:
page 26 — anchors=[24], mand=42, pref=150, actual=116, lastL=5, fn24 spilled
page 34 — anchors=[36], mand=42, pref=187, actual=61, lastL=2, fn36 spilled
None of these entered the trial set.
## Fix
Adds `isSplitLastAnchorFootnotePage`: a page is also a candidate when its
last anchor appears in continuationOut AND the preferred reserve is
meaningfully bigger than current actual. `getPreferredReserveCandidates`
unions both predicates.
The scorer's accept criteria (no new cluster spills, no new mandatory-only
pages, bounded dead-reserve growth, candidate rendered lines improved)
stays unchanged — only the candidate filter widens.
## Verified
- b89cc7aa.docx: 4 split pages -> 1 split page (Vivienne's screenshot case
on page 16 now renders fn4 fully on the anchor page).
- 086 Carlsbad.docx: 12 split pages unchanged (the remaining cases are
multi-anchor with preferred deltas large enough that the scorer
correctly rejects because of downstream cascade — same global
protection as before).
- IT-923 (NVCA Model COI): 50 pages unchanged. No regression.
- 1253 layout-bridge tests pass (1 new test for the partial-split
predicate, covering Vivienne's b89cc7aa page 16 and Carlsbad page 26
patterns plus a non-spilled counter-example).
- 657 layout-engine, 1136 painter-dom pass.1 parent d4a8353 commit 6e46bd2
2 files changed
Lines changed: 82 additions & 1 deletion
Lines changed: 32 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
84 | 111 | | |
85 | 112 | | |
86 | 113 | | |
87 | 114 | | |
88 | 115 | | |
89 | 116 | | |
90 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
91 | 122 | | |
92 | 123 | | |
93 | 124 | | |
| |||
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
75 | 125 | | |
76 | 126 | | |
77 | 127 | | |
| |||
0 commit comments