Skip to content

fix: Boxed Sections parser + structured WorkHistory/Education blocks + bold KeyValue (v1.6.4)#44

Merged
DemchaAV merged 1 commit into
developfrom
fix/boxed-sections-experience-layout
May 22, 2026
Merged

fix: Boxed Sections parser + structured WorkHistory/Education blocks + bold KeyValue (v1.6.4)#44
DemchaAV merged 1 commit into
developfrom
fix/boxed-sections-experience-layout

Conversation

@DemchaAV
Copy link
Copy Markdown
Owner

Summary

Patch release for Boxed Sections layout correctness and structural API additions.

Bug fixes

  • BoxedSections#parseWorkEntry accepts em-dash , en-dash , ASCII - as date/description separator (was ASCII-only).
  • Parser rejects post-pipe prose containing sentence punctuation when no explicit separator is found — Education entries like "... | 2019. First-class honours..." no longer collapse description into the right-aligned date column.
  • parseProjectItem gets the same separator set for consistency.

New structured API (preferred path)

  • WorkHistoryBlock(List<Item(title, organisation, date, description)>) — added to the Block sealed hierarchy.
  • EducationBlock(List<Item(degree, institution, year, details)>) — same pattern, structured rendering matches WorkHistory.
  • BoxedSections dispatches both directly to renderWorkEntry, bypassing the heuristic parser entirely.
  • Legacy MultiParagraphBlock pipe-separated lines continue to work; parseWorkEntry marked @Deprecated with pointer to new blocks.

Readability

  • KeyValueBlock entries render as bold key: + regular value (Languages, Work Eligibility, Open Source, Speaking labels).

Refactor

  • Module#renderWorkHistory and Module#renderEducation extracted common concatStructuredFields + renderConcatenatedParagraphs helpers. Future 4-field blocks plug in without copy-paste.

Source compatibility

  • No public API removed. Source-compatible with v1.6.3.
  • Block sealed hierarchy grew from 6 to 7 permits (then 8 with EducationBlock); no exhaustive switches on Block in main source.

Test plan

  • ./mvnw verify -pl .813 tests, 0 failures, 0 errors, 0 skipped
  • New BoxedSectionsStructuredRegressionTest (4 tests) pins all v1.6.4 behaviours with checked-in baselines under cv-v2/regression/
  • Existing PresetLayoutSnapshotTest snapshot for template_v2_cv_boxed_sections.json updated to reflect parser fix
  • Visual baseline cv-v2/boxed_sections-page-0.png refreshed
  • Examples regenerate cleanly: 26 PDFs, cv-boxed-sections.pdf visually validated by user (Education + Experience structured layout + bold KeyValue keys)

…cation blocks + bold KeyValue

Bug fixes:
- BoxedSections#parseWorkEntry now accepts em-dash, en-dash, ASCII hyphen
  as date/description separator (was ASCII-only, breaking entries typed
  with proper typography).
- parseWorkEntry rejects post-pipe segments containing sentence-ending
  punctuation when no explicit separator is found, so Education entries
  like "...| 2019. First-class honours..." no longer collapse the
  description into the right-aligned date column.
- BoxedSections#parseProjectItem mirrors the same separator set for
  consistency with parseWorkEntry.

New structured API (preferred for new code):
- WorkHistoryBlock with Item(title, organisation, date, description)
  added to the Block sealed hierarchy. BoxedSections dispatches it
  straight to renderWorkEntry, bypassing the heuristic parser.
- EducationBlock with Item(degree, institution, year, details) follows
  the same pattern. Renders with the same structured layout as work
  entries (degree bold left, year right, institution italic, details
  below).
- MultiParagraphBlock pipe-separated lines continue to work for legacy
  callers; parseWorkEntry is marked @deprecated with a pointer to the
  structured blocks.

Readability:
- KeyValueBlock renders entries as bold key + regular value (was flat
  body weight), so Languages / Work Eligibility / Open Source labels in
  the Additional Information module visually separate from the prose.

Refactor:
- Module#renderWorkHistory and Module#renderEducation extracted into
  concatStructuredFields + renderConcatenatedParagraphs helpers — any
  future 4-field structured block (publications, projects, etc.) plugs
  into the same pipeline without copy-paste.

Tests:
- New BoxedSectionsStructuredRegressionTest pins the four v1.6.4
  behaviours with checked-in baselines under cv-v2/regression/.
- BlockTest updated for seven permitted Block variants.
- Sample data in ExampleDataFactory.sampleCvSpecV2 and
  PresetVisualGalleryTest migrated to WorkHistoryBlock as the canonical
  user-facing example.
- PresetLayoutSnapshotTest kept on MultiParagraphBlock with a comment
  explaining the intentional legacy-path coverage.

No public API removed. Source-compatible with v1.6.3.
@DemchaAV DemchaAV merged commit 609cf7a into develop May 22, 2026
9 checks passed
@DemchaAV DemchaAV deleted the fix/boxed-sections-experience-layout branch May 22, 2026 12:13
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