Preflight: Expand full-bleed page-size support (PR 8263)

Run on branch BL-15958-page-sizes at 9aff745450. Gates green, Devin and CI finished, Greptile timed out, nothing waiting on you.

Ready for review Mergeable Greptile timed out 0 decisions waiting Board: Personal Review

What this PR is about

Problem

Bloom could make a full-bleed PDF at only six paper sizes (A5, A4, A3, USComic, HalfFolio, Size6x9), each hard-coded in C#. The edge-to-edge theme lets a book at any size run its pictures to the paper's edge, so printing it with bleed needs every paper size to work. Page dimensions were also parsed separately by each part of the code that needed them.

What the PR does

  • One source of page sizes. The front-end build writes output/browser/pageSizesLookup.json from DistFiles/pageSizes.json: every layout's width and height in millimeters, plus base names (A4), ISO A/B sizes and square sizes. SizeAndOrientation reads it. ePUB page dimensions and PDF full-bleed sizes now come from it instead of their own parsing and the hard-coded list.
  • Full bleed at every paper size. Letter, Legal, B5, A6, Cm13 and the other paper sizes now offer full bleed. Device, Ebook and PictureStory layouts are screen shapes and still don't.
  • Explicit trim and bleed boxes. Before handing a full-bleed PDF to dotImpose, Bloom writes each page's trim and bleed boxes itself. It uses dotImpose 2.6.8 (a release from nuget.org) and its NullLayoutMethod(), which reads those boxes.
  • Booklets and crop marks. Booklet layouts keep trim-sized source pages. Crop marks turn on automatically when printing with bleed.

Quality gate

CheckResult
C# buildPass
C# tests (dotnet test, full suite)Pass 3749 passed · 1 skipped · 0 failed
TypeScript tests (vitest)Not run: the only TypeScript change is src/content/pageSizes.ts, a build script that no vitest test imports, and nothing under BloomBrowserUI reads its output.
Formatting (prettier, pageSizes.ts)Pass
Typecheck / lint for src/contentN/A: none in that package
Merge with masterClean (master merged in this run)
Repo checksNone declared in AGENTS.md

What changed this run

Merged master (199 commits, no conflicts). Fixed two bugs the local review and Devin found: Ebook layouts were offered full bleed and then failed to print, and one rare path in PdfMaker skipped writing the page boxes. Added doc comments to the page-size lookup methods. Commits: 0a47201bdb (merge), 9aff745450 (fixes); all commits.

Reviewer outcomes

ReviewerOutcome
Local review (light sub-agent pass)Complete. 3 findings: 2 fixed in 9aff745450 (Ebook full bleed; skipped page boxes), 1 dismissed: a missing lookup file throws on first use, which is the fail-fast behavior AGENTS.md asks for, and the installer ships the file.
DevinComplete for 9aff745450. 4 bugs and 5 Investigate flags. Devin marks 2 bugs fixed. The other 7 each have a resolved review thread with its outcome: 1 fixed (doc comments), 6 not an issue or no longer applying to the current code.
GreptileTimed out after 33 min. Its only review is of the PR's first commit (2026-08-31); a re-review was requested at 21:00 UTC and had not arrived. Re-running preflight folds in a late review.
CI (pr-automation)Pass

Worth knowing

  • No one has yet made a real full-bleed PDF in a running Bloom at one of the newly enabled sizes (Letter, Half Letter, B5 and so on). Unit tests cover the sizes and page boxes. The test ideas on the card ask a tester to try it.