Skip to content

sync: port the v1.9.1 line from main into 2.0-dev#325

Merged
DemchaAV merged 5 commits into
2.0-devfrom
sync/v1.9.1-line
Jul 6, 2026
Merged

sync: port the v1.9.1 line from main into 2.0-dev#325
DemchaAV merged 5 commits into
2.0-devfrom
sync/v1.9.1-line

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Why

2.0-dev last synced with the release line at the v1.9.0 state (#291, squash), so the v1.9.1 release — including its bug fix — never reached the 2.0 line. History is squash-disconnected, so this ports the missing commits by cherry-pick rather than a branch merge.

What

Cherry-picked from main, in order:

2.0-line adaptations (the module split moved test homes): the document.table/document.dsl tests and the layout-snapshot baseline land in qa/; TokenBreakingTest stays in core next to RowSlotsTest. CHANGELOG.md gains the released v1.9.1 — 2026-07-06 section between v2.0.0 and v1.9.0.

Deliberately not ported: Release v1.9.1 (version flip), the post-release showcase-link flip, and the README v1.9.1-status commit (#314 — the 2.0 README is rewritten; if the graph-compose-markdown companion mention should carry over, that's a separate small PR).

Tests

Port fidelity: TextFlowSupport, TableLayoutSupport, TokenBreaking and every ported test/baseline are byte-identical to main. Full aggregator verify (core + all backends + templates + testing + qa incl. javadoc gate): BUILD SUCCESS, 0 failures — core 345→358 (+TokenBreaking tests), qa 630→639 (+the ported table/inline-code tests); no existing snapshot shifted. Examples module compiles with the new example.

DemchaAV and others added 5 commits July 6, 2026 20:05
* fix(engine): break over-wide inline-code tokens within their column

Long code tokens with no whitespace — package coordinates, FQCNs, URLs
like org.junit.jupiter:junit-jupiter:5.10.2 — overflowed a paragraph or
table cell instead of wrapping, drawing over the neighbouring content.
All three paragraph wrap paths placed a lone over-wide token as-is, and
highlight-chip words were never broken at all.

Route an over-wide token through a new breakLongToken helper on the plain,
inline, and markdown wrap paths. It breaks at soft seams (. : / -) so
coordinates and URLs split at readable boundaries, and char-splits any
segment still too wide as a last resort. Highlight-chip words break the
same way while keeping one rounded fill per visual fragment: the split
pieces retain the run's highlight group and background, with the outer
padding on the first and last fragment only and the break seams open.

Tokens that already fit follow the unchanged fast path, so existing prose
and layouts are byte-identical (full suite green, no snapshot drift).

* feat(engine): size AUTO table columns to composed cell content

A composed table cell (DocumentTableCell.node(...)) contributed no natural
width, so an AUTO column holding only composed content collapsed toward zero
and its child — an inline-code chip, say — was laid out at a near-zero width.

Measure a composed cell's intrinsic content width in resolveNaturalColumnWidths
and feed it into the AUTO column's natural width, reusing the same
prepare-to-measure pattern as RowSlots.intrinsicColumnWidths. The child is
measured against the table's inner width, so one cell can never demand more
than the table can give. Only single-column composed cells in AUTO columns are
measured; plain-text cells, FIXED columns and spanning cells are unchanged, so
a chip in a FIXED column keeps its declared width and breaks inside it.

As with plain-text AUTO columns, a table too narrow for the summed intrinsic
width of its AUTO columns still reports "exceeds available width".

* docs(examples): add inline-code column-wrap example + CHANGELOG entry

InlineCodeColumnWrapExample renders a long inlineCode(...) coordinate breaking
at its . : / - seams inside a narrow fixed column and fitting on one line in an
auto column, registered in GenerateAllExamples with a committed preview PDF and
a README quick-reference row. CHANGELOG v1.9.1 documents the chip-overflow fix
and the auto-column sizing.
Bumps the maven-minor-patch group with 1 update in the / directory: [net.bytebuddy:byte-buddy](https://github.com/raphw/byte-buddy).


Updates `net.bytebuddy:byte-buddy` from 1.18.10 to 1.18.11
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](raphw/byte-buddy@byte-buddy-1.18.10...byte-buddy-1.18.11)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy
  dependency-version: 1.18.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: maven-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artem Demchyshyn <132658418+DemchaAV@users.noreply.github.com>
* refactor(engine): extract TokenBreaking from TextFlowSupport

The token-breaking family — breakLongToken, softBreakSegments, splitLongToken
and fitCharacters — was pure string logic reachable only through breakLongToken
from the three wrap loops, yet covered only end-to-end via the paragraph render
tests. Move it verbatim into a package-private TokenBreaking; TextFlowSupport
now calls TokenBreaking.breakLongToken(...) at its three wrap sites. Behaviour is
unchanged (methods lifted as-is) and the wrap file drops ~125 lines.

Add TokenBreakingTest: direct coverage of seam segmentation, greedy packing, the
char-level fallback and the min-one-char guarantee, driven by a deterministic
fixed-width measurement double so the assertions do not depend on font metrics.

* refactor(engine): harden the TokenBreaking helper surface

Guard softBreakSegments against null/empty (splitLongToken already did, and both
are now package-visible directly-callable entry points), add the @author tag to
match the sibling layout helpers, and cover the null/empty and fits-whole edges
directly in TokenBreakingTest.
In the lightbox header the action buttons could shrink to their min-content
(the longest word) and wrap ("Open"/"PDF" on two lines) whenever the card title
was long enough to squeeze them — so the buttons looked inconsistent between
cards. Give .example-action white-space: nowrap + flex-shrink: 0 and .lightbox-
actions flex-shrink: 0 so the buttons keep a stable single-line size, and give
.lightbox-title min-width: 0 so a long title wraps instead of compressing them.
…ersions

The banner pill renders "v" + the stamped project version inside a fixed
96pt rounded rect. A dev/pre-release qualifier ("2.0.0-SNAPSHOT",
"2.0.0-beta.1") is wider than the pill, and the engine now wraps long
tokens at their "." / "-" seams, so the pill broke onto two lines and
shifted the title-page layout. Show the base version only ("v2.0.0") —
the footer keeps the full qualified version — so the pill geometry stays
stable across dev and release stamps.
@DemchaAV

DemchaAV commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

CI fix: the Examples smoke job failed because the ported wrapping fix made the deck's 96pt version pill break "v2.0.0-SNAPSHOT" onto two lines (the qualifier has "."/"-" seams), shifting the title page vs the committed layout baseline — on main the stamped version is the short "v1.9.1", so it never hit there. The pill now shows the base version only ("v2.0.0"; the footer keeps the full qualifier), which returns the layout to the committed baseline byte-for-byte — no baseline churn, and the pill stays stable across future version stamps ("-beta.1" etc.). All 31 examples tests green locally.

@DemchaAV DemchaAV merged commit e18e49c into 2.0-dev Jul 6, 2026
12 checks passed
@DemchaAV DemchaAV deleted the sync/v1.9.1-line branch July 6, 2026 19:28
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