Skip to content

refactor(templates): extract shared widgets to templates.core.widgets#251

Merged
DemchaAV merged 1 commit into
2.0-devfrom
feat/templates-core-widgets
Jun 28, 2026
Merged

refactor(templates): extract shared widgets to templates.core.widgets#251
DemchaAV merged 1 commit into
2.0-devfrom
feat/templates-core-widgets

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

The family-neutral visual widgets (CardWidget, TableWidget, TimelineAxisWidget)
and the decoration primitives (Divider, AccentStrip, Spacer) lived in the
top-level templates.widgets / templates.decorations packages. Moving them into
templates.core.widgets finishes the neutral core so invoice / proposal can reuse them
alongside the theme / text / identity layers. A package move of public types is a binary
break, so this lands on the 2.0 line.

What changed

  • Moved to core.widgets: CardWidget, TableWidget, TimelineAxisWidget,
    AccentStrip, Divider, Spacer. Added core/widgets/package-info.java.
  • Retired the now-empty templates.widgets and templates.decorations packages
    (removed their package-info).
  • Repointed the cv.v2 / coverletter.v2 callers and relocated the four
    widget / decoration test mirrors to core.widgets.
  • Pure move — no rename, no behavioural change.

Lane: templates (canonical). Target: 2.0-dev.

Deferred: the decoration primitives are currently unused by cv.v2 (it hand-rolls
inline spacer/strip nodes); wiring everyone to the shared helpers (the dedupe) and adding
dedicated CardWidget / TimelineAxisWidget tests are Stage-2 follow-ups, done when
invoice / proposal land a real consumer. .md doc renames ride the docs refresh.

Verification

  • ./mvnw -P japicmp verify -pl .Tests run: 1612, Failures: 0, Errors: 0 — zero
    snapshot updates → render byte-identical; javadoc gate clean; japicmp report-only.
  • ./mvnw javadoc:javadoc -pl . → BUILD SUCCESS (the strict report gate CI runs — caught
    and fixed a dangling package {@link} in cv/v2/widgets/package-info.java).
  • examples test-compile + GenerateAllExamples → every example PDF regenerates.

Move the family-neutral widgets — CardWidget, TableWidget, TimelineAxisWidget —
and the Divider / AccentStrip / Spacer decoration primitives into
com.demcha.compose.document.templates.core.widgets so any template family can
reuse them, and retire the now-empty templates.widgets and templates.decorations
packages. Repoint the cv.v2 / coverletter.v2 callers and relocate the widget and
decoration test mirrors. Pure move — render byte-identical (1612 tests, zero
snapshot updates); a deliberate binary break on the 2.0 line (japicmp report-only).
@DemchaAV DemchaAV merged commit 842db31 into 2.0-dev Jun 28, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/templates-core-widgets branch June 28, 2026 10:10
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