Skip to content

Fix first-child page overflow#5

Merged
earonesty merged 1 commit into
mainfrom
agent/fix-first-child-page-overflow
Jul 14, 2026
Merged

Fix first-child page overflow#5
earonesty merged 1 commit into
mainfrom
agent/fix-first-child-page-overflow

Conversation

@earonesty

@earonesty earonesty commented Jul 14, 2026

Copy link
Copy Markdown
Owner

What changed

  • refuse stack fragmentation when the first child does not fit in the remaining page space
  • apply the same rule to table row fragmentation
  • add regression coverage for photo-card-style stacks and tables
  • bump the package version from 1.9.0 to 1.9.1

Why

The splitters previously forced the first child or row into the current page even when its measured height exceeded the remaining space. That could draw an image past the page boundary and make it appear cropped, while moving only its caption to the next page.

The paginator now returns no split when nothing fits, allowing the outer flow logic to move the complete node to a fresh page. Content taller than a completely empty page still renders once rather than causing a pagination loop.

Validation

  • pnpm run typecheck
  • pnpm run test (171 tests)
  • pnpm run build
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes

    • Improved pagination behavior when the first content item cannot fit on the current page.
    • Prevented fragmentable stacks and tables from splitting incorrectly, ensuring they move cleanly to the next page when needed.
  • Tests

    • Added regression coverage for stack and table pagination scenarios.
  • Chores

    • Updated the package version to 1.9.1.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7bf37450-be41-4352-a0d8-6213a682bde9

📥 Commits

Reviewing files that changed from the base of the PR and between 11116f9 and 8b1a788.

📒 Files selected for processing (3)
  • package.json
  • src/document.ts
  • test/render.test.ts

📝 Walkthrough

Walkthrough

Pagination split selection now requires candidate content to fit available space for normal and table stacks. New render-flow tests cover moving oversized first children to the next page, and the package version is bumped to 1.9.1.

Changes

Pagination correction

Layer / File(s) Summary
Split selection and regression coverage
src/document.ts, test/render.test.ts
Normal and table stack splitting no longer advances after an overflowing first child; regression tests verify page counts and render phase ordering.

Package release metadata

Layer / File(s) Summary
Package version update
package.json
Updates the package version from 1.9.0 to 1.9.1.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a rabbit hopping pages ahead,
No oversized child gets misread.
Tables now wait for room to appear,
While stacks move neatly, far from fear.
Version carrots say “1.9.1” here!

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main fix: preventing first-child overflow during pagination.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed No security-sensitive code paths were added: the PR only tightens pagination splitting and adds tests; it removes a pagination-loop risk rather than introducing one.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-first-child-page-overflow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@earonesty
earonesty marked this pull request as ready for review July 14, 2026 20:36
@earonesty
earonesty merged commit 5563ac1 into main Jul 14, 2026
1 check passed
@earonesty
earonesty deleted the agent/fix-first-child-page-overflow branch July 14, 2026 20:40
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