Skip to content

chore(deps): bump ratatui-image 10.0.7 -> 11.0.5#24

Merged
leboiko merged 1 commit into
masterfrom
chore/bump-ratatui-image-11
Jun 22, 2026
Merged

chore(deps): bump ratatui-image 10.0.7 -> 11.0.5#24
leboiko merged 1 commit into
masterfrom
chore/bump-ratatui-image-11

Conversation

@leboiko

@leboiko leboiko commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

Bumps ratatui-image to v11.0.5 (from 10.0.7) — the headline change — and picks up the latest ratatui 0.30.x patch releases via the lockfile.

Crate Before After
ratatui-image 10.0.7 11.0.5
ratatui 0.30.1 0.30.2
ratatui-core 0.1.1 0.1.2
ratatui-crossterm / widgets / macros / termwiz latest 0.x patches

v11 requires ratatui ^0.30.1, so no ratatui major bump was needed.

Code change

v11's only breaking change that touches our code is FontSize: it went from a (u16, u16) tuple to a struct with width/height fields. compute_cell_height() now reads .height instead of destructuring:

-    let (_, cell_px_h) = picker.font_size();
+    let cell_px_h = picker.font_size().height;

The rest of our usage is unchanged in v11: Picker::halfblocks, Picker::from_query_stdio, new_resize_protocol, StatefulImage::new().resize(Resize::Fit(None)), StatefulProtocol.

Verification (full local CI gate)

  • cargo build
  • cargo fmt --all -- --check ✅ clean
  • cargo clippy --workspace --all-targets -- -D warnings ✅ no warnings
  • cargo test --workspace1529 passed, 0 failed
  • cargo deny check ✅ advisories/bans/licenses/sources ok (pre-existing usvg/resvg/tiny-skia duplicate warnings are unrelated — resvg 0.47 direct vs 0.46 via mermaid-rs-renderer)

Follow-up (not in this PR)

v11 adds a sliced module (SlicedProtocol/SlicedImage) with native vertical image scrolling, plus Image::allow_clipping. The mermaid modal currently pans a Resize::Fit image with j/k/h/l; the sliced protocol could give it true native scroll. Worth a separate spike.

🤖 Generated with Claude Code

Update ratatui-image to v11 and pick up the latest ratatui 0.30.x
patch releases via the lockfile (ratatui 0.30.1 -> 0.30.2 and the
companion core/crossterm/widgets/macros/termwiz crates).

v11's only breaking change that touches our code is FontSize: it
changed from a (u16, u16) tuple to a struct with width/height
fields, so compute_cell_height() now reads `.height` instead of
destructuring the tuple. The rest of our usage (Picker::halfblocks,
from_query_stdio, new_resize_protocol, StatefulImage/Resize::Fit,
StatefulProtocol) is unchanged.

v11 requires ratatui ^0.30.1, so no ratatui major bump was needed.

Verified: cargo build, fmt --check, clippy -D warnings,
test --workspace (1529 passed), and cargo deny check all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@leboiko leboiko left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — PR #24: bump ratatui-image 10.0.7 → 11.0.5

Verdict: clean. No blocking findings (0 🔴, 0 🟠, 1 🟡 informational).

This is a tight, well-scoped dependency bump. Reviewed across architecture, code quality, Rust-specific patterns, dependency hygiene, and testing.

Scope

File Change
Cargo.toml ratatui-image 10.0.7 → 11.0.5 (1 line)
Cargo.lock mechanical: ratatui 0.30.1→0.30.2, core/crossterm/widgets/macros/termwiz patches, new transitive self_cell/termina/ratatui-termina
src/mermaid.rs 1 line — FontSize tuple → struct migration

Architecture & design

No structural change. The bump stays within ratatui ^0.30.1, so no cascading major upgrade. ✅

Code quality (Rust)

  • The single semantic change (compute_cell_height) is the correct, idiomatic v11 equivalent of the old tuple destructure. Semantics are identical — it still reads the per-cell pixel height.
  • No unwrap()/expect() introduced; the existing cell_px_h == 0 divide-by-zero guard is preserved. ✅
  • No executor-blocking risk introduced. render_blocking is explicitly named/scoped as blocking and is unchanged; the diff adds no sync I/O, locks-across-await, or block_on. ✅
  • No new magic numbers, dead code, or duplication.

Dependency hygiene

ratatui-image has a single consumer (the root binary crate); the workspace member mermaid-text does not depend on it, so there is no version-drift surface and no [workspace.dependencies] hoist is warranted here. ✅

Testing & reliability

No new behavior to test — this is a mechanical API migration with identical output. The existing picker-backed tests (cache_height_ready_returns_cell_height, text_mode_never_spawns_image_task) exercise the changed path and pass. The PR documents the full local gate: build, fmt --check, clippy -D warnings, test --workspace (1529 passed), cargo deny check — all green. Regression risk is low. ✅

Note

The pre-existing usvg/resvg/tiny-skia duplicate warnings from cargo deny are unrelated to this PR (resvg 0.47 direct vs 0.46 via mermaid-rs-renderer) and correctly called out as out-of-scope.

Good to merge once CI is green.

Comment thread src/mermaid.rs
/// * `max_height` – upper bound in display lines (from `Config::mermaid_max_height`).
fn compute_cell_height(img: &DynamicImage, picker: &Picker, max_height: u32) -> u32 {
let (_, cell_px_h) = picker.font_size();
let cell_px_h = picker.font_size().height;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Informational — migration is correct. In ratatui-image v11, Picker::font_size() returns a FontSize struct ({ width, height }) instead of a (u16, u16) tuple. .height is the right field — it preserves the original (_, cell_px_h) semantics exactly (per-cell pixel height). Verified this is the only font_size() tuple destructure in the tree, so no other call site was silently left behind by the type change. No action needed.

@leboiko leboiko merged commit be9ec76 into master Jun 22, 2026
12 checks passed
@leboiko leboiko deleted the chore/bump-ratatui-image-11 branch June 22, 2026 14:57
leboiko added a commit that referenced this pull request Jun 22, 2026
Ships the ratatui-image v11 upgrade from #24:

- ratatui-image 10.0.7 -> 11.0.5; ratatui 0.30.1 -> 0.30.2 and the
  companion core/crossterm/widgets/macros/termwiz patches via the lockfile.
- v11's FontSize tuple->struct change handled in compute_cell_height
  (reads .height). No user-visible behaviour change.

fmt/clippy/test (1529 passed)/deny all green locally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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