Skip to content

feat(cv-v2): migrate Panel preset#62

Merged
DemchaAV merged 1 commit into
developfrom
feature/cv-v2-panel-preset
May 26, 2026
Merged

feat(cv-v2): migrate Panel preset#62
DemchaAV merged 1 commit into
developfrom
feature/cv-v2-panel-preset

Conversation

@DemchaAV
Copy link
Copy Markdown
Owner

Summary

Ports the legacy Panel CV preset (PanelCvTemplateComposer stacked layout) onto the v2 layered architecture. The page reads as four equal-width panels sharing one card shell.

Visual layout

  • Header card — pale-teal fill, centred Poppins UPPERCASE name, job title, meta + link row.
  • Profile card — full-width white card with UPPERCASE teal module title and a small teal accent strip.
  • Two-column row
    • Left card: Skills · Education · Additional (3 separate panel cards)
    • Right card: Experience · Projects (2 separate panel cards)
  • All cards share a single shell (stroke 0.45pt, padding 8pt, cornerRadius 7pt) — only fill colour differs.

Architectural decisions

  • Width anchor — sections in v2 default to fit-content width inside vertical columns, so a long-content card (Skills) would otherwise render visibly wider than a short-content card (Education). widthAnchor(card, width) drops a zero-height spacer of the pre-computed target width as the card's first element, pinning every panel to identical outer widths.
  • Header name inlinedHeadline.uppercaseCentered rewrites the host card's padding via host.padding(theme.spacing().headlinePadding()), which would override the CardWidget padding and leak a wider outline for the header vs every panel below it. Inlined paragraph preserves the shared shell.
  • Preset-local card-body dispatcher — the engine bans nested horizontal rows and the side cards sit inside flow.addRow. EntriesSection headers therefore use EntryCompactRenderer.titleDateBody (single 'title - date' paragraph) instead of the standard EntryRenderer 2-column Row header.
  • CardWidget overload — added render(PageFlowBuilder, ...) so full-width top-level cards (Profile) render directly under PageFlowBuilder without an intermediate wrapper. The applyStyle path is shared between both render() overloads.

Theme additions — additive

  • CvPalette.panel() — body slate ink, pale teal stroke + banner fill.
  • CvTypography.panel() — Poppins/Lato, 22/8.9/10.4/9.4/9.4/9.0/9.4, 1.2 line spacing.
  • CvSpacing.panel() — 6pt page-flow gap, 8pt card padding, 2.2pt accent strip, 7pt corner radius.
  • CvTheme.panel() factory wires the three above with the classic decoration.

Test plan

  • ./mvnw test -Dtest=com.demcha.compose.document.templates.cv.v2.presets.PanelSmokeTest -pl . — 3/3
  • ./mvnw test -Dtest=com.demcha.compose.document.templates.cv.v2.presets.CvV2VisualParityTest -Dgraphcompose.visual.approve=true -pl . — 11/11 first-time baseline approval
  • ./mvnw test -Dtest=com.demcha.compose.document.templates.cv.v2.presets.CvV2VisualParityTest -pl . — 11/11 without approve (baseline locked in)
  • Visual review of examples/target/generated-pdfs/templates/cv/cv-panel-v2.pdf — all 6 panels render at identical column widths
  • CI green

Files

  • 6 modified: CvPalette.java, CvTypography.java, CvSpacing.java, CvTheme.java, CardWidget.java, CvV2VisualParityTest.java
  • 4 new: presets/Panel.java, presets/PanelSmokeTest.java, cv-v2-layered/panel-page-0.png baseline, examples/.../CvPanelExample.java
  • 765 insertions, 12 deletions.

Ports the legacy Panel CV preset (PanelCvTemplateComposer stacked
layout) onto the v2 layered architecture. The preset reads as four
equal-width panels of the same shell:

* Header card — pale-teal fill, centred Poppins UPPERCASE name,
  optional job title, centred meta + link line. Name paragraph is
  inlined instead of going through Headline.uppercaseCentered because
  that widget rewrites the card's padding via host.padding(...) which
  otherwise leaks into a visibly wider header outline.
* Profile card — full-width white card with UPPERCASE teal title,
  bronze-like teal accent strip, and the summary paragraph.
* Two-column row — left card stacks Skills + Education + Additional,
  right card stacks Experience + Projects. Each card is its own panel
  with the shared shell.
* All cards (header, profile, side modules) share a single
  CardWidget.Style: stroke 0.45pt, padding(bannerInnerPadding=8),
  cornerRadius(7). Only fillColor differs (header tinted teal vs
  panels white).

Section widths are anchored explicitly. v2 engine sections default to
fit-content widths inside a vertical column, so a card with long
content (Skills) would otherwise render visibly wider than a card
with short content (Education). The new widthAnchor(card, width)
helper drops a zero-height spacer of the pre-computed target width as
the card's first element, pinning every panel to identical outer
widths regardless of paragraph length.

Body rendering uses a preset-local dispatcher because the engine bans
nested horizontal rows and the side cards sit inside flow.addRow.
EntriesSection headers therefore use EntryCompactRenderer.titleDateBody
(single 'title - date' paragraph) instead of the standard
EntryRenderer's 2-column Row header.

Theme additions are additive:
* CvPalette.panel() — body slate ink, pale teal stroke + banner fill.
* CvTypography.panel() — Poppins/Lato 22/8.9/10.4/9.4/9.4/9.0/9.4 1.2.
* CvSpacing.panel() — 6pt page-flow gap, 8pt card padding, 2.2pt
  accent strip, 7pt corner radius.
* CvTheme.panel() factory wires the three above with the classic
  decoration.

CardWidget gains a PageFlowBuilder overload so top-level cards
(Profile) can be rendered directly under PageFlowBuilder without an
intermediate wrapper section. The applyStyle path is shared between
both render() overloads.

Tests:
* CvV2VisualParityTest now exercises 11 presets (added Panel); 11/11
  pass at the existing 50k pixel-diff budget against the new
  visual-baselines/cv-v2-layered/panel-page-0.png baseline (single
  page).
* PanelSmokeTest covers stable identity + default-factory and
  custom-theme render paths.
@DemchaAV DemchaAV merged commit fc4bb18 into develop May 26, 2026
9 checks passed
@DemchaAV DemchaAV deleted the feature/cv-v2-panel-preset branch May 26, 2026 10:15
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