refactor(layout): lift page metadata into ResolvedPage#2810
refactor(layout): lift page metadata into ResolvedPage#2810
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68ac032cf7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const className = kind === 'header' ? CLASS_NAMES.pageHeader : CLASS_NAMES.pageFooter; | ||
| const existing = pageEl.querySelector(`.${className}`); | ||
| // Provider still receives legacy page — its signature is not changed in this PR | ||
| const data = provider ? provider(page.number, page.margins, page) : null; |
There was a problem hiding this comment.
Pass resolved metadata into decoration provider
renderDecorationSection still calls the provider with source-page data (provider(page.number, page.margins, page)), but this refactor moved page metadata into ResolvedPage and the rest of this method now uses resolvedPage fallbacks for margin/anchor math. If sourceLayout.pages omits optional metadata while resolvedLayout.pages has it, the header/footer provider (e.g., HeaderFooterSessionManager.createDecorationProvider, which reads page.sectionRefs, sectionIndex, and margins) will resolve the wrong decoration variant or offsets, producing incorrect headers/footers even though the resolved data is present.
Useful? React with 👍 / 👎.
Summary
margins,footnoteReserved,numberText,vAlign,baseMargins,sectionIndex,sectionRefs,orientationtoResolvedPagelayoutEpochtoResolvedLayoutresolveLayout()PR Stack (SD-2563: Dumb Painter Refactor)
Test plan
resolvedPage?.x ?? page.xfallback)