fix: Boxed Sections parser + structured WorkHistory/Education blocks + bold KeyValue (v1.6.4)#44
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Patch release for Boxed Sections layout correctness and structural API additions.
Bug fixes
BoxedSections#parseWorkEntryaccepts em-dash—, en-dash–, ASCII-as date/description separator (was ASCII-only)."... | 2019. First-class honours..."no longer collapse description into the right-aligned date column.parseProjectItemgets 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.renderWorkEntry, bypassing the heuristic parser entirely.MultiParagraphBlockpipe-separated lines continue to work;parseWorkEntrymarked@Deprecatedwith pointer to new blocks.Readability
KeyValueBlockentries render as bold key: + regular value (Languages, Work Eligibility, Open Source, Speaking labels).Refactor
Module#renderWorkHistoryandModule#renderEducationextracted commonconcatStructuredFields+renderConcatenatedParagraphshelpers. Future 4-field blocks plug in without copy-paste.Source compatibility
Test plan
./mvnw verify -pl .→ 813 tests, 0 failures, 0 errors, 0 skippedBoxedSectionsStructuredRegressionTest(4 tests) pins all v1.6.4 behaviours with checked-in baselines undercv-v2/regression/PresetLayoutSnapshotTestsnapshot fortemplate_v2_cv_boxed_sections.jsonupdated to reflect parser fixcv-v2/boxed_sections-page-0.pngrefreshedcv-boxed-sections.pdfvisually validated by user (Education + Experience structured layout + bold KeyValue keys)