Bump ratatui to 0.29.0 (#15187)

This is the most recent version

Deduplicates the `crossterm` dependency, brings `itertools` in line with
the majority of dependencies.

In the fight against compile times this sadly introduces a
proc-macro-crate for writing proc-macros (`darling`) as a transitive
dependency. So may not lead to a compile time improvement (or could make
it even slightly worse)

Observation: Cargo changed the `Cargo.lock` file version when running
this. (this should still be the specified toolchain, so don't expect a
risk of locking out the expected `cargo` versions)
This commit is contained in:
Stefan Holderbach 2025-02-26 13:22:47 +01:00 committed by GitHub
parent 1ab09256d7
commit 6f6ad23072
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 83 additions and 62 deletions

133
Cargo.lock generated
View File

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "addr2line"
@ -1088,25 +1088,12 @@ version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24f165e7b643266ea80cb858aed492ad9280e3e05ce24d4a99d7d7b889b6a4d9"
dependencies = [
"crossterm 0.28.1",
"crossterm",
"strum",
"strum_macros",
"unicode-width 0.2.0",
]
[[package]]
name = "compact_str"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f"
dependencies = [
"castaway",
"cfg-if",
"itoa",
"ryu",
"static_assertions",
]
[[package]]
name = "compact_str"
version = "0.8.0"
@ -1283,22 +1270,6 @@ version = "0.8.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
[[package]]
name = "crossterm"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df"
dependencies = [
"bitflags 2.6.0",
"crossterm_winapi",
"libc",
"mio 0.8.11",
"parking_lot",
"signal-hook",
"signal-hook-mio",
"winapi",
]
[[package]]
name = "crossterm"
version = "0.28.1"
@ -1425,6 +1396,41 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "darling"
version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989"
dependencies = [
"darling_core",
"darling_macro",
]
[[package]]
name = "darling_core"
version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5"
dependencies = [
"fnv",
"ident_case",
"proc-macro2",
"quote",
"strsim",
"syn 2.0.90",
]
[[package]]
name = "darling_macro"
version = "0.20.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [
"darling_core",
"quote",
"syn 2.0.90",
]
[[package]]
name = "data-encoding"
version = "2.8.0"
@ -2639,6 +2645,12 @@ dependencies = [
"syn 2.0.90",
]
[[package]]
name = "ident_case"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
version = "1.0.3"
@ -2684,6 +2696,12 @@ dependencies = [
"web-time",
]
[[package]]
name = "indoc"
version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
[[package]]
name = "inotify"
version = "0.9.6"
@ -2704,6 +2722,19 @@ dependencies = [
"libc",
]
[[package]]
name = "instability"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d"
dependencies = [
"darling",
"indoc",
"proc-macro2",
"quote",
"syn 2.0.90",
]
[[package]]
name = "interprocess"
version = "2.2.2"
@ -3438,7 +3469,7 @@ name = "nu"
version = "0.102.1"
dependencies = [
"assert_cmd",
"crossterm 0.28.1",
"crossterm",
"ctrlc",
"dirs",
"fancy-regex",
@ -3493,7 +3524,7 @@ name = "nu-cli"
version = "0.102.1"
dependencies = [
"chrono",
"crossterm 0.28.1",
"crossterm",
"fancy-regex",
"is_executable",
"log",
@ -3613,7 +3644,7 @@ dependencies = [
"chrono",
"chrono-humanize",
"chrono-tz",
"crossterm 0.28.1",
"crossterm",
"csv",
"data-encoding",
"devicons",
@ -3739,7 +3770,7 @@ version = "0.102.1"
dependencies = [
"ansi-str",
"anyhow",
"crossterm 0.28.1",
"crossterm",
"log",
"lscolors",
"nu-ansi-term",
@ -4017,7 +4048,7 @@ dependencies = [
name = "nu-utils"
version = "0.102.1"
dependencies = [
"crossterm 0.28.1",
"crossterm",
"crossterm_winapi",
"fancy-regex",
"log",
@ -5350,7 +5381,7 @@ dependencies = [
"bincode",
"bytemuck",
"bytes",
"compact_str 0.8.0",
"compact_str",
"flate2",
"hashbrown 0.15.2",
"indexmap",
@ -5713,22 +5744,23 @@ dependencies = [
[[package]]
name = "ratatui"
version = "0.26.3"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f44c9e68fd46eda15c646fbb85e1040b657a58cdc8c98db1d97a55930d991eef"
checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"
dependencies = [
"bitflags 2.6.0",
"cassowary",
"compact_str 0.7.1",
"crossterm 0.27.0",
"itertools 0.12.1",
"compact_str",
"crossterm",
"indoc",
"instability",
"itertools 0.13.0",
"lru",
"paste",
"stability",
"strum",
"unicode-segmentation",
"unicode-truncate",
"unicode-width 0.1.11",
"unicode-width 0.2.0",
]
[[package]]
@ -5813,7 +5845,7 @@ source = "git+https://github.com/nushell/reedline?branch=main#4ca1ed960f8b3a1c9c
dependencies = [
"arboard",
"chrono",
"crossterm 0.28.1",
"crossterm",
"fd-lock",
"itertools 0.12.1",
"nu-ansi-term",
@ -6572,7 +6604,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd"
dependencies = [
"libc",
"mio 0.8.11",
"mio 1.0.3",
"signal-hook",
]
@ -6714,16 +6745,6 @@ dependencies = [
"log",
]
[[package]]
name = "stability"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac"
dependencies = [
"quote",
"syn 2.0.90",
]
[[package]]
name = "stable_deref_trait"
version = "1.2.0"

View File

@ -138,7 +138,7 @@ quote = "1.0"
rand = "0.8"
getrandom = "0.2" # pick same version that rand requires
rand_chacha = "0.3.1"
ratatui = "0.26"
ratatui = "0.29"
rayon = "1.10"
reedline = "0.38.0"
rmp = "0.8"

View File

@ -344,7 +344,7 @@ fn draw_frame(
layout: &mut Layout,
info: ViewInfo,
) {
let area = f.size();
let area = f.area();
let available_area = Rect::new(area.x, area.y, area.width, area.height.saturating_sub(2));
if let Some(page) = view {
@ -359,7 +359,7 @@ fn draw_frame(
}
fn draw_info(f: &mut Frame, pager: &mut Pager<'_>, info: ViewInfo) {
let area = f.size();
let area = f.area();
if let Some(report) = info.status {
let last_2nd_line = area.bottom().saturating_sub(2);
@ -453,14 +453,14 @@ fn set_cursor_cmd_bar(f: &mut Frame, area: Rect, pager: &Pager) {
let next_pos = (pager.cmd_buf.buf_cmd2.len() + 1) as u16;
// 1 skips a ':' char
if next_pos < area.width {
f.set_cursor(next_pos, area.height - 1);
f.set_cursor_position((next_pos, area.height - 1));
}
} else if pager.search_buf.is_search_input {
// todo: deal with a situation where we exceed the bar width
let next_pos = (pager.search_buf.buf_cmd_input.len() + 1) as u16;
// 1 skips a ':' char
if next_pos < area.width {
f.set_cursor(next_pos, area.height - 1);
f.set_cursor_position((next_pos, area.height - 1));
}
}
}

View File

@ -109,7 +109,7 @@ impl View for TryView {
let cur_w = area.x + 1 + 1 + 1 + max_cmd_len;
let cur_w_max = area.x + 1 + 1 + 1 + area.width - 2 - 1 - 1 - 1 - 1;
if cur_w < cur_w_max {
f.set_cursor(area.x + 1 + 1 + 1 + max_cmd_len, area.y + 1);
f.set_cursor_position((area.x + 1 + 1 + 1 + max_cmd_len, area.y + 1));
}
}