Skip to content

Fix star-column allocation with minimum and maximum widths - #1866

Open
peterolkhov wants to merge 1 commit into
foliojs:masterfrom
peterolkhov:codex/fix-star-column-minimum-allocation
Open

peterolkhov wants to merge 1 commit into
foliojs:masterfrom
peterolkhov:codex/fix-star-column-minimum-allocation

Conversation

@peterolkhov

Copy link
Copy Markdown

What kind of change does this PR introduce?

Bug fix. A star column can consume space needed by a later column's minimum. On a standard Letter page with 50pt margins, ['*', { minWidth: 450 }] allocates [256, 450] despite a 512pt table width. Right-aligned content can end up entirely off the page; [62, 450] fits both bounds.

Resolve the active minimum/maximum bounds before dividing the remaining space. Keep fixed widths, capped leftover space and the existing infeasible-minimum behavior. Only the allocator and its unit tests change.

Added order, mixed-bound, fixed/percentage, spanning-cell and exact/infeasible-minimum regressions. Verified failures before the fix, and actual PDF output confirms the missing total is recovered while healthy controls remain byte-identical. Full tests (670), tools tests (53), Rollup builds, lint and formatting pass locally. Independent checks also cover a separate allocation oracle and source/built-package PDF output.

Tooling used compatible borrowed packages, with some PDF/image-test helper versions below the current declarations; this was not a frozen CI install. Other Node versions and a real browser runtime were not tested. Bound resolution is quadratic in the worst case; the ordinary unconstrained case takes one pass.

Checklist:

  • Unit Tests
  • Documentation — N/A; restores the documented equal-share/minimum/maximum behavior
  • Update CHANGELOG.md — not changed
  • Ready to be merged after review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant