Repository navigation
Conversation
A column could split inside the window after a minPresenceAhead node, leaving the node at the page bottom with a line or two after it. Decline the split like a row slice, so the node moves to the next page together with the column.
|
@exoego is attempting to deploy a commit to the diegomura Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Sorry, will recreate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With the new engine (
experimentalPaginationor a pagelayout), a node withminPresenceAheadcan be left at the bottom of a page with only a line or two after it. This happens when the next sibling is a container that stacks its children vertically, like a table made ofViewrows. The engine breaks the page inside that container.The legacy engine moves the node to the next page instead. #3504 promised the same thing for the new engine. No page break may fall inside the window after the node. If the window does not fit, the node moves to the next page.
Repro
ViewCause
#3504 checks the window at three places. These are break candidates, leaf splits, and row slices. A split inside a column is not checked.
fit/row.tsdeclines a row slice inside a window.fit/column.tshas no such check. The column's children are filled by a separatefillthat does not know about the outer window. So the outer fill accepts the split without checking the window.Fix
Add the same check from
fit/row.tstofit/column.ts. A column split is also a break at the page bottom, so it is not allowed inside a window. When the column declines,tryOverflowrewinds to the last break candidate. No candidate is recorded inside the window, so it rewinds to before the node. The node and the column then move to the next page together.Tests
paginate.test.tshas a new case inminPresenceAhead windowswhere the item after the window is a column. It also takes an image snapshot (min-presence-column-no-split.png).parity.test.tshas a new case inminPresenceAheadwhere the next sibling is aViewwith children. It checks that the new engine matches the legacy engine.Both tests fail without the fix and pass with it.
I also checked a real 273-page report full of tables. Without the fix, the new engine made 270 pages and started to differ from the legacy engine at page 13. With the fix, it made 273 pages, and every page matched the legacy output pixel for pixel.