You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): code-block background no longer fragments on narrow panels (cli-3.4.1) (#58)
The fenced-code renderer used to pad each line to the longest line of its
block and emit it as a single Line, letting `Paragraph::wrap` re-flow on
render. Ratatui's word-wrap drops trailing styled whitespace at the wrap
point, so when a code line was wider than the document panel the gray
background broke into truncated stripes — visibly worst on terminal
resizes and on narrow initial layouts (reported via screenshot).
Pre-wrap inside markdown_to_lines using a new visual-column-aware
hard-wrap helper. Each emitted Line is now bounded by `available_width`,
so ratatui never re-wraps it and the gutter background paints uniformly
on every visual row. Indentation is preserved (no whitespace trim) and
double-wide CJK chars never split mid-glyph.
Adds wrap_visual_columns + 7 regression tests covering hard-wrap math,
CJK boundary safety, blank-line preservation, and end-to-end pipeline
output bounded by panel width.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,13 @@ and this project uses [independent versioning](README.md#versioning) for Framewo
7
7
8
8
---
9
9
10
+
## CLI 3.4.1 — Code-Block Background No Longer Fragments on Narrow Panels
11
+
12
+
### Fixed (CLI)
13
+
- Fix the gray background of fenced code blocks in `devtrail explore` breaking into truncated stripes when the document panel is narrower than the longest code line. The renderer used to pad each code line to the longest line and let `Paragraph::wrap` re-flow it, which dropped trailing styled whitespace at the wrap point and left visible gaps between content rows. The code-block renderer now hard-wraps lines into chunks no wider than the panel itself (visual-column aware, UTF-8 / CJK safe, indentation preserved), so each visual row paints its own uninterrupted gray gutter regardless of terminal size or live resizes. Blank lines inside code blocks also keep their background.
0 commit comments