Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ce863ed68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const blockById = new Map<string, FlowBlock>(); | ||
| finalBlocks.forEach((block) => { | ||
| blocks.forEach((block) => { | ||
| blockById.set(block.id, block); | ||
| }); | ||
| const injected = injectFragments( | ||
| layout, | ||
| finalPlan, | ||
| finalMeasuresById, | ||
| reservesAppliedToLayout, | ||
| blockById, | ||
| finalPageColumns, | ||
| ); | ||
| const injected = injectFragments(layout, plan, measuresById, reserves, blockById, pageColumns); |
There was a problem hiding this comment.
Recompute footnote assignments after final relayout
After the final layoutDocument(...) call applies the updated reserves, this code still injects fragments using plan, pageColumns, and measuresById that were computed before that relayout. If pass‑2 reserves change pagination (e.g., a footnote pushes content to the next page), the assignments and plan are stale and injectFragments can place footnotes on the wrong pages or overlap content. The previous logic re‑resolved assignments/measures against the post‑relayout layout to avoid this; consider recomputing those inputs after the final relayout when pagination can change.
Useful? React with 👍 / 👎.
Hi @harbournick! The issue with footer overlap appears when one of the footnotes is pushed to the next page with inserted footnote container. I noticed that in second calculation round we get correct results but then we recalculate it one more time and for some reason footnotes reserves result changes back to the result of first round. When removing this final round the issue seems to be fixed