Skip to content

feat(templates): let Sidebar Portrait draw a CV longer than one page - #584

Open
DemchaAV wants to merge 1 commit into
feat/column-flow-paginationfrom
feat/sidebar-portrait-column-flow
Open

feat(templates): let Sidebar Portrait draw a CV longer than one page#584
DemchaAV wants to merge 1 commit into
feat/column-flow-paginationfrom
feat/sidebar-portrait-column-flow

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

Sidebar Portrait held its whole body in one flow.addRow. A row is one atomic band
that must fit the page it starts on, so the preset capped every block to stay under
that bound — two jobs, two degrees, five skills, three languages, two projects — and
dropped the rest without a word. A denser CV came out looking finished, one job short,
and the reader had no way to know. The caps could not simply be deleted either:
uncapped content raised AtomicNodeTooLargeException rather than paginating.

What

The body is addColumnFlow now, with the same 0.34 / 0.66 weights and no gap, and all
five caps are gone. Both columns continue onto the pages they need, and the page
backgrounds keep painting both fills on every page.

Two smaller changes ride along. The rule under each main-column section title is
line.fill() instead of a fixed 346pt: that width was 21pt wider than the column's
content box on A4 (324.88pt) and wider still on a narrower page — a row slot does not
check a child's measured width, and a column does, which is how it surfaced. And each
section heading is kept with the block it introduces, as in every single-column preset;
a body that can break at all can strand its heading at the foot of a page. Neither moves
a pixel of the canonical render — the baseline is byte-identical across both.

The portrait geometry stays as designed, which puts a floor under the page width: below
about 310pt the sidebar column has no room left for the photo and the layout now says
so. The same page previously rendered with the portrait laid over the main column,
because the row slot skipped the check.

Tests

SidebarPortraitContentFidelityTest (new, qa) renders a career denser than one page —
five jobs, four degrees, twelve skills, five languages, three projects — and asserts that
each one of them reached the PDF text, that both columns (not only the main one) carried
past the first page, and that they stayed side by side rather than stacking. Re-adding
any cap turns it red.

Visual baseline for sidebar_portrait re-recorded (two pages now), committed preview
assets/readme/examples/cv-sidebar-portrait-v2.pdf regenerated, and the full examples
catalogue (105 documents) still generates. Full reactor gate green — qa 875 — japicmp
clean against both baselines, javadoc 0 warnings.

MonogramSidebar and MintEditorial still carry their caps; they follow one preset per
PR. MonogramSidebar is a direct swap (one addRow frame); MintEditorial hand-slices
itself into PageOne / PageTwo rows, so that one is a rework rather than a swap.

Two things this surfaces are left as separate work: continuation pages have no top safe
area (page 2 starts its first line a few points from the trimmed edge, because the
column's top padding applies once per section, not once per page), and the canonical
layout-snapshot JSON for this preset is read by no test and still records the old row
layout.

The preset held its body in one flow.addRow. A row is one atomic band that
must fit the page it starts on, so the preset capped every block to stay
under that bound — two jobs, two degrees, five skills, three languages, two
projects — and dropped the rest without a word. A denser CV came out looking
finished, one job short. The caps could not simply be deleted either:
uncapped content raised AtomicNodeTooLargeException rather than paginating.

The body is a column flow now, with the same 0.34 / 0.66 weights and no gap,
and all five caps are gone. Both columns continue onto the pages they need,
and the page backgrounds keep painting both fills on every page.

Two smaller changes come with it. The rule under each main-column section
title fills the column instead of drawing a fixed 346pt: that width was 21pt
wider than the column's content box on A4 and wider still on a narrower page
— a row slot does not check a child's measured width, and a column does. And
each section heading is kept with the block it introduces, as in every
single-column preset; a body that can break at all can strand its heading at
the foot of a page.

The portrait geometry stays A4-sized, which now has an edge: below roughly
310pt of page width the sidebar column has no room for the photo and the
layout fails instead of drawing it over the main column.

SidebarPortraitContentFidelityTest renders a career denser than one page and
asserts that each of its four degrees, twelve skills, five languages, five
employers and three projects reached the PDF, that both columns carried past
the first page, and that they stayed side by side. Visual baseline and the
committed preview re-recorded; both now run to two pages.
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